<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ibrahim Sulaiman on Medium]]></title>
        <description><![CDATA[Stories by Ibrahim Sulaiman on Medium]]></description>
        <link>https://medium.com/@ibrahim.sulaiman_18323?source=rss-6de565a2a130------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*UlWVcv6BGCkef8aU.</url>
            <title>Stories by Ibrahim Sulaiman on Medium</title>
            <link>https://medium.com/@ibrahim.sulaiman_18323?source=rss-6de565a2a130------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 00:59:59 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ibrahim.sulaiman_18323/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Integrating React Native App in an Existing iOS Native App]]></title>
            <link>https://medium.com/@ibrahim.sulaiman_18323/integrating-react-native-app-in-an-existing-ios-native-app-628afcd23f93?source=rss-6de565a2a130------2</link>
            <guid isPermaLink="false">https://medium.com/p/628afcd23f93</guid>
            <category><![CDATA[swif]]></category>
            <category><![CDATA[integration]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[react-native]]></category>
            <dc:creator><![CDATA[Ibrahim Sulaiman]]></dc:creator>
            <pubDate>Fri, 11 Nov 2022 08:37:49 GMT</pubDate>
            <atom:updated>2022-11-11T08:37:49.444Z</atom:updated>
            <content:encoded><![CDATA[<h4>A step-by-step guide to integrate React Native App in iOS Native App.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ogJOyU2XpbcTVFHUyLzw2A.png" /></figure><p>In this tutorial, we’ll learn how to integrate React Native App in an existing iOS Native app, demonstrating with one example.</p><p>Even-though the official documentation is available on this <a href="http://facebook.github.io/react-native/docs/integration-with-existing-apps">topic</a>, it is not clear and precise for newbies :)</p><p>There are few situations occur where a developer wants to bring the components build using React Native to his/her native projects. This blog deals with the end-to-end detailed steps to achieve the same.</p><h3>Prerequisites</h3><p>Please make sure the below prerequisites are done, for integrating the React Native App into an iOS Native app.</p><ol><li>Create React Native App, which needs to be integrated with Native iOS App. Please refer the <a href="http://facebook.github.io/react-native/docs/getting-started">Getting Started guide</a> for creating the React Native App.</li><li>Create iOS Native App, in which the react native App needs to be plug-in. Please refer the <a href="https://developer.apple.com/library/content/referencelibrary/GettingStarted/DevelopiOSAppsSwift/">Getting Started guide</a> for creating the iOS App.</li><li>Install CocoaPods. <a href="http://cocoapods.org/">CocoaPods</a> is a package management tool for iOS development.</li><li>Make sure <a href="https://www.npmjs.com/">npm</a> / <a href="https://yarnpkg.com/en/">yarn</a> is installed in your machine. The npm / yarn is the package manager for JavaScript. It is used for fast and reliable dependency management.</li></ol><h3>Steps for Integrating the React Native App to our iOS Native app</h3><ol><li>Create “<strong>iOS App</strong>” folder and place the iOS Native App inside the same.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mAzpSJOsHkh3Bx1aImV7RQ.png" /></figure><p>2. Create “<strong>React Native App</strong>” folder and place the React Native App inside the same.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m8UG_eL8TiRmhtN34r_4Vw.png" /></figure><p>3. Open the terminal and navigate to React native project path. Execute the below command, which will create “<strong>node_modules</strong>” folder.</p><blockquote><strong>npm install</strong></blockquote><p><em>or</em></p><blockquote><strong>yarn install</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u74kWB_eN8H9jNhxJAPBbw.png" /></figure><p>Once, the above command successfully executed. The terminal should look like below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*vDHEUmNv1wUPzvgxm3A-Rw.gif" /></figure><p>4. Add the below script in the “<strong>package.json</strong>” file in the React Native project.</p><pre>&quot;scripts&quot;: {</pre><pre>&quot;build:ios&quot;: &quot;node node_modules/react-native/local-cli/cli.js bundle --entry-file=&#39;index.js&#39; --bundle-output=&#39;./main.jsbundle&#39; --dev=false --platform=&#39;ios&#39; --assets-dest=&#39;./ios&#39;&quot;</pre><pre>}</pre><p>Using the above command we can create <strong>main.jsbundle</strong> file using the local cli that lies within the react-native npm package.</p><p>The short description for the above command,</p><p><em>— entry-file=’</em>&lt;path to our index.js file&gt;<em>’</em></p><p><em>— bundle-output=</em>’&lt;path of where main.bundlejs will be created&gt;’</p><p><em>— dev</em>=false (bunch of perf optimisations are made when false)</p><p><em>— platform</em>=’ios’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pZLTzsS5Wf1mdgGqTHP2zg.png" /></figure><p>After adding the above scripts, the “<strong>package.json</strong>” file should looks like below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O2t6pLO_vilHfpZnwLEizA.png" /></figure><p>6. After adding the scripts code in the “package.json” file. Open the terminal and navigate to React native project path. Execute the below command, which will create “<strong>main.jsbundle</strong>”.</p><blockquote><strong>npm run build:ios</strong></blockquote><p><em>or</em></p><blockquote><strong>yarn run build:ios</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QFt2zVBeXKMAOVaCMjg6Jg.png" /></figure><p>Once, the above command successfully executed. The terminal should look like below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*FAnr-MlWf2I2e_AlO3M3iw.gif" /></figure><p>7. After successfully done with the above step, we can able to see the “<strong>main.jsbundle</strong>” have been created in the root folder of the React Native project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WyKDArcGvjrCCwOZGeCCIg.png" /></figure><p>5. Open new terminal window and navigate to iOS native project path and initiate pod file in the project using the below command.</p><blockquote><strong>pod init</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rB6SbQ2KnZyr3aMwOoulXw.png" /></figure><p>After executing the “pod init” command successfully. We can able to see the pod file created in the iOS Native project folder path as below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*MbTJRx-8UmlZxddNlazG6w.png" /></figure><p>6. Open the pod file and include the below pods in it.</p><pre># Your &#39;node_modules&#39; directory is probably in the root of your project,</pre><pre># but if not, adjust the `:path` accordingly</pre><pre>pod &#39;React&#39;, :path =&gt; &#39;../../React Native App/Bakesale/node_modules/react-native&#39;, :subspecs =&gt; [</pre><pre>&#39;Core&#39;,</pre><pre>&#39;CxxBridge&#39;, # Include this for RN &gt;= 0.47</pre><pre>&#39;DevSupport&#39;, # Include this to enable In-App Devmenu</pre><pre>&#39;RCTText&#39;,</pre><pre>&#39;RCTNetwork&#39;,</pre><pre>&#39;RCTImage&#39;,</pre><pre>&#39;RCTWebSocket&#39;, # Needed for debugging</pre><pre># Add any other subspecs you want to use in your project</pre><pre>]</pre><pre># Explicitly include Yoga if you are using RN &gt;= 0.42.0</pre><pre>pod &#39;yoga&#39;, :path =&gt; &#39;../../React Native App/Bakesale/node_modules/react-native/ReactCommon/yoga&#39;</pre><pre># Third party deps podspec link</pre><pre>pod &#39;DoubleConversion&#39;, :podspec =&gt; &#39;../../React Native App/Bakesale/node_modules/react-native/third-party-podspecs/DoubleConversion.podspec&#39;</pre><pre>pod &#39;glog&#39;, :podspec =&gt; &#39;../../React Native App/Bakesale/node_modules/react-native/third-party-podspecs/glog.podspec&#39;</pre><pre>pod &#39;Folly&#39;, :podspec =&gt; &#39;../../React Native App/Bakesale/node_modules/react-native/third-party-podspecs/Folly.podspec&#39;</pre><p>7. After updating the pod file. Execute below command to install the pods.</p><blockquote><strong>pod install</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*259C74HCK8pGwD-Bu3xwYQ.png" /></figure><p>After executing the “pod install” command successfully. We can able to see the below success message in the terminal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*d_tOrVg68nNzu1-kQnXsVg.gif" /></figure><p>8. Open the below mentioned iOS Native project workspace in the XCode IDE.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FIG-g1sOKl2_xVrO7Z0uaw.png" /></figure><p>The iOS native app should look like below in the XCode.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xTlk_qoE8fI8r72hAWr7vQ.png" /></figure><p>9. Drag and drop the “<strong>main.jsbundle</strong>” in the XCode project, , which is created in the above <strong>Step 7.</strong></p><blockquote><strong><em>NOTE </em></strong><em>— In order to get the images to work correctly, We needed to select the “Create folder references” option instead of “Create groups” when adding “main.jsbundle” to the project.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8Qrkxo-_hM9XqS6KjFkpLQ.png" /></figure><p>After adding the “main.jsbundle” file to the iOS Native Project. The iOS native app should look like below in the XCode.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zaPM5PHCKGDldLxGNqXXtw.png" /></figure><p>9. After adding the “main.jsbundle”. Create the Event Handler in the ViewController where the React Native module needs to be invoked.</p><p>In this tutorial, we have integrated the “<strong>Bakesale</strong>”(React Native App) in the iOS Native App.</p><p>We will add an event handler from the button click. A method will be added to the main corresponding view controller of our application. This is where RCTRootView comes into play.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*lfVFew7f1O7tTImkpGFGcA.png" /></figure><p>First import the React library as mentioned below in the ViewController.</p><pre>import React</pre><p>The initialProperties are here for illustration purposes so we have some data for our Bake sale App. In our Bake Sale React Native component, we will use this.props to get access to that data.</p><pre>@IBAction func BakeSaleButtonTapped(sender : UIButton) {</pre><pre>//Code to get the url of the main.jsbundle in the project.<br>   let jsBundleLocation = Bundle.main.url(/service/forresource: &quot;main&quot;, withExtension: &quot;jsbundle&quot;)</pre><pre>//The data is used as initialProperties to React Native App.<br>   let data:NSDictionary = [:]; //We can use this parameter to pass the data to the React native App from the Native App.</pre><pre>//The RCTRootView is a native view used to host React-managed views within the app. Can be used just like any ordinary UIView.<br>   let rootView = RCTRootView(</pre><pre>bundleURL: jsBundleLocation,</pre><pre>moduleName: &quot;Bakesale&quot;,</pre><pre>initialProperties: data as [NSObject : AnyObject],</pre><pre>launchOptions: nil)</pre><pre>let viewController = UIViewController()</pre><pre>viewController.view = rootView</pre><pre>self.present(viewController, animated: true, completion: nil)</pre><pre>}</pre><blockquote><strong>NOTE </strong>— The above<em>RCTRootView bundleURL</em> 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 <em>RCTRootView bundleURL</em>, use <a href="https://github.com/facebook/react-native/blob/master/React/Base/RCTBridge.h#L89"><em>RCTBridge initWithBundleURL</em></a> to create a bridge and then use <em>RCTRootView initWithBridge</em>.</blockquote><p>Connect the above button(“Open Bake Sale App”) with the “BakeSaleButtonTapped” eventHandler.</p><p>After completing the above steps. The iOS native app should look like below in the XCode.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xAGYLzIIeEarDdWm-9yj9w.png" /></figure><p>10. Run the iOS Native App. We have successfully integrated the React Native App in the iOS Native App.</p><h3>Sample Code Repository Details:</h3><p><a href="https://github.com/IbrahimSulai/IntegrationReactNative">IbrahimSulai/IntegrationReactNative</a></p><h3>Further reading</h3><p>We will discuss further in the <strong>Part 2</strong> regarding the “<strong>A step-by-step guide to exchange data between React Native and iOS Native App</strong>”.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=628afcd23f93" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Four Ways to Facilitate Your Open-Source Contribution]]></title>
            <link>https://medium.com/@ibrahim.sulaiman_18323/four-ways-to-facilitate-your-open-source-contribution-486406d0baa0?source=rss-6de565a2a130------2</link>
            <guid isPermaLink="false">https://medium.com/p/486406d0baa0</guid>
            <category><![CDATA[open-source-investigation]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[open-source-contribution]]></category>
            <category><![CDATA[incident-management]]></category>
            <category><![CDATA[practice-management]]></category>
            <dc:creator><![CDATA[Ibrahim Sulaiman]]></dc:creator>
            <pubDate>Fri, 22 Apr 2022 10:04:58 GMT</pubDate>
            <atom:updated>2022-04-22T10:04:58.066Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZM0HFSBA6e5XR2yWwsFadQ.jpeg" /></figure><h3>“Open source has become a keystone for enterprises across the globe.”</h3><p>According to TechRepublic, “open source has become a keystone for enterprises across the globe.” With IBM acquiring open-source companies like Red Hat, it shows the value of developers who write the software code. In fact, they are called <a href="https://dzone.com/articles/developers-are-the-new-kingmakers">King Makers</a>.</p><p>Developers contribute to the open-source community like GitHub for a variety of reasons — ranging from improving the usability of the code, standardizing for interoperability to build their career, and giving back to the community. Because of the collaborative nature of the community, innovation happens here, which seems to be another attractive factor for developers.</p><p>There are numerous resources to get started with an open-source contribution. ‘Contributing to open source for the first time can be scary and a little overwhelming,’ says Scott Hanselman. Yet, there are passionate people like Kent Dodds out there trying to help out the developer community. One of our teams at Imaginea, based on their learning and inspired by Kent and Scott, came up with a list of factors that every developer needs to be aware of while contributing to an open-source project — which can be applied to any open source-contributions in the future.</p><h3>Understand the Problem Statement</h3><p>Often, leaders in the community are wary of the newbie developers, because it requires a lot of hand-holding as they fumble around trying to figure out how to communicate and contribute to an open-source project. To overcome this, first, the developers need to understand the problem statement mentioned in the push request. A quick feasibility study can help understand if it is a bug fix, enhancement, or a new feature and tag them appropriately. For example, if there is an enhancement request, developers can create a new issue on GitHub and tag it as an enhancement. This can make communication clearer.</p><h3>Follow Coding Guidelines</h3><p>Developers learn to code in different ways, which gives rise to different styles of writing codes. This leads to programming conflicts, which can make a team inefficient. Having coding guidelines/standards would help solve this type of problem. In the open-source projects, look for any recommended structure posted by the owner and align with that. This will help in writing consistent code, which can be easily understood by anyone in the team. It also helps new team members to see how the code is structured. All these pave the way to clean coding, with fewer bugs — meaning lesser time spent in maintenance.</p><h3>Think and Plan the Testing</h3><p>The test plan should tell why the new code should be added to the project. It is a place that defines what to expect, after adding it to the repository. It doubles up as a proof of sorts that tries to show that the program works after adding the new piece without any hiccups. With respect to testing, look for already existing test suites available in the repo and add tests specific to new changes. Here are a test plan and the test repo with live examples.</p><h3>Prepare the PR</h3><p>A Pull Request (PR) is the way to notify the project maintainers/owners about the changes a developer is attempting to make with their new code — like a bug fix or a new functionality — and it should be reviewed and added to the project. Here is the documentation that describes the steps to create a PR. Before submitting the PR, check the code thoroughly and make sure that it works well and doesn’t hamper the existing functionalities. If necessary, update the Readme file. Here is the PR created by our team for your reference.</p><p>Any PR with a lot of code changes causes a big overhead during the code review. Cisco Systems programming team case study revealed that a review of 200–400 LOC (Line of Code) over 60 to 90 minutes should yield 70–90 percent defect discovery. Therefore, as a best practice, do not club multiple functionalities in a single PR. For example, if the code is doing more than one functionality, break it into multiple PRs.</p><p>Things like the title and description of the issue must be precise and short. Make a self-explanatory title that gives an overview of what the pull request does. The description should have briefly explained the topics covered with the problem statement, proposed solution, current behavior, expected behavior, and steps to test. These things will make the reviewer’s job easier.</p><p>It is a good practice to mention the open existing issues related to the problem statement which is solved, against the submitted PR. This will give the reviewer a clear picture of the solutions present in the PR and the priority for the bug fix or feature implemented. Tag the reviewer of the open-source repo in the PR which gives more visibility to the reviewer as well as to the contributors who created similar issues for the same problem. Actively interact with the reviewer. Try to respond to any comments and changes requested by the owner or community as soon as possible.</p><p>These factors are a culmination of lessons learned through our team’s first open-source project. Nowadays, we follow these invaluable practices conscientiously, which improves the quality and execution of all our open-source contributions and even for our client engagements.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=486406d0baa0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Integrating a React Native App (RN Version 0.65.1) with an Existing iOS Native App]]></title>
            <link>https://medium.com/@ibrahim.sulaiman_18323/integrating-a-react-native-app-rn-version-0-65-1-with-an-existing-ios-native-app-7ad6fb6ec0de?source=rss-6de565a2a130------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ad6fb6ec0de</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[mobile-apps]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <dc:creator><![CDATA[Ibrahim Sulaiman]]></dc:creator>
            <pubDate>Thu, 24 Feb 2022 18:09:07 GMT</pubDate>
            <atom:updated>2022-02-24T18:09:07.570Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AY97VEg4l82-MD1AboU0ZA.jpeg" /><figcaption>Integrating a React Native App (RN Version 0.65.1) with an Existing iOS Native App</figcaption></figure><h3>A Step-by-Step Guide to Integrate a React Native App (RN version 0.65.1) with an iOS Native App.</h3><p>In this tutorial, we’ll learn how to integrate a React Native App with an existing iOS Native app, demonstrating with one example.</p><p>Even though the official documentation is available on this topic, it is not clear and precise for newbies 😃</p><p>There are a few situations that occur where a developer wants to bring the components to build using React Native to his/her native projects. This blog deals with the end-to-end detailed steps to achieve the same.</p><h3>#Prerequisites</h3><p>Please make sure the below prerequisites are done for integrating the React Native App into an iOS Native app.</p><ul><li>Create a React Native App, which needs to be integrated with a Native iOS App. Please refer to the <a href="http://facebook.github.io/react-native/docs/getting-started">Getting Started</a> guide for creating the React Native App.</li><li>Create an iOS Native App, in which the react-native App needs to be plugged in. Please refer to the <a href="https://developer.apple.com/library/content/referencelibrary/GettingStarted/DevelopiOSAppsSwift/">Getting Started</a> guide for creating the iOS App.</li><li>Install CocoaPods. <a href="https://cocoapods.org/">CocoaPods</a> is a package management tool for iOS development.</li><li>Make sure <a href="https://www.npmjs.com/">npm</a> / <a href="https://classic.yarnpkg.com/en/">yarn</a> is installed in your machine. The npm / yarn is the package manager for JavaScript. It is used for fast and reliable dependency management.</li></ul><h3>#Steps for Integrating the React Native App (RN version 0.65.1) to our iOS Native app</h3><p>1. Create the “iOS App” folder and place the iOS Native App inside the same.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/0*5ORYEi2i8u5iH__2.png" /></figure><p>2. Create the “React Native App” folder and place the React Native App inside it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/0*jpWeAe3kEdC7RpI9.png" /></figure><p>3. Open the terminal and navigate to the React native project path. Execute the below command, which will create the “node_modules” folder.</p><p>npm install or yarn install</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*qD4AxnE2tmZCxX--.gif" /></figure><p>4. Add the below script in the “package.json” file in the React Native project.</p><pre>&quot;scripts&quot;: {<br>&quot;build:ios&quot;: &quot;node node_modules/react-native/local-cli/cli.js bundle --entry-file=&#39;index.js&#39; --bundle-output=&#39;./main.jsbundle&#39; --dev=false --platform=&#39;ios&#39; --assets-dest=&#39;./ios&#39;&quot;<br>}</pre><p>Using the above command we can create the main.jsbundle file using the local CLI that lies within the react-native npm package.</p><p>The short description for the above command,</p><ul><li>entry-file=’&lt;path to our index.js file&gt;’</li><li>bundle-output=’&lt;path to where the main.jsbundle will be created&gt;’</li><li>dev=false (a bunch of perf optimizations is made when false)</li><li>platform=’ios’</li></ul><p>5. To create “main.jsbundle”, open the terminal and navigate to the React Native project path and execute the command given below:</p><p>npm run build:ios or yarn run build:ios</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*UsdQI2q_LYgIg-VY.gif" /></figure><p>The “build:ios” command creates the main.jsbundle file.</p><p>6. Check for main.jsbundle in the root folder of the React Native project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/0*qFvlSw5lFhbEdDtO.png" /></figure><p>7. Open a new terminal window and navigate to the iOS native project path and initiate pod file in the project using the command given below:</p><p>pod init</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/0*dVsX75ic1Dykvh8c.png" /></figure><p>On successful execution of “pod init” you can see the pod file in the iOS Native project folder path as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/703/0*7Qgjud6Ii4_FhNkE.png" /></figure><p>8. Open the pod file and include the pods given below:</p><pre># Uncomment the next line to define a global platform for your project<br>platform :ios, &#39;11.0&#39;</pre><pre>target &#39;Native_iOS_App&#39; do<br>  # Comment the next line if you&#39;re not using Swift and don&#39;t want to use dynamic frameworks<br>  use_frameworks!<br>pod &#39;React&#39;, :podspec =&gt; &#39;../../React Native App/Bakesale/node_modules/react-native/React.podspec&#39;<br>pod &#39;React-Core&#39;, :podspec =&gt; &#39;../../React Native App/Bakesale/node_modules/react-native/React-Core.podspec&#39;<br>pod &#39;React-CoreModules&#39;, :path =&gt; &#39;../../React Native App/Bakesale/node_modules/react-native/React/CoreModules&#39;<br>pod &#39;React-RCTActionSheet&#39;, :path =&gt; &#39;../../React Native App/Bakesale/node_modules/react-native/Libraries/ActionSheetIOS&#39;</pre><pre>pod &#39;ReactCommon&#39;, :path =&gt; &#39;../../React Native App/Bakesale/node_modules/react-native/ReactCommon&#39;<br>pod &#39;React-RCTAnimation&#39;, :path =&gt; &#39;../../React Native App/Bakesale/node_modules/react-native/Libraries/NativeAnimation&#39;<br>pod &#39;React-RCTBlob&#39;, :path =&gt; &#39;../../React Native App/Bakesale/node_modules/react-native/Libraries/Blob&#39;<br>pod &#39;React-RCTImage&#39;, :path =&gt; &#39;../../React Native App/Bakesale/node_modules/react-native/Libraries/Image&#39;<br>pod &#39;React-RCTLinking&#39;, :path =&gt; &#39;../../React Native App/Bakesale/node_modules/react-native/Libraries/LinkingIOS&#39;<br>pod &#39;React-RCTNetwork&#39;, :path =&gt; &#39;../../React Native App/Bakesale/node_modules/react-native/Libraries/Network&#39;<br>pod &#39;React-RCTSettings&#39;, :path =&gt; &#39;../../React Native App/Bakesale/node_modules/react-native/Libraries/Settings&#39;<br>pod &#39;React-RCTText&#39;, :path =&gt; &#39;../../React Native App/Bakesale/node_modules/react-native/Libraries/Text&#39;<br>pod &#39;React-RCTVibration&#39;, :path =&gt; &#39;../../React Native App/Bakesale/node_modules/react-native/Libraries/Vibration&#39;<br>pod &#39;React-cxxreact&#39;, :path =&gt; &#39;../../React Native App/Bakesale/node_modules/react-native/ReactCommon/cxxreact&#39;<br>pod &#39;React-jsi&#39;, :path =&gt; &#39;../../React Native App/Bakesale/node_modules/react-native/ReactCommon/jsi&#39;<br>pod &#39;React-jsiexecutor&#39;, :path =&gt; &#39;../../React Native App/Bakesale/node_modules/react-native/ReactCommon/jsiexecutor&#39;<br>pod &#39;React-jsinspector&#39;, :path =&gt; &#39;../../React Native App/Bakesale/node_modules/react-native/ReactCommon/jsinspector&#39;<br>pod &#39;React-perflogger&#39;, :path =&gt; &#39;../../React Native App/Bakesale/node_modules/react-native/ReactCommon/reactperflogger&#39;<br>pod &#39;FBReactNativeSpec&#39;, :path =&gt; &#39;../../React Native App/Bakesale/node_modules/react-native/React/FBReactNativeSpec&#39;<br>pod &#39;RCTTypeSafety&#39;, :path =&gt; &#39;../../React Native App/Bakesale/node_modules/react-native/Libraries/TypeSafety&#39;<br>pod &#39;RCTRequired&#39;, :path =&gt; &#39;../../React Native App/Bakesale/node_modules/react-native/Libraries/RCTRequired&#39;<br>pod &#39;FBLazyVector&#39;, :path =&gt; &#39;../../React Native App/Bakesale/node_modules/react-native/Libraries/FBLazyVector&#39;<br>pod &#39;React-callinvoker&#39;, :path =&gt; &quot;../../React Native App/Bakesale/node_modules/react-native/ReactCommon/callinvoker&quot;<br>pod &#39;React-runtimeexecutor&#39;, :path =&gt; &quot;../../React Native App/Bakesale/node_modules/react-native/ReactCommon/runtimeexecutor&quot;<br></pre><pre># Your &#39;node_modules&#39; directory is probably in the root of your project,<br>      # but if not, adjust the `:path` accordingly</pre><pre>  # Explicitly include Yoga if you are using RN &gt;= 0.42.0<br>  pod &#39;Yoga&#39;, :path =&gt; &#39;../../React Native App/Bakesale/node_modules/react-native/ReactCommon/yoga/Yoga.podspec&#39;</pre><pre>  # Third party deps podspec link<br>  pod &#39;DoubleConversion&#39;, :podspec =&gt; &#39;../../React Native App/Bakesale/node_modules/react-native/third-party-podspecs/DoubleConversion.podspec&#39;<br>  pod &#39;glog&#39;, :podspec =&gt; &#39;../../React Native App/Bakesale/node_modules/react-native/third-party-podspecs/glog.podspec&#39;<br>  pod &#39;RCT-Folly&#39;, :podspec =&gt; &#39;../../React Native App/Bakesale/node_modules/react-native/third-party-podspecs/RCT-Folly.podspec&#39;</pre><pre>  # Pods for Native_iOS_App</pre><pre>  target &#39;Native_iOS_AppTests&#39; do<br>    inherit! :search_paths<br>    # Pods for testing<br>  end</pre><pre>  target &#39;Native_iOS_AppUITests&#39; do<br>    inherit! :search_paths<br>    # Pods for testing<br>  end</pre><pre>end</pre><p>9. Execute the command given below to install the pods:</p><p>pod install</p><p>After successfully executing the “pod install” command you can see the success message given below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*M0vg_RLj1FjIlxi1.gif" /></figure><p>10. Now, open the iOS Native project workspace in the XCode IDE, as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/0*r4v_1H6phP68dOwN.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_Bacyyq5wmO3plmd.png" /></figure><p>11. Drag and drop the “main.jsbundle” in the XCode project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OcaagegE0w6IrBVP.png" /></figure><p><strong>NOTE</strong> — For react assets to work without any glitches, select the option “Create folder references” while adding the “main.jsbundle”.</p><p>Now, the “main.jsbundle” file will be added to the iOS native app as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZC2zj4FCNkRuqyDE.png" /></figure><p>12. Create the Event Handler in the ViewController, where the React Native module needs to be invoked.</p><p>In this tutorial, we have integrated the “Bakesale”(React Native App) in the iOS Native App, by event handler ‘button click’. With the click of this button, the React Native app can be launched from the iOS app. The button click holds the RCTRootView which is available in the React library. Therefore, you need to import the React library into the ViewController.</p><p>import React</p><p>The initialProperties are for illustration purposes only. In our Bake Sale React Native component, let us use this.props it to get access to that initialProperties.</p><pre>@IBAction func ReactNativeAppButtonTapped(sender : UIButton) {<br>        //let jsCodeLocation = URL(string: &quot;http://localhost:8081/index.bundle?platform=ios&quot;)<br>        let jsBundleLocation = Bundle.main.url(/service/forresource: &quot;main&quot;, withExtension: &quot;jsbundle&quot;)<br>        let data:NSDictionary = [:]; //We can use this parameter to pass the data to the React native App from the Native App.<br>        <br>        let rootView = RCTRootView(<br>            bundleURL: jsBundleLocation!,<br>            moduleName: &quot;Bakesale&quot;,<br>            initialProperties: data as [NSObject : AnyObject],<br>            launchOptions: nil<br>        )<br>        let viewController = UIViewController()<br>        viewController.view = rootView<br>        viewController.modalPresentationStyle = .fullScreen<br>        self.present(viewController, animated: true, completion: nil)<br>    }</pre><p><strong><em>NOTE</em></strong> — The aboveRCTRootView bundle URL 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 RCTRootView bundle URL, use RCTBridge initWithBundleURL to create a bridge and then use RCTRootView initWithBridge.</p><p>After completing the above steps. The iOS native app should look like this in the XCode.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fmk7TkUR16zXCnYR.png" /></figure><p>13. Build and Run the iOS Native App. Now React Native Bake sale app can be accessed with the click of a button.</p><h3>#Sample Code Repository Detail:</h3><p><a href="https://github.com/IbrahimSulai/Integration_ReactNative_iOS_Upgrade/tree/master">https://github.com/IbrahimSulai/Integration_ReactNative_iOS_Upgrade/tree/master</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ad6fb6ec0de" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Integrating React Native App in an Existing iOS Native App — Part 1]]></title>
            <link>https://medium.com/programmable-business/integrating-react-native-app-in-an-existing-ios-native-app-part-1-ac4751ca999b?source=rss-6de565a2a130------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac4751ca999b</guid>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[how-to]]></category>
            <dc:creator><![CDATA[Ibrahim Sulaiman]]></dc:creator>
            <pubDate>Wed, 17 Apr 2019 09:34:28 GMT</pubDate>
            <atom:updated>2019-04-17T09:34:28.254Z</atom:updated>
            <content:encoded><![CDATA[<h3>Integrating React Native features in an existing iOS native app</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ogJOyU2XpbcTVFHUyLzw2A.png" /></figure><p>In one of our recent projects, we integrated React Native feature in an iOS native app. Official documentation is readily available on this <a href="http://facebook.github.io/react-native/docs/integration-with-existing-apps">topic</a>, but still, a couple of newbies in our team had a tough time understanding it. So, we decided to come up with this tutorial, with an example, which is easy to follow.</p><p>In this step-by-step guide, we are going to integrate the React Native Bakesale app with iOS Native app through the button action highlighted below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/226/1*Wo_jXWBiEuiTFMkVBOls4w.png" /></figure><h3>Prerequisites</h3><ol><li><a href="http://facebook.github.io/react-native/docs/getting-started">Create React Native App</a>, which needs to be integrated with Native iOS App.</li><li><a href="https://developer.apple.com/library/archive/referencelibrary/GettingStarted/DevelopiOSAppsSwift/">Create iOS Native App</a>, in which the React Native app needs to be plugged in.</li><li>Install <a href="http://cocoapods.org/">CocoaPods</a>, which is a package management tool, that manages dependencies for iOS development.</li><li>Make sure <a href="https://www.npmjs.com/">npm</a>/<a href="https://yarnpkg.com/en/">yarn</a> is installed in your machine. The npm/yarn is the package manager for JavaScript. It is used for fast and reliable dependency management.</li></ol><h3>Steps for integrating the React Native app to iOS native app</h3><ol><li>Create “<strong>iOS App</strong>” folder in your desktop and place the iOS Native App inside the same.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*JMj9jUqQtOhU9ewmgfrI6Q.png" /></figure><p>2. Create “<strong>React Native App</strong>” folder in your desktop and place the React Native App inside the same.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/1*BQ5axqI1bsyL87oS__TKnQ.png" /></figure><p>3. Open the terminal and navigate to the React Native project path and execute the command given below to install all the dependencies.</p><blockquote><strong>npm install</strong></blockquote><p><em>or</em></p><blockquote><strong>yarn install</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*vDHEUmNv1wUPzvgxm3A-Rw.gif" /></figure><p>4. Add the script given below to the “<strong>package.json</strong>” file in the React Native project.</p><pre>&quot;scripts&quot;: {</pre><pre>&quot;build:ios&quot;: &quot;node node_modules/react-native/local-cli/cli.js bundle --entry-file=&#39;index.js&#39; --bundle-output=&#39;./main.jsbundle&#39; --dev=false --platform=&#39;ios&#39; --assets-dest=&#39;./ios&#39;&quot;</pre><pre>}</pre><blockquote>Here is a short description of the commands in build:ios:</blockquote><blockquote><em>— entry-file=’</em>&lt;path to index.js file&gt;<em>’</em></blockquote><blockquote><em>— bundle-output=</em>’&lt;define the path for creating main.bundlejs &gt;’</blockquote><blockquote><em>— dev</em>=false (Fewer optimizations are made when false)</blockquote><blockquote><em>— platform</em>=’ios’</blockquote><p>5. To create “<strong>main.jsbundle</strong>”, open the terminal and navigate to React Native project path and execute the command given below:</p><blockquote><strong>npm run build:ios</strong></blockquote><p><em>or</em></p><blockquote><strong>yarn run build:ios</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*FAnr-MlWf2I2e_AlO3M3iw.gif" /></figure><p>The “build:ios” command creates <strong>main. jsbundle</strong> file.</p><p>6. Check for <strong>main.jsbundle</strong> in the root folder of the React Native project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/1*3lN9QVd8ag2bwlz4kjts3g.png" /></figure><p>7. Open a new terminal window and navigate to iOS native project path and initiate pod file in the project using the command given below:</p><blockquote><strong>pod init</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/1*B5xzXSJYuvxFOcmmBQWHgQ.png" /></figure><p>On successful execution of “pod init” you can to see the pod file in the iOS Native project folder path as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/703/1*27e_8FL3YtJXjwkVPsFH-g.png" /></figure><p>8. Open the pod file and include the pods given below:</p><pre># Your &#39;node_modules&#39; directory is probably in the root of your project,</pre><pre># but if not, adjust the `:path` accordingly</pre><pre>pod &#39;React&#39;, :path =&gt; &#39;../../React Native App/Bakesale/node_modules/react-native&#39;, :subspecs =&gt; [</pre><pre>&#39;Core&#39;,</pre><pre>&#39;CxxBridge&#39;, # Include this for RN &gt;= 0.47</pre><pre>&#39;DevSupport&#39;, # Include this to enable In-App Devmenu</pre><pre>&#39;RCTText&#39;,</pre><pre>&#39;RCTNetwork&#39;,</pre><pre>&#39;RCTImage&#39;,</pre><pre>&#39;RCTWebSocket&#39;, # Needed for debugging</pre><pre># Add any other subspecs you want to use in your project</pre><pre>]</pre><pre># Explicitly include Yoga if you are using RN &gt;= 0.42.0</pre><pre>pod &#39;yoga&#39;, :path =&gt; &#39;../../React Native App/Bakesale/node_modules/react-native/ReactCommon/yoga&#39;</pre><pre># Third party deps podspec link</pre><pre>pod &#39;DoubleConversion&#39;, :podspec =&gt; &#39;../../React Native App/Bakesale/node_modules/react-native/third-party-podspecs/DoubleConversion.podspec&#39;</pre><pre>pod &#39;glog&#39;, :podspec =&gt; &#39;../../React Native App/Bakesale/node_modules/react-native/third-party-podspecs/glog.podspec&#39;</pre><pre>pod &#39;Folly&#39;, :podspec =&gt; &#39;../../React Native App/Bakesale/node_modules/react-native/third-party-podspecs/Folly.podspec&#39;</pre><p>9. Execute the command given below to install the pods:</p><blockquote><strong>pod install</strong></blockquote><p>After successfully executing the “pod install” command you can see success message given below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*d_tOrVg68nNzu1-kQnXsVg.gif" /></figure><p>10. Now, open iOS Native project workspace in the XCode IDE, as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*csZFUGRSq6kLa-J2K3UzUQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xTlk_qoE8fI8r72hAWr7vQ.png" /></figure><p>11. Drag and drop the “<strong>main.jsbundle</strong>” in the XCode project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8Qrkxo-_hM9XqS6KjFkpLQ.png" /></figure><blockquote><strong><em>NOTE </em></strong><em>— For react assets to work without any glitches, select the option “Create folder references” while adding the “main.jsbundle”.</em></blockquote><p>Now, the “main.jsbundle” file will be added to the iOS native app as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zaPM5PHCKGDldLxGNqXXtw.png" /></figure><p>12. Create the Event Handler in the ViewController, where the React Native module needs to be invoked.</p><p>In this tutorial, we have integrated the “<strong>Bakesale</strong>”(React Native App) in the iOS Native App, by event handler ‘button click’. By the click of this button, the React Native app can be launched from the iOS app. The button click holds the RCTRootView which is available in the React library. Therefore, you need toimport the React library in the ViewController.</p><pre>import React</pre><p>The initialProperties are for illustration purposes only. In our Bake Sale React Native component, let us use this.props to get access to that initialProperties.</p><pre>@IBAction func BakeSaleButtonTapped(sender : UIButton) {</pre><pre>//Code to get the url of the main.jsbundle in the project.<br>   let jsBundleLocation = Bundle.main.url(/service/forresource: &quot;main&quot;, withExtension: &quot;jsbundle&quot;)</pre><pre>//The data is used as initialProperties to React Native App.<br>   let data:NSDictionary = [:]; //We can use this parameter to pass the data to the React native App from the Native App.</pre><pre>//The RCTRootView is a native view used to host React-managed views within the app. Can be used just like any ordinary UIView.<br>   let rootView = RCTRootView(</pre><pre>bundleURL: jsBundleLocation,</pre><pre>moduleName: &quot;Bakesale&quot;,</pre><pre>initialProperties: data as [NSObject : AnyObject],</pre><pre>launchOptions: nil)</pre><pre>let viewController = UIViewController()</pre><pre>viewController.view = rootView</pre><pre>self.present(viewController, animated: true, completion: nil)</pre><pre>}</pre><blockquote><strong>NOTE </strong>— The above<em>RCTRootView bundleURL</em> 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 <em>RCTRootView bundleURL</em>, use <a href="https://github.com/facebook/react-native/blob/master/React/Base/RCTBridge.h#L89"><em>RCTBridge initWithBundleURL</em></a> to create a bridge and then use <em>RCTRootView initWithBridge</em>.</blockquote><p>After completing the above steps. The iOS native app should look like below in the XCode.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xAGYLzIIeEarDdWm-9yj9w.png" /></figure><p>13. Build and Run the iOS Native App. Now React Native Bake sale app can be accessed with the click of a button.</p><h3>Sample Code Repository Detail:</h3><p><a href="https://github.com/IbrahimSulai/IntegrationReactNative">IbrahimSulai/IntegrationReactNative</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac4751ca999b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/programmable-business/integrating-react-native-app-in-an-existing-ios-native-app-part-1-ac4751ca999b">Integrating React Native App in an Existing iOS Native App — Part 1</a> was originally published in <a href="https://medium.com/programmable-business">Programmable Business</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>