diff --git a/releases/next/docs/embedded-app-ios.html b/releases/next/docs/embedded-app-ios.html index 96ceac15c43..fb2d13ac1a8 100644 --- a/releases/next/docs/embedded-app-ios.html +++ b/releases/next/docs/embedded-app-ios.html @@ -40,7 +40,7 @@ React.AppRegistryViewController () @property (weak, nonatomic) IBOutlet ReactView *reactView; -@end
Here I disabled AutoLayout for simplicity. In real production world, you should turn on AutoLayout and setup constraints by yourself.
Ready for the most interesting part? Now we shall create the RCTRootView, where your React Native app lives.
In ReactView.m, we need to first initiate RCTRootView with the URI of your index.ios.bundle. index.ios.bundle will be created by packager and served by React Native server, which will be discussed later on.
NOTE For Swift apps there is no need for that.
Here I disabled AutoLayout for simplicity. In real production world, you should turn on AutoLayout and setup constraints by yourself.
Ready for the most interesting part? Now we shall create the RCTRootView, where your React Native app lives.
In ReactView.m, we need to first initiate RCTRootView with the URI of your index.ios.bundle. index.ios.bundle will be created by packager and served by React Native server, which will be discussed later on.
Then add it as a subview of the ReactView.
In root directory, we need to start React Native development server.
This command will start up a React Native development server within our CocoaPods dependency to build our bundled script. The --root option indicates the root of your React Native apps – this will be our ReactComponents directory containing the single index.ios.js file. This running server will package up the index.ios.bundle file accessible via http://localhost:8081/index.ios.bundle.
On iOS 9 and above the app won't be a able to connect over http to localhost unless specifically told so. See this thread for alternatives and instructions: http://stackoverflow.com/questions/31254725/transport-security-has-blocked-a-cleartext-http.
It is recommended that you add an App Transport Security exception for localhost in your app's Info.plist file:
Add the following to ReactView.swift file:
And then make sure your view is added in a ViewContainer or story board file.
In root directory, we need to start React Native development server.
This command will start up a React Native development server within our CocoaPods dependency to build our bundled script. The --root option indicates the root of your React Native apps – this will be our ReactComponents directory containing the single index.ios.js file. This running server will package up the index.ios.bundle file accessible via http://localhost:8081/index.ios.bundle.
On iOS 9 and above the app won't be a able to connect over http to localhost unless specifically told so. See this thread for alternatives and instructions: http://stackoverflow.com/questions/31254725/transport-security-has-blocked-a-cleartext-http.
It is recommended that you add an App Transport Security exception for localhost in your app's Info.plist file: