Updated docs for next

This commit is contained in:
Website Deployment Script
2017-05-23 23:47:29 +00:00
parent 4081c2bcc5
commit ec5480b93a
@@ -228,9 +228,9 @@ const styles <span class="token operator">=</span> StyleSheet<span class="token
self<span class="token punctuation">.</span><span class="token function">present<span class="token punctuation">(</span></span>vc<span class="token punctuation">,</span> animated<span class="token punctuation">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span> completion<span class="token punctuation">:</span> nil<span class="token punctuation">)</span>
<span class="token punctuation">}</span></div><blockquote><p>Note that <code>RCTRootView bundleURL</code> starts up a new JSC VM. To save resources and simplify the communication between RN views in different parts of your native app, you can have multiple views powered by React Native that are associated with a single JS runtime. To do that, instead of using <code>RCTRootView bundleURL</code>, use <a href="https://github.com/facebook/react-native/blob/master/React/Base/RCTBridge.h#L93" target="_blank"><code>RCTBridge initWithBundleURL</code></a> to create a bridge and then use <code>RCTRootView initWithBridge</code>.</p></blockquote><span><block class="objc" />
</span><blockquote><p>When moving your app to production, the <code>NSURL</code> can point to a pre-bundled file on disk via something like <code>[[NSBundle mainBundle] URLForResource:@&quot;main&quot; withExtension:@&quot;jsbundle&quot;];</code>. You can use the <code>react-native-xcode.sh</code> script in <code>node_modules/react-native/packager/</code> to generate that pre-bundled file.</p></blockquote><span><block class="swift" />
</span><blockquote><p>When moving your app to production, the <code>NSURL</code> can point to a pre-bundled file on disk via something like <code>[[NSBundle mainBundle] URLForResource:@&quot;main&quot; withExtension:@&quot;jsbundle&quot;];</code>. You can use the <code>react-native-xcode.sh</code> script in <code>node_modules/react-native/scripts/</code> to generate that pre-bundled file.</p></blockquote><span><block class="swift" />
</span><blockquote><p>When moving your app to production, the <code>NSURL</code> can point to a pre-bundled file on disk via something like <code>let mainBundle = NSBundle(URLForResource: &quot;main&quot; withExtension:&quot;jsbundle&quot;)</code>. You can use the <code>react-native-xcode.sh</code> script in <code>node_modules/react-native/packager/</code> to generate that pre-bundled file.</p></blockquote><span><block class="objc swift" />
</span><blockquote><p>When moving your app to production, the <code>NSURL</code> can point to a pre-bundled file on disk via something like <code>let mainBundle = NSBundle(URLForResource: &quot;main&quot; withExtension:&quot;jsbundle&quot;)</code>. You can use the <code>react-native-xcode.sh</code> script in <code>node_modules/react-native/scripts/</code> to generate that pre-bundled file.</p></blockquote><span><block class="objc swift" />
</span><h4><a class="anchor" name="wire-up"></a>Wire Up <a class="hash-link" href="docs/integration-with-existing-apps.html#wire-up">#</a></h4><p>Wire up the new link in the main menu to the newly added event handler method.</p><p><img src="img/react-native-add-react-native-integration-wire-up.png" alt="Event Path"></p><blockquote><p>One of the easier ways to do this is to open the view in the storyboard and right click on the new link. Select something such as the <code>Touch Up Inside</code> event, drag that to the storyboard and then select the created method from the list provided.</p></blockquote><h2><a class="anchor" name="test-your-integration"></a>Test Your Integration <a class="hash-link" href="docs/integration-with-existing-apps.html#test-your-integration">#</a></h2><p>You have now done all the basic steps to integrate React Native with your current application. Now we will start the React Native packager to build the <code>index.ios.bundle</code> packager and the server running on <code>localhost</code> to serve it.</p><h3><a class="anchor" name="app-transport-security"></a>App Transport Security <a class="hash-link" href="docs/integration-with-existing-apps.html#app-transport-security">#</a></h3><p>Apple has blocked implicit cleartext HTTP resource loading. So we need to add the following our project&#x27;s <code>Info.plist</code> (or equivalent) file.</p><div class="prism language-javascript">&lt;key<span class="token operator">&gt;</span>NSAppTransportSecurity&lt;<span class="token operator">/</span>key<span class="token operator">&gt;</span>
&lt;dict<span class="token operator">&gt;</span>