Skip to content

Commit

Permalink
Add note to networking docs about iOS ATS exceptions
Browse files Browse the repository at this point in the history
Summary:
JoelMarcey requested that I make this PR based on [my comment](7ac931e#commitcomment-18270206).

I have signed the CLA.
However I was unable to verify that the site builds with this change. It looks okay in my markdown editor, but when following the contributor docs and running `npm install && npm start`, I get the following error when hitting node in my browser:

```
error in renderAPI for ../node_modules/react/lib/NativeMethodsMixin.js
Error: ENOENT: no such file or directory, open '../node_modules/react/lib/NativeMethodsMixin.js'
    at Error (native)
    at Object.fs.openSync (fs.js:634:18)
    at Object.fs.readFileSync (fs.js:502:33)
    at renderAPI (/Users/eliot/Dev/react/react-native/website/server/extractDocs.js:439:28)
    at concat.apis.map (/Users/eliot/Dev/react/react-native/website/server/extractDocs.js:601:14)
    at Array.map (native)
    at module.exports (/Users/eliot/Dev/react/react-native/websit
Closes #9107

Differential Revision: D3664102

Pulled By: JoelMarcey

fbshipit-source-id: 845917351ba9d3d2f5351a8f926757718c806025
  • Loading branch information
fadookie authored and Facebook Github Bot committed Aug 3, 2016
1 parent da2684f commit 66cfc76
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/Networking.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ You can also use the proposed ES2017 `async`/`await` syntax in a React Native ap

Don't forget to catch any errors that may be thrown by `fetch`, otherwise they will be dropped silently.
> By default, iOS will block any request that's not encrypted using SSL. If you need to fetch from a cleartext URL (one that begins with `http`) you will first need to add an App Transport Security exception. If you know ahead of time what domains you will need access to, it is more secure to add exceptions just for those domains; if the domains are not known until runtime you can [disable ATS completely](/react-native/docs/integration-with-existing-apps.html#app-transport-security). [See Apple's documentation for more information](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW33).
### Using Other Networking Libraries
The [XMLHttpRequest API](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) is built in to React Native. This means that you can use third party libraries such as [frisbee](https://github.com/niftylettuce/frisbee) or [axios](https://github.com/mzabriskie/axios) that depend on it, or you can use the XMLHttpRequest API directly if you prefer.
Expand Down

0 comments on commit 66cfc76

Please sign in to comment.