<?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 gaurav sharma on Medium]]></title>
        <description><![CDATA[Stories by gaurav sharma on Medium]]></description>
        <link>https://medium.com/@sharma.gs12501?source=rss-3c16fe8ec25e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*qRYgZ4XwwAUWKX0m</url>
            <title>Stories by gaurav sharma on Medium</title>
            <link>https://medium.com/@sharma.gs12501?source=rss-3c16fe8ec25e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 20:16:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sharma.gs12501/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[Update Application — Flutter using firebase remote config]]></title>
            <link>https://medium.com/@sharma.gs12501/update-application-flutter-using-firebase-remote-config-76f62d237fb2?source=rss-3c16fe8ec25e------2</link>
            <guid isPermaLink="false">https://medium.com/p/76f62d237fb2</guid>
            <category><![CDATA[flutter-community]]></category>
            <category><![CDATA[content]]></category>
            <category><![CDATA[automatic-app-update]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[how-to]]></category>
            <dc:creator><![CDATA[gaurav sharma]]></dc:creator>
            <pubDate>Fri, 22 Sep 2023 05:25:02 GMT</pubDate>
            <atom:updated>2023-09-22T09:17:10.270Z</atom:updated>
            <content:encoded><![CDATA[<h3>Update Application — Flutter using firebase remote config</h3><p>Welcome to this tutorial for adding update app to your flutter application with firebase remote config</p><p><strong>Enough!</strong> Lets start with it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/220/1*lY4v298iFDCsEJL23iFLpg.gif" /></figure><h3>Output -</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/534/1*XAaZSpdUwrHYXV_h7CtTRA.png" /><figcaption>Optional update popup</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/534/1*rEfz_dwKUsU_ZTjzO_ocaQ.png" /><figcaption>Force update popup</figcaption></figure><h3>Breaking down</h3><ul><li>We have two types of update dialogs: <strong>Optional</strong> <strong>update</strong> and <strong>Required</strong> <strong>update</strong>. Based on your preference you can keep one or both of them.</li></ul><p>For both <strong>Optional and Required update </strong>dialog:</p><ul><li>If user <strong>clicks</strong> <strong>on</strong> <strong>Update now</strong>, we will redirect the user to the PlayStore or AppStore page of our app.</li></ul><p>For<strong> Optional update </strong>dialog:</p><ul><li>If user <strong>clicks on Later</strong>, close the dialog and show it next time user opens the app. (Again, you can change it based on preference, maybe change the option to remind me tomorrow)</li></ul><p>After creating Firebase app we have to do set up</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oTsr3B4BzufhquXkvqOX1A.png" /><figcaption>pg.1</figcaption></figure><ul><li>In remote configuration, set <strong>your parameter’s</strong> default value to ‘false.’ This value allows you to control the type of updates you want</li></ul><p>After that publish changes is required to reflect your update App popup</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*onQzu3gXyFEIdXwbkf0LPQ.png" /></figure><p>Create new condition by clicking on edit to the existing parameter</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FA1LuOJOc7bU2bSYRBu13A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ilfnGkxcqrY2a1KlwCDL1g.png" /><figcaption>click on add new in pg.1</figcaption></figure><p>the above condition help you in testing update feature in different different environments</p><p><strong>First Part Done..</strong></p><p>Integrate this functionality into your mobile application</p><p>add this pubspec.yaml</p><pre>firebase_remote_config: 3.0.9</pre><p>In Home Screen Add Below code:</p><pre>FirebaseRemoteConfig firebaseRemoteConfig = FirebaseRemoteConfig.instance;<br><br></pre><pre>Future&lt;bool&gt; checkFirebaseRemoteConfigForUpdateStatus() async {<br>  await firebaseRemoteConfig.fetchAndActivate();<br>  bool _isUpdate =<br>  firebaseRemoteConfig.getBool(&#39;${Constants.appNameRemoteConfig}_update&#39;);<br><br>  return _isUpdate;<br>}</pre><pre>Future&lt;void&gt; checkForUpdate() async {<br>  await Future.delayed(Duration.zero);<br>  LoadingDialogWidget.showDialogLoading(context, AppColor.appTheme);//comment this if<br>//your app is not in play store<br>  await firebaseRemoteConfig.setConfigSettings(<br>    RemoteConfigSettings(<br>      fetchTimeout: const Duration(seconds: 60),<br>      minimumFetchInterval: const Duration(seconds: 0),<br>    ),<br>  );<br>  bool _isMandatoryUpdate = await checkFirebaseRemoteConfigForUpdateStatus();<br>  try {<br>    AppUpdateInfo info = await  InAppUpdate.checkForUpdate();//comment this if<br>//your app is not in play store<br>    Navigator.of(context).pop();//comment this if<br>//your app is not in play store<br>    if (info.updateAvailability == UpdateAvailability.updateAvailable) {//comment this if<br>//your app is not in play store<br>      showDialog(<br>        barrierDismissible: !_isMandatoryUpdate,<br>        context: context,<br>        builder: (BuildContext context) {<br>          return WillPopScope(<br>            onWillPop: () =&gt; Future.value(!_isMandatoryUpdate),<br>            child: AlertDialog(<br>              title: Text(Strings.appupdate),<br>              content: Column(<br>                mainAxisSize: MainAxisSize.min,<br>                children: &lt;Widget&gt;[<br>                  Padding(<br>                      padding: EdgeInsets.only(top: 15.0),<br>                      child: Text(_isMandatoryUpdate ?<br>                          &#39;A new version of Test APK is available on Playstore, Kindly update !&#39;:<br>                      &#39;A new version of Test APK is available on Playstore, do you want to upgrade?&#39;)),<br>                ],<br>              ),<br>              actions: &lt;Widget&gt;[<br>                if (!_isMandatoryUpdate)<br>                  TextButton(<br>                      child: Text(Strings.later),<br>                      onPressed: () {<br>                        Navigator.pop(context);<br>                      }),<br>                TextButton(<br>                    child: Text(&quot;Upgrade Now&quot;),<br>                    onPressed: () async {<br>                      String url =<br>                          &quot;https://play.google.com/store/apps/details?id=com.marketwork&quot;;<br>                      if (await canLaunchUrl(Uri.parse(url))) {<br>                        await launchUrl(Uri.parse(url),<br>                            mode: LaunchMode.externalApplication);<br>                      } else {<br>                        throw &#39;Could not launch $url&#39;;<br>                      }<br>                    }),<br>              ],<br>            ),<br>          );<br>        },<br>      );<br>    }<br>  } catch (ex) {<br>    print(&#39;update error $ex&#39;);<br>    Navigator.of(context).pop();<br>  }<br>}</pre><p>Please include a comment in the code to handle scenarios where the app is not on the Play Store, ensuring that it doesn’t result in a black screen</p><pre>LoadingDialogWidget.showDialogLoading(context, AppColor.appTheme);<br>AppUpdateInfo info = await  InAppUpdate.checkForUpdate();<br>Navigator.of(context).pop();<br>if (info.updateAvailability == UpdateAvailability.updateAvailable) {}<br></pre><p><strong>Conclusion:</strong></p><p>In conclusion, leveraging Firebase Remote Config for updating your Flutter app represents a dynamic and user-friendly approach to keeping your application current. This powerful combination ensures seamless updates, enhanced user experiences, and the ability to adapt your app’s behavior without the need for frequent releases. By harnessing Firebase Remote Config’s capabilities, you empower your app to evolve effortlessly, staying at the forefront of innovation while providing a smoother experience for your users.</p><p>Thanks for reading this article ❤</p><p>If I got something wrong? Let me know in the comments. I would love to improve.</p><p>Clap 👏 If this article helps you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=76f62d237fb2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to integrate Subscription based payment gateway using RazorPay with Flutter?]]></title>
            <link>https://medium.com/@sharma.gs12501/how-to-integrate-subscription-based-payment-gateway-using-razorpay-with-flutter-985ce3407825?source=rss-3c16fe8ec25e------2</link>
            <guid isPermaLink="false">https://medium.com/p/985ce3407825</guid>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[medium]]></category>
            <category><![CDATA[payment-gateway]]></category>
            <category><![CDATA[razorpay]]></category>
            <category><![CDATA[razorpay-integration]]></category>
            <dc:creator><![CDATA[gaurav sharma]]></dc:creator>
            <pubDate>Fri, 28 Apr 2023 07:04:10 GMT</pubDate>
            <atom:updated>2023-04-28T07:06:24.809Z</atom:updated>
            <content:encoded><![CDATA[<p>So many of us using payment gateways for subscription based in different-different application ,</p><p>Let try to implement it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/220/1*IXzLa32ZshCqB6MzIDsWPA.gif" /></figure><p>Hello Folks</p><p>Today I am going to share my recent learning in flutter, which is subscription based payment integration using razor pay.</p><p>Below are steps how we will going to implement it</p><h3><strong>Payment gateway’s Functional Steps</strong></h3><ol><li><strong>Check Whether User Subscribed</strong> : User enter in Application we check whether plan option empty or choose any plan.</li><li><strong>Show Subscription</strong> : User haven’t selected any plan we will showing them different plans.</li><li><strong>Payment</strong> : User can selected payment plan through credit/debit card/UPI/net banking etc.</li><li><strong>Shared Transaction To Backend</strong> : After completing Success of Failure journey of payment user will send data’s like transaction ID,User Data,Plan and Date etc.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/521/1*ttVC9ytQ6zWw5wC04jPG1Q.png" /><figcaption>Once logged we have to check whether he selected any plan or not if selected then we can show them subscribed plans and if they are still not subscribed then we can show them different — different plans after choosing them user can proceed for payment and after success or failure application’s backend must be integrated with web hook for status sharing backend or Database. It’s require in case of user incomplete payment process, user get calls , phone got switch off etc, Web hook make sure’s user payment not should stuck or face any issue.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/1*AopD7_gls8UDcm0Ir0aZDg.jpeg" /></figure><h3>Implementation:</h3><p><strong>Step 1: Add the dependencies</strong></p><p>Add dependencies to pubspec.yaml file.</p><p>dependencies:</p><pre>razorpay_flutter: ^1.1.1</pre><p>This is a flutter example integrate Razorpay payment, in this code, you will see how to add Razorpay in our code and how to get an order with online payment. This below video shows how Razorpay Payment will work.</p><h3>Full Code for references:</h3><pre><br>import &#39;package:cookies_app/Ui/home.dart&#39;;<br>import &#39;package:cookies_app/View_Model/cart_view_model.dart&#39;;<br>import &#39;package:cookies_app/base/base_view.dart&#39;;<br>import &#39;package:cookies_app/bottom_bar.dart&#39;;<br>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:razorpay_flutter/razorpay_flutter.dart&#39;;<br>import &#39;package:fluttertoast/fluttertoast.dart&#39;;<br><br>class Cart extends StatefulWidget {<br><br>  @override<br>  _CartState createState() =&gt; _CartState();<br>}<br><br>class _CartState extends State&lt;Cart&gt; {<br>  Razorpay _razorpay;<br><br><br>  @override<br>  void dispose() {<br>    super.dispose();<br>    _razorpay.clear();<br>  }<br><br>  void openCheckout() async {<br>    var options = {<br>      &#39;key&#39;: &#39;rzp_test_NNbwJ9tmM0fbxj&#39;,<br>      &#39;amount&#39;: 28200,<br>      &#39;name&#39;: &#39;Gaurav Sharma&#39;,<br>      &#39;description&#39;: &#39;Payment&#39;,<br>      &#39;prefill&#39;: {&#39;contact&#39;: &#39;8888888888&#39;, &#39;email&#39;: &#39;gauravtest@razorpay.com&#39;},<br>      &#39;external&#39;: {<br>        &#39;wallets&#39;: [&#39;paytm&#39;]<br>      }<br>    };<br><br>    try {<br>      _razorpay.open(options);<br>    } catch (e) {<br>      debugPrint(e);<br>    }<br>  }<br><br>  void _handlePaymentSuccess(PaymentSuccessResponse response) {<br><br>    showAlertDialog(context, &quot;Payment Successful&quot;, &quot;Payment ID: ${response.paymentId}&quot;);<br>  }<br><br>  void _handlePaymentError(PaymentFailureResponse response) {<br><br>    showAlertDialog(context, &quot;Payment Failed&quot;, &quot;Code: ${response.code}\nDescription: ${response.message}\nMetadata:${response.error.toString()}&quot;);<br> <br>  }<br><br>  void _handleExternalWallet(ExternalWalletResponse response) {<br><br>        showAlertDialog(context, &quot;External Wallet Selected&quot;, &quot;${response.walletName}&quot;);<br>  }<br><br> @override<br>  Widget build(BuildContext context) {<br>    return Scaffold(<br>      appBar: AppBar(<br>        title: Text(widget.title),<br>      ),<br>      body: Center(<br>        child: Column(<br>          mainAxisAlignment: MainAxisAlignment.center,<br>          children: &lt;Widget&gt;[<br>            const Text(<br>              &#39;Pay with Razorpay&#39;,<br>            ),<br>            ElevatedButton(onPressed: (){<br>              Razorpay razorpay = Razorpay();<br>              var options = {<br>                &#39;key&#39;: &#39;rzp_live_ILgsfZCZoFIKMb&#39;,<br>                &#39;amount&#39;: 100,<br>                &#39;name&#39;: &#39;Acme Corp.&#39;,<br>                &#39;description&#39;: &#39;Fine T-Shirt&#39;,<br>                &#39;retry&#39;: {&#39;enabled&#39;: true, &#39;max_count&#39;: 1},<br>                &#39;send_sms_hash&#39;: true,<br>                &#39;prefill&#39;: {&#39;contact&#39;: &#39;8888888888&#39;, &#39;email&#39;: &#39;test@razorpay.com&#39;},<br>                &#39;external&#39;: {<br>                  &#39;wallets&#39;: [&#39;paytm&#39;]<br>                }<br>              };<br>              razorpay.on(Razorpay.EVENT_PAYMENT_ERROR, handlePaymentErrorResponse);<br>              razorpay.on(Razorpay.EVENT_PAYMENT_SUCCESS, handlePaymentSuccessResponse);<br>              razorpay.on(Razorpay.EVENT_EXTERNAL_WALLET, handleExternalWalletSelected);<br>              razorpay.open(options);<br>            },<br>                child: const Text(&quot;Pay with Razorpay&quot;)),<br>          ],<br>        ),<br>      ),<br>      floatingActionButton: FloatingActionButton(<br>        onPressed: _incrementCounter,<br>        tooltip: &#39;Increment&#39;,<br>        child: const Icon(Icons.add),<br>      ), // This trailing comma makes auto-formatting nicer for build methods.<br>    );<br>  }<br><br>void showAlertDialog(BuildContext context, String title, String message){<br>    // set up the buttons<br>    Widget continueButton = ElevatedButton(<br>      child: const Text(&quot;Continue&quot;),<br>      onPressed:  () {},<br>    );<br>    // set up the AlertDialog<br>    AlertDialog alert = AlertDialog(<br>      title: Text(title),<br>      content: Text(message),<br>      actions: [<br>        continueButton,<br>      ],<br>    );<br>    // show the dialog<br>    showDialog(<br>      context: context,<br>      builder: (BuildContext context) {<br>        return alert;<br>      },<br>    );<br>  }<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/270/0*9UB0xgyokKUiJyVu.gif" /></figure><p>So this was the basic example of the Flutter app integrated with Razorpay Payment where we did a simple example and you can learn it and also you can do it.</p><h3>Webhooks</h3><p>Use webhooks to get notified about events related to the Razorpay payment flow such as orders, payments, settlements, disputes and workflow steps related to other Razorpay Products.</p><h3>Please find links for your references</h3><ul><li><a href="https://razorpay.com/docs/webhooks/">Webhooks</a></li><li><a href="https://pub.dev/packages/razorpay_flutter">razorpay_flutter | Flutter Package</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*7z-gyKfeSpz25vO0ArTX0Q.jpeg" /></figure><p>Thanks for reading this article ❤</p><p>If I got something wrong? Let me know in the comments. I would love to improve.</p><p>Clap 👏 If this article helps you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=985ce3407825" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>