react-native icon indicating copy to clipboard operation
react-native copied to clipboard

Http fetch is not working after upgrading to react-native 0.28

Open faisalil opened this issue 10 years ago • 4 comments

After upgrading to the latest version, looks like fetch for http (note not https) based endpoints is broken. Was this change by design? What broke it?

faisalil avatar Jun 23 '16 00:06 faisalil

Hot Reloading also doesnot work, i change it back to 0.27.2, it's work!

jing2si avatar Jun 23 '16 06:06 jing2si

Found the problem. Looks like as part of the upgrade, the following changes happened to plist.Info:

Removed :

    <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
    </dict>
    <key>NSLocationWhenInUseUsageDescription</key>
    <string></string>

Added :

    <key>NSLocationWhenInUseUsageDescription</key>
    <string></string>
    <key>NSAppTransportSecurity</key>
    <!--See http://ste.vn/2015/06/10/configuring-app-transport-security-ios-9-osx-10-11/ -->
    <dict>
        <key>NSExceptionDomains</key>
        <dict>
            <key>localhost</key>
            <dict>
                <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
                <true/>
            </dict>
        </dict>
    </dict>

https://ste.vn/2015/06/10/configuring-app-transport-security-ios-9-osx-10-11/ for more info. You basically need to add the http domains that you use to the plist.Info

faisalil avatar Jun 23 '16 16:06 faisalil

BTW I believe Apple announced they will require HTTPS everywhere so make sure you are ready for that.

ide avatar Jun 24 '16 09:06 ide

@faisalil What we need to do for Android. This is for iOS. ? Thank you.

krkmzugur avatar May 16 '18 06:05 krkmzugur