问题
I just installed react-native-image-crop.
When I tried to make a photo on an actual iPhone, I received a quite strange error. '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.'
. Is this because I using the metro builder? or something else maybe?
My Info.plist:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>localhost</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
回答1:
You need to add this key in Info.plist
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
来源:https://stackoverflow.com/questions/51363339/react-native-app-transport-security-has-blocked