我正在从 Parse 的后端迁移到 Heroku 和 MongoDB 上的 Parse 服务器。
通过这个新的后端更改,我让一切工作顺利(包括加载 PFFiles),但是,我现在在添加FACEBOOK_APP_ID
参数后遇到错误,但这可能不是原因。
每当我尝试加载PFFile
(图像)时,我都会在日志中收到以下消息:
App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.
2016-02-20 19:55:48.242 HoopMaps[35976:682425] [Error]: The resource could not be loaded because the App Transport Security policy requires the use of a secure connection. (Code: 100, Version: 1.12.0)
2016-02-20 19:55:48.243 HoopMaps[35976:682425] [Error]: Network connection failed. Making attempt 1 after sleeping for 1.730434 seconds.
2016-02-20 19:55:50.137 HoopMaps[35976:682402] [Error]: The resource could not be loaded because the App Transport Security policy requires the use of a secure connection. (Code: 100, Version: 1.12.0)
2016-02-20 19:55:50.138 HoopMaps[35976:682402] [Error]: Network connection failed. Making attempt 2 after sleeping for 3.460868 seconds.
2016-02-20 19:55:53.857 HoopMaps[35976:682403] [Error]: The resource could not be loaded because the App Transport Security policy requires the use of a secure connection. (Code: 100, Version: 1.12.0)
2016-02-20 19:55:53.857 HoopMaps[35976:682403] [Error]: Network connection failed. Making attempt 3 after sleeping for 6.921736 seconds.
2016-02-20 19:56:01.162 HoopMaps[35976:682821] [Error]: The resource could not be loaded because the App Transport Security policy requires the use of a secure connection. (Code: 100, Version: 1.12.0)
2016-02-20 19:56:01.162 HoopMaps[35976:682821] [Error]: Network connection failed. Making attempt 4 after sleeping for 13.843473 seconds.
2016-02-20 19:56:15.264 HoopMaps[35976:682785] [Error]: The resource could not be loaded because the App Transport Security policy requires the use of a secure connection. (Code: 100, Version: 1.12.0)
虽然我可以禁用 ATS,但这是不好的做法,我更喜欢 HTTPS。此外,错误代码是“100”,但我可以连接到我的服务器并检索对象和用户数据。
如何在保留 HTTPS 的同时使用 Parse-server 加载 PFFiles?