<?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 Nandhini on Medium]]></title>
        <description><![CDATA[Stories by Nandhini on Medium]]></description>
        <link>https://medium.com/@nandhinid1591?source=rss-7ed6b8dff735------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*A0OC8uSvI-K64idx</url>
            <title>Stories by Nandhini on Medium</title>
            <link>https://medium.com/@nandhinid1591?source=rss-7ed6b8dff735------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 13:16:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nandhinid1591/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[Firebase Dev & Prod Project Setup in a Single Flutter App]]></title>
            <link>https://medium.com/@nandhinid1591/firebase-dev-prod-project-setup-in-a-single-flutter-app-b6c1b6c96939?source=rss-7ed6b8dff735------2</link>
            <guid isPermaLink="false">https://medium.com/p/b6c1b6c96939</guid>
            <dc:creator><![CDATA[Nandhini]]></dc:creator>
            <pubDate>Fri, 18 Jul 2025 06:43:14 GMT</pubDate>
            <atom:updated>2025-07-18T06:43:14.356Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’re managing <strong>two Firebase projects</strong> (one for dev and one for prod) in a <strong>single Flutter app</strong>, follow these steps to configure both environments properly.</p><h3>📁 1. Add Both Firebase Projects</h3><ol><li>Go to Firebase Console</li><li>Select your <strong>Dev</strong> project → Click <strong>Add App</strong> → Choose <strong>Flutter</strong></li><li>Follow the terminal instructions (this generates necessary config files)</li><li>Repeat for your <strong>Prod</strong> Firebase project</li></ol><p>You’ll now have the following files:</p><ul><li>firebase_options.dart</li><li>firebase.json</li><li>google-services.json (Android)</li><li>GoogleService-Info.plist (iOS)</li></ul><h3>🧩 2. Rename Config Files</h3><p>File Type Dev Prod Firebase Options Dart firebase_options_dev.dart firebase_options_prod.dart Firebase JSON firebase.dev.json firebase.prod.json Android Config android/app/src/dev/google-services.json android/app/src/prod/google-services.json iOS Config GoogleService-Info-dev.plist GoogleService-Info-prod.plist</p><h3>🧠 3. Update main.dart</h3><p>Based on the <strong>flavor</strong> (dev or prod), initialize Firebase using the correct config file:</p><pre><br>void main() async {<br>  WidgetsFlutterBinding.ensureInitialized();<br>// Choose the correct FirebaseOptions<br>  const bool isDev = bool.fromEnvironment(&#39;dart.vm.product&#39;) == false;<br>  final options = isDev<br>      ? DefaultFirebaseOptionsDev.currentPlatform<br>      : DefaultFirebaseOptionsProd.currentPlatform;<br>  await Firebase.initializeApp(options: options);<br>  runApp(MyApp());<br>}</pre><h3>🤖 4. Android Setup</h3><ol><li>Place the respective google-services.json files in:</li></ol><pre><br>android/app/src/dev/google-services.json<br>android/app/src/prod/google-services.json</pre><ol><li>Your build.gradle will automatically detect the correct file based on flavor.</li></ol><p>✅ Android setup done!</p><h3>🍎 5. iOS Setup</h3><h3>a. Rename your plist files:</h3><pre><br>ios/Runner/GoogleService-Info-dev.plist<br>ios/Runner/GoogleService-Info-prod.plist</pre><h3>b. Add to xcconfig files</h3><p>In both Debug.xcconfig and Release.xcconfig, add:</p><pre><br>FIREBASE_PLIST=Runner/GoogleService-Info-dev.plist<br>FIREBASE_PLIST=Runner/GoogleService-Info-prod.plist</pre><h3>c. Configure Xcode:</h3><ol><li>Open project in Xcode</li><li>Go to <strong>Runner → Build Settings</strong></li><li>Add a <strong>User-Defined Setting</strong> named: FIREBASE_PLIST</li><li>Set value depending on flavor:</li></ol><pre><br>Runner/GoogleService-Info-dev.plist<br>Runner/GoogleService-Info-prod.plist</pre><h3>d. Add Run Script in Build Phases (before Flutter build):</h3><pre><br># 👇 Add this before the Flutter build command<br>echo &quot;Selected Firebase Plist: ${FIREBASE_PLIST}&quot;<br>cp &quot;${PROJECT_DIR}/${FIREBASE_PLIST}&quot; \\<br>   &quot;${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/GoogleService-Info.plist&quot;<br># 👇 Keep this line to let Flutter build your app<br>/bin/sh &quot;$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh&quot; build</pre><h3>⚠️ Final iOS Tip:</h3><p>If you get build errors:</p><ul><li>Open project.pbxproj</li><li><strong>Search and remove</strong> all GoogleService-Info.plist references, except in the ShellScript section</li></ul><h3>✅ All Set!</h3><p>Your app is now configured to use the <strong>correct Firebase project</strong> based on the selected <strong>flavor</strong> in both Android and iOS.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b6c1b6c96939" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>