Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native App Transport Security has blocked

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>
like image 563
Istvan Orban Avatar asked Mar 06 '23 19:03

Istvan Orban


1 Answers

You need to add this key in Info.plist enter image description here

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
</dict>
like image 69
chirag shah Avatar answered Mar 16 '23 08:03

chirag shah