<?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 Dev Geek on Medium]]></title>
        <description><![CDATA[Stories by Dev Geek on Medium]]></description>
        <link>https://medium.com/@aureosouza0801?source=rss-ed8609daa13c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*h2t98FPYYIEucYI3</url>
            <title>Stories by Dev Geek on Medium</title>
            <link>https://medium.com/@aureosouza0801?source=rss-ed8609daa13c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 21:05:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aureosouza0801/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[Is React Native (Finally) Dead?]]></title>
            <link>https://medium.com/@aureosouza0801/is-react-native-finally-dead-1d878950c642?source=rss-ed8609daa13c------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d878950c642</guid>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Dev Geek]]></dc:creator>
            <pubDate>Wed, 07 Oct 2026 15:46:33 GMT</pubDate>
            <atom:updated>2026-10-12T14:14:30.777Z</atom:updated>
            <content:encoded><![CDATA[<p>For years, cross platform mobile development was hailed as the ultimate holy grail for startups and tech enterprises alike. The pitch was simple, elegant, and financially irresistible: why hire two separate engineering teams to maintain two completely disjointed codebases when you could build both iOS and Android apps using a single team of React developers?</p><p>For a long time, React Native seemed like the unquestioned winner of this promise filled approach. But as mobile ecosystems grew more complex and AI completely reshaped how software is written, a crucial question is surfacing across tech teams worldwide: <strong>Is React Native (finally) dead?</strong></p><h3>The Dream: One Codebase to Rule Them All</h3><p>To understand why React Native dominated for as long as it did, you have to remember the pain points of mobile development in the mid 2010s.</p><p>Building native mobile applications meant maintaining two entirely different engineering streams:</p><ul><li><strong>iOS:</strong> Swift or Objective C developers navigating Xcode.</li><li><strong>Android:</strong> Kotlin or Java developers wrestling with Gradle and Android Studio.</li></ul><p>For companies, especially early to mid stage startups, maintaining two separate codebases wasn’t just a technical challenge; <strong>it was exponentially more expensive.</strong> You needed double the developers, double the code reviews, synchronized feature releases that almost never shipped at the same time, and duplicate product management overhead.</p><p>React Native arrived with a compelling solution: write your app in JavaScript or TypeScript using a component model already loved by millions of web developers, compile down to native views, and ship to both app stores simultaneously. The cost savings were undeniable, and for standard, UI heavy apps, it felt like magic.</p><h3>The Reality: The Cross Platform Wall</h3><p>However, as applications grew beyond simple forms and API driven lists, the cross platform abstraction began to crack under the weight of real world mobile development.</p><h3>1. The Endless Dependency Hell</h3><p>The native bridge created a heavy reliance on third party libraries for virtually any platform specific capability, like:</p><ul><li><strong>Geolocation and Background Tracking</strong></li><li><strong>Biometric Authentication (Face ID or Fingerprint)</strong></li><li><strong>Push Notifications and In App Messaging</strong></li><li><strong>Camera APIs and Hardware Access</strong></li></ul><p>Every time Apple or Google released a major OS update or changed security permissions, these third party dependencies would break. Developers spent countless hours waiting for open source maintainers to patch libraries, or worse, trying to fork and maintain them themselves.</p><p>Often, the underlying issue wasn’t even a complex architectural flaw. It was as simple as needing a missing permission flag or a single line of configuration in AndroidManifest.xml or Info.plist, yet bridging that gap from JavaScript required navigating layers of native wrappers and abstraction glue.</p><h3>2. The Performance Bottleneck</h3><p>The core architectural issue of React Native has always been its execution model and the JavaScript thread:</p><ul><li><strong>The Single Threaded UI Bottleneck:</strong> React Native logic runs on a dedicated JavaScript thread. When complex calculations, JSON parsing, or heavy state updates occur, the JavaScript thread chokes. This leads to dropped frames, uncoordinated animations, and frozen touch interactions.</li><li><strong>Multiple Unnecessary Renders:</strong> Because React’s lifecycle and state management were originally built for the web DOM, unexpected re renders on mobile carry a heavy tax. Cascading re renders translate directly into visual lag, unresponsive buttons, and high CPU usage.</li><li><strong>The Dreaded Bridge:</strong> Passing data back and forth between the JavaScript engine and the native UI layer over a serialized bridge creates inherent latency, especially for gesture heavy interactions, smooth scrolling lists, and real time canvas drawing.</li></ul><p>Many teams eventually hit a wall where optimizing React Native required writing custom native modules for almost every core feature, at which point the cost benefit completely vanished.</p><h3>The Paradigm Shift: Modern AI Workspaces &amp; Agentic Tools</h3><p>What kept React Native alive despite its limitations was the high cost of native development. But the rapid rise of AI assisted engineering environments, such as <strong>Cursor Workspaces</strong>, <strong>GitHub Copilot Workspace</strong>, <strong>Windsurf (Cascade)</strong>, <strong>Claude Code CLI</strong>, and <strong>Devin</strong>, has completely flipped that equation on its head.</p><p>Today, you can feed an AI workspace or agentic tool the complete context of your application architecture:</p><pre>/backend          (Node.js / Go / Python)<br>/web-app          (React / Next.js)<br>/android-app      (Kotlin / Jetpack Compose)<br>/ios-app          (Swift / SwiftUI)</pre><p>With the proper workspace context across all your repositories, <strong>a single prompt can implement a feature across the entire stack at once.</strong></p><p>Need to add a new user setting? The AI updates the backend API schema, generates the endpoint, updates the web app UI, writes the native Swift UI code for iOS, and writes the native Kotlin Jetpack Compose code for Android, all in a single generation pass.</p><p>The historical barrier, <em>the cognitive overhead and time required to write idiomatic Swift and Kotlin simultaneously</em>, has effectively dissolved. Going from a web application to fully native mobile apps now takes days rather than months.</p><h3>But How About New Architecture?</h3><p>Proponents of React Native often point to the long awaited New Architecture, featuring TurboModules and the Fabric renderer, as the definitive answer to the framework’s historical flaws.</p><h3>Key Advantages</h3><ul><li><strong>Direct JSI Execution:</strong> Replaces the asynchronous JSON bridge with JavaScript Interface (JSI), allowing direct C++ function calls between JavaScript and native code.</li><li><strong>Reduced Serialization Latency:</strong> Eliminates JSON stringification overhead, noticeably improving performance for UI measurements and synchronous animations.</li><li><strong>Concurrent Rendering:</strong> Leverages React 18 capabilities to prioritize user interactions over background UI updates.</li></ul><h3>Persistent Limitations</h3><ul><li><strong>Unresolved State Overhead:</strong> Does not eliminate state synchronization costs or prevent cascading UI re renders across deep component trees.</li><li><strong>Still Single Threaded:</strong> JavaScript business logic still executes on a single main JS thread, failing to deliver true out of the box multithreading.</li><li><strong>Migration Breaking Changes:</strong> Upgrading existing codebases to Fabric and TurboModules breaks legacy native modules and components, requiring C++ Codegen rewrites or reliance on temporary interop layers.</li><li><strong>Ecosystem and Dependency Fragility:</strong> Because third-party libraries update at drastically different paces, migrating forces teams to fork unmaintained repositories, rewrite custom bindings, or hunt down supported community alternatives.</li></ul><p>At its core, JSI is simply a faster pipe between two runtime environments, not a replacement for pure, multithreaded native execution.</p><h3>No Surprises, Pure Performance</h3><ul><li><strong>Zero Dependency Hell:</strong> No waiting for third party wrappers to support new OS features.</li><li><strong>No Breaking Upgrade Cycles:</strong> Upgrading React Native or Expo major versions often felt like defusing a bomb. Native upgrades in Swift or Kotlin follow stable, predictable compiler guidance.</li><li><strong>Full Multithreaded Execution:</strong> Native apps fully leverage modern concurrency primitives:</li><li><strong>Kotlin Coroutines and Flow</strong> on Android for background processing, structured concurrency, and effortless UI thread offloading.</li><li><strong>Swift Concurrency (</strong><strong>async/</strong><strong>await, Actors, and Task groups)</strong> on iOS for smooth, thread safe UI rendering.</li></ul><p>No dropped frames. No bridge serialization delays. Just 60/120 FPS performance out of the box.</p><h3>So It’s That Easy? Not Quite…</h3><p>It sounds like a developer utopia: prompt an agent, accept the diff, ship to production. But any seasoned engineer knows that software development is never that simple.</p><p>Speed without discipline quickly creates an unmaintainable mess. Unchecked AI code generation introduces subtle vulnerabilities, architectural drift, severe cognitive debt, and flat out hallucinations. An LLM might generate a Swift function that compiles cleanly or a Kotlin coroutine block that passes unit tests, yet subtle runtime bugs, memory leaks, unhandled edge cases, or non existent library imports (package hallucinations) can easily slip through.</p><ul><li><strong>Strict Code Reviews and Diff Verification:</strong> Auditing every line of generated code across Kotlin, Swift, and backend services to catch logical flaws, security risks, and hallucinated APIs before merging.</li><li><strong>System Architecture and Domain Modeling:</strong> Enforcing clean separation of concerns, modular design, and consistent design patterns across all targets so the codebase remains maintainable long term.</li><li><strong>Controlled Git and Release Workflows:</strong> Breaking down feature requests into small, predictable, atomic changes. Leveraging proper branching, pull request reviews, automated CI/CD pipelines, and semantic versioning rather than piling multiple unverified AI changes into a single release.</li><li><strong>Cross Platform Verification:</strong> Rigorously testing each native application on real hardware, verifying UI layouts across various device aspect ratios, evaluating lifecycle behavior, and auditing thread safety.</li></ul><p>AI accelerates syntax generation, but human software engineers remain responsible for system design, correctness, and release integrity.</p><h3>Conclusion: Mobile Development as It Was Intended</h3><p>React Native was a brilliant, necessary band aid for an era when native software development was too resource intensive for most teams to maintain across two distinct platforms. It was filled with clever workarounds, bridge hacks, and complex state synchronization techniques meant to bridge two fundamentally different OS paradigms.</p><p>To be fair, if your application is simple enough, such as a city tourist guide, an event directory, a digital employee handbook, or a basic company portal, it might still make perfect sense to build with React Native. However, for complex applications that rely on constant user driven updates, high frequency state changes, and heavy native integrations, the performance overhead and dependency maintenance of React Native quickly become unsustainable at scale.</p><p>Software engineering moves fast. With AI lowering the barrier to writing clean, idiomatic native code in Kotlin and Swift, the economic argument for cross platform frameworks has fundamentally changed.</p><p>Mobile development was never fully solved by React Native, it was merely compromised. Now, engineering teams can return to proper native development the way it was always intended: fast, deterministic, robust, and completely uncompromised.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d878950c642" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Configuring deep-linking emails in React Native (without Universal Links)]]></title>
            <link>https://medium.com/@aureosouza0801/configuring-deep-linking-emails-in-react-native-without-universal-links-30bc7f23d1ec?source=rss-ed8609daa13c------2</link>
            <guid isPermaLink="false">https://medium.com/p/30bc7f23d1ec</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[universal-links]]></category>
            <category><![CDATA[deeplink]]></category>
            <category><![CDATA[email]]></category>
            <dc:creator><![CDATA[Dev Geek]]></dc:creator>
            <pubDate>Thu, 08 Jun 2023 07:11:01 GMT</pubDate>
            <atom:updated>2023-06-08T07:48:43.865Z</atom:updated>
            <content:encoded><![CDATA[<p>This post is to help configuring deeplinking using URL Scheme (iOS) and Intent Filter (Android).</p><h3>Some background</h3><p>The most simple configuration for deeplinking in Android and iOS is using URL schemes e.g. myapp://, so the following configs would be enough:</p><p>AndroidManifest.xml:</p><pre>&lt;activity<br>...<br>  &gt;<br>  ...<br>  &lt;intent-filter android:autoVerify=&quot;true&quot;&gt;<br>    &lt;action android:name=&quot;android.intent.action.VIEW&quot; /&gt;<br>    &lt;category android:name=&quot;android.intent.category.DEFAULT&quot; /&gt;<br>    &lt;category android:name=&quot;android.intent.category.BROWSABLE&quot; /&gt;<br>    &lt;data android:scheme=&quot;myapp&quot; /&gt;<br>  &lt;/intent-filter&gt;<br>&lt;/activity&gt;</pre><p>Which can be tested with:</p><pre>adb shell am start -W -a android.intent.action.VIEW -d &quot;myapp://&quot;</pre><p>And for iOS:</p><pre> &lt;key&gt;CFBundleURLTypes&lt;/key&gt;<br> &lt;array&gt;<br>  &lt;dict&gt;<br>   &lt;key&gt;CFBundleTypeRole&lt;/key&gt;<br>   &lt;string&gt;Editor&lt;/string&gt;<br>   &lt;key&gt;CFBundleURLSchemes&lt;/key&gt;<br>   &lt;array&gt;<br>    &lt;string&gt;myapp&lt;/string&gt;<br>   &lt;/array&gt;<br>  &lt;/dict&gt;<br> &lt;/array&gt;</pre><p>And can be tested on simulator with:</p><pre>xcrun simctl openurl booted &quot;myapp://&quot;</pre><p>Great, so can I go ahead and start configuring email deeplinking for user confirmation or password resets?</p><p>Unfortunatly not!</p><p>If you ever had to configure email services, you probably noticed that in general email apps, such as Gmail, block non http schemes such as our myapp:// as seen in <a href="https://stackoverflow.com/questions/23575553/ios-deep-linking-is-stripped-out-in-gmail">this post in StackOverFlow</a> as well. So if we had user confirmation email as the following:</p><pre>exports = async function sendConfirmationEmail(username, token, tokenId) {<br>  const nodemailer = require(&#39;nodemailer&#39;);<br><br>  // Create a Nodemailer transporter with your email configuration<br>  const transporter = nodemailer.createTransport({<br>    service: &#39;Gmail&#39;,<br>    auth: {<br>      type: &#39;OAuth2&#39;,<br>      user: &#39;no-reply@company.com&#39;,<br>      serviceClient: &#39;ADD_HERE_SERVICE_CLIENT&#39;,<br>      privateKey: &#39;ADD_HERE_PRIVATE_KEY&#39;,<br>    }<br>  });<br><br>  // Construct the email content<br>  const mailOptions = {<br>    from: &#39;your-email@gmail.com&#39;,<br>    to: username,<br>    subject: &#39;Confirmation Email&#39;,<br>    html: `&lt;html&gt;<br>    &lt;head&gt;<br>      &lt;title&gt;Email Confirmation&lt;/title&gt;<br>    &lt;/head&gt;<br>    &lt;body style=&quot;font-family: Arial, sans-serif; margin: 0; padding: 0;&quot;&gt;<br>      &lt;table width=&quot;100%&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;background-color: #f2f2f2;&quot;&gt;<br>        &lt;tr&gt;<br>          &lt;td align=&quot;center&quot;&gt;<br>            &lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;max-width: 600px; margin: 0 auto; padding: 20px;&quot;&gt;<br>              &lt;tr&gt;<br>                &lt;td align=&quot;center&quot; bgcolor=&quot;#ffffff&quot; style=&quot;padding: 40px;&quot;&gt;<br>                  &lt;h1 style=&quot;margin: 0;&quot;&gt;Welcome to Our Company&lt;/h1&gt;<br>                  &lt;p style=&quot;margin-top: 20px;&quot;&gt;Thank you for registering with our company. Please confirm your email address by clicking the button below:&lt;/p&gt;<br>                  &lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;margin-top: 30px;&quot;&gt;<br>                    &lt;tr&gt;<br>                      &lt;td align=&quot;center&quot; bgcolor=&quot;#ffffff&quot; style=&quot;padding: 10px;&quot;&gt;<br>                        &lt;a href=&quot;myapp://?token=${token}&amp;tokenId=${tokenId}&quot; style=&quot;background-color: #3498db; color: #ffffff; display: inline-block; font-size: 16px; padding: 10px 20px; text-decoration: none;&quot;&gt;Confirm Email&lt;/a&gt;<br>                      &lt;/td&gt;<br>                    &lt;/tr&gt;<br>                  &lt;/table&gt;<br>                  &lt;p style=&quot;margin-top: 30px;&quot;&gt;If you did not register for an account, please ignore this email.&lt;/p&gt;<br>                &lt;/td&gt;<br>              &lt;/tr&gt;<br>            &lt;/table&gt;<br>          &lt;/td&gt;<br>        &lt;/tr&gt;<br>      &lt;/table&gt;<br>    &lt;/body&gt;<br>    &lt;/html&gt;`<br>  };<br><br>  // Send the email<br>  await transporter.sendMail(mailOptions);<br>};</pre><p>The following would be stripped out in e.g. Gmail app:</p><pre>href=&quot;myapp://?token=${token}&amp;tokenId=${tokenId}&quot;</pre><h3>Universal Links</h3><p>So in most cases the general recomendation for iOS is to use Universal Links that allows for http deeplinking. But then we learn that it’s not that simple to setup Universal Links, with steps involving e.g. create an AASA JSON file and host in your backend with the domain configured, add capability, update the provision profiles with those capabilities... As well as some limitations like e.g. the “evil right corner” described <a href="https://www.adjust.com/blog/universal-links-vs-deep-links/">here</a> and <a href="https://medium.com/mobile-growth/the-things-i-hate-and-you-should-know-about-apple-universal-links-5beb15f88a29">here</a>.</p><p>Soooo there is no other way we can make our simple deeplinking email to work?</p><h3>Solution</h3><p>So luckly we can configure, in less then a minute, using AWS S3 bucket a simple redirect page:</p><ol><li>Create an AWS S3 bucket:</li></ol><ul><li>Go to the AWS Management Console and navigate to the Amazon S3 service and click on “Create bucket” .</li><li>Go to the “Properties” tab and click on “Static website hosting”.</li><li>Choose the option to enable static website hosting and specify an index document (e.g., index.html).</li><li>In the S3 bucket, click on the “Upload” button to upload your index.html:</li></ul><pre>&lt;!DOCTYPE html&gt;<br>&lt;html&gt;<br>  &lt;head&gt;<br>    &lt;title&gt;Redirecting...&lt;/title&gt;<br>    &lt;script&gt;<br>      window.onload = function () {<br>        // Extract the query parameters from the URL<br>        const urlParams = new URLSearchParams(window.location.search);<br>        const token = urlParams.get(&#39;token&#39;);<br>        const tokenId = urlParams.get(&#39;tokenId&#39;);<br><br>        // Construct the deep link URL<br>        const deepLinkUrl = `myapp://confirm-email?token=${token}&amp;tokenId=${tokenId}`;<br><br>        // Redirect to the deep link URL<br>        window.location.href = deepLinkUrl;<br>      };<br>    &lt;/script&gt;<br>  &lt;/head&gt;<br>  &lt;body&gt;<br>    &lt;h1&gt;Redirecting...&lt;/h1&gt;<br>  &lt;/body&gt;<br>&lt;/html&gt;</pre><ul><li>Navigate to the “Permissions” tab and click on “Edit bucket policy”:</li></ul><pre>{<br>  &quot;Version&quot;: &quot;2012-10-17&quot;,<br>  &quot;Statement&quot;: [<br>    {<br>      &quot;Sid&quot;: &quot;AllowPublicRead&quot;,<br>      &quot;Effect&quot;: &quot;Allow&quot;,<br>      &quot;Principal&quot;: &quot;*&quot;,<br>      &quot;Action&quot;: &quot;s3:GetObject&quot;,<br>      &quot;Resource&quot;: &quot;arn:aws:s3:::your-bucket-name/*&quot;<br>    },<br>    {<br>      &quot;Sid&quot;: &quot;AddRedirectionRules&quot;,<br>      &quot;Effect&quot;: &quot;Allow&quot;,<br>      &quot;Principal&quot;: &quot;*&quot;,<br>      &quot;Action&quot;: &quot;s3:GetObject&quot;,<br>      &quot;Resource&quot;: &quot;arn:aws:s3:::your-bucket-name/index.html&quot;,<br>      &quot;Condition&quot;: {<br>        &quot;StringEquals&quot;: {<br>          &quot;aws:Referer&quot;: &quot;http://your-website.com&quot;<br>        }<br>      }<br>    }<br>  ]<br>}</pre><p>(Optional) Set up DNS for your domain:</p><ul><li>Go to your domain registrar or DNS provider (e.g., Google Domains).</li><li>Create a new CNAME record or modify an existing one to point to the S3 bucket’s endpoint URL.</li></ul><h3>Result</h3><p>Great, so now the last step is just take the url from “Bucket website endpoint” in the S3 bucket properties (or already the domain configured w/ https) and add to your email button:</p><pre>href=&quot;https://www.domain.com/confirm-email?token=${token}&amp;tokenId=${tokenId}&quot;</pre><p>So now, on the React Native side, you can use Linking api to intercept the deeplinking params:</p><pre>import { Linking } from &#39;react-native&#39;;<br>import queryString from &#39;query-string&#39;<br>  ...<br><br>  useEffect(() =&gt; {<br>    const handleDeepLink = async (event: LinkingEvent) =&gt; {<br>      const parsedUrl = queryString.parseUrl(event.url);<br>      const { token, tokenId } = parsedUrl.query;<br><br>      const isConfirmEmailUrl = parsedUrl.url.includes(&#39;confirm-email&#39;);<br>      const isResetPassUrl = parsedUrl.url.includes(&#39;reset-password&#39;);<br><br>      if (isConfirmEmailUrl) {<br>        confirmEmail(token, tokenId);<br>      } else if (isResetPassUrl) {<br>        resetPassword(token, tokenId);<br>      }<br>    };<br><br>    Linking.addEventListener?.(&#39;url&#39;, handleDeepLink);<br>  }, []);</pre><p>And on AppDelegate.mm you need this method:</p><pre>- (BOOL)application:(UIApplication *)application<br>   openURL:(NSURL *)url<br>   options:(NSDictionary&lt;UIApplicationOpenURLOptionsKey,id&gt; *)options<br>{<br>  return [RCTLinkingManager application:application openURL:url options:options];<br>}</pre><p><strong>And that’s it!</strong></p><h3>Considerations</h3><p>This post is help developers quickly get a deeplinking w/ params working in both Android and iOS using emails. Although Universal links brings some advantages and might be worth configuring, some of these advantages include:</p><ol><li>User experience: Universal Links seamlessly integrate with the iOS system, not asking for permissions or opening the browser.</li><li>Security: Universal Links are secure as they require domain verification, which prevents malicious apps from intercepting and redirecting links.</li><li>Flexibility: when the linked content is not installed on the device there is a falling back option to a web URL or the AppStore in order for user to install your app.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=30bc7f23d1ec" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Integrate AppCenter and react-native-config]]></title>
            <link>https://medium.com/@aureosouza0801/integrate-appcenter-and-react-native-config-85d44b7a3d2?source=rss-ed8609daa13c------2</link>
            <guid isPermaLink="false">https://medium.com/p/85d44b7a3d2</guid>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[appcenter]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[react-native-config]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <dc:creator><![CDATA[Dev Geek]]></dc:creator>
            <pubDate>Tue, 11 Oct 2022 12:13:48 GMT</pubDate>
            <atom:updated>2023-05-22T15:01:48.318Z</atom:updated>
            <content:encoded><![CDATA[<p>This post is to help integrating AppCenter’s ReactNative SDK using react-native-config for both Android and iOS without populating AppCenter-Config.plist or appcenter-config.json with the AppSecret. Just adding the app secrets together with your other variables in each .env file.</p><h3>Configuring react-native-config</h3><p>1) npm install react-native-config &amp;&amp; npx pod-install<br>2) Create your .env files, ( .env.development, .env.staging &amp; .env.production), each of those with, for example:</p><pre>API_URL=<a href="https://yourapi.development.com/">https://yourapi.development.com</a><br>ANDROID_APP_CENTER_SECRET=YOUR_APP_SECRET_HERE<br>IOS_APP_CENTER_SECRET=YOUR_APP_SECRET_HERE</pre><p>2) For Android in android/app/build.gradle add:</p><pre>project.ext.envConfigFiles = [<br> productiondebug: “.env.production”,<br> productionrelease: “.env.production”,<br> developmentrelease: “.env.development”,<br> developmentdebug: “.env.development”,<br> stagingrelease: “.env.staging”,<br> stagingdebug: “.env.staging”<br>]</pre><pre>apply from: project(‘:react-native-config’).projectDir.getPath() + “/dotenv.gradle”</pre><p>And below the buildTypes:</p><pre>flavorDimensions “default”<br>productFlavors {<br> production {} // Can add other configs like applicationIdSuffix<br> staging {}<br> development {}<br>}</pre><p>And if you use applicationIdSuffix or applicationId that is different from the package name indicated in AndroidManifest.xml add:</p><pre>defaultConfig {<br> …<br> resValue &quot;string&quot;, &quot;build_config_package&quot;, &quot;YOUR_PACKAGE_NAME_IN_ANDROIDMANIFEST_XML&quot;<br>}</pre><p>3) For iOS In Xcode create your schemes, for example YourAppDevelopment, YourAppStaging &amp; YourAppProduction:</p><p>3.1) Product &gt; Scheme &gt; Edit Scheme and Duplicate Scheme on the bottom and name it YourAppAppDevelopment and check the shared checkbox (perform for each flavour you need)</p><p>3.2) Still on EditScheme, for each flavour select on the left: Build -&gt; Pre-actions -&gt; + -&gt; New Run Script Action, select project from the “Provide build settings” from dropdown. And add under “Type a script or drag a script file”</p><pre>cp “${PROJECT_DIR}/../.env.development” “${PROJECT_DIR}/../.env” </pre><h3>Configuring appcenter SDK:</h3><p>1) npm install appcenter appcenter-analytics appcenter-crashes — save-exact &amp;&amp; npx pod-install<br>2) For Android on MainApplication add on onCreate method:</p><pre>import com.microsoft.appcenter.AppCenter;<br>import com.microsoft.appcenter.analytics.Analytics;<br>import com.microsoft.appcenter.crashes.Crashes;</pre><pre>…<br> <a href="http://twitter.com/Override">@Override</a><br> public void onCreate() {<br> …<br> AppCenter.start(this, BuildConfig.ANDROID_APP_CENTER_SECRET, Analytics.class, Crashes.class);<br> …</pre><p>And in android/app/src/main/res/values/strings.xml add:</p><pre>&lt;string name=”appCenterCrashes_whenToSendCrashes” moduleConfig=”true” translatable=”false”&gt;DO_NOT_ASK_JAVASCRIPT&lt;/string&gt;<br>&lt;string name=”appCenterAnalytics_whenToEnableAnalytics” moduleConfig=”true” translatable=”false”&gt;ALWAYS_SEND&lt;/string&gt;</pre><p>3) For iOS in AppDelegate:</p><pre>#import &quot;RNCConfig.h&quot;</pre><pre>#import &lt;AppCenter/MSACAppCenter.h&gt;<br>#import &lt;AppCenterReactNative.h&gt;<br>#import &lt;AppCenterReactNativeAnalytics.h&gt;<br>#import &lt;AppCenterReactNativeCrashes.h&gt;<br>…<br>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions<br>{<br> …<br>NSString *appSecret = [RNCConfig envFor:@&quot;IOS_APP_CENTER_SECRET&quot;];[MSACAppCenter configureWithAppSecret:appSecret]; // Not necessary to call register<br> [AppCenterReactNativeAnalytics registerWithInitiallyEnabled:true];<br> [AppCenterReactNativeCrashes registerWithAutomaticProcessing];<br> …</pre><p><strong>And that’s it!</strong></p><p>Some advantages of this approach:</p><p>1) You don’t need to populate multiple AppCenter-Config.plist or appcenter-config.json and add each file to project with different app secret.<br>2) You don’t rely on AppCenter pre-build to be able to set different flavours, so you can generate the builds outside of AppCenter for each build flavour and have fully functional integration.<br>3) In this way we follow a clean <a href="https://en.wikipedia.org/wiki/Single_source_of_truth">single source of truth</a> approach in which all the specific config for each flavour are only in the .env files, available for both native or js and not hidden anywhere else.</p><p>One note:</p><p>You may configure a pre-build in AppCenter to populate the .env files with the AppSecret, avoiding commiting the app secrets for security reasons. But this approach should still be more straightforward then populating the whole AppCenter-Config.plist and appcenter-config.json for each build.</p><p>Sources:</p><p><a href="https://www.bigbinary.com/blog/handling-environment-specific-configurations-in-react-native">https://www.bigbinary.com/blog/handling-environment-specific-configurations-in-react-native</a><br><a href="https://learn.microsoft.com/en-us/appcenter/sdk/getting-started/android">https://learn.microsoft.com/en-us/appcenter/sdk/getting-started/android</a><br><a href="https://learn.microsoft.com/en-us/appcenter/sdk/getting-started/ios">https://learn.microsoft.com/en-us/appcenter/sdk/getting-started/ios</a><br><a href="https://learn.microsoft.com/en-us/appcenter/sdk/getting-started/react-native">https://learn.microsoft.com/en-us/appcenter/sdk/getting-started/react-native</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=85d44b7a3d2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>