<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Enappd</title>
    <description>The latest articles on DEV Community by Enappd (@enappd).</description>
    <link>https://dev.to/enappd</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F970%2Fea2619fc-48a1-4b54-ba7f-0a40a2b5931f.png</url>
      <title>DEV Community: Enappd</title>
      <link>https://dev.to/enappd</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/enappd"/>
    <language>en</language>
    <item>
      <title>How to know if a React Native App goes to background ?</title>
      <dc:creator>Vaibhav Gehani</dc:creator>
      <pubDate>Wed, 07 Sep 2022 20:34:45 +0000</pubDate>
      <link>https://dev.to/enappd/how-to-know-if-a-react-native-app-goes-to-background--422o</link>
      <guid>https://dev.to/enappd/how-to-know-if-a-react-native-app-goes-to-background--422o</guid>
      <description>&lt;h3&gt;
  
  
  How to know if a React Native App goes to the background?
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QANaPxWa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2APZChlOrQ5XMiTzBIZUeozQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QANaPxWa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2APZChlOrQ5XMiTzBIZUeozQ.png" alt="" width="880" height="293"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We all question sometimes — Is it possible to know if a React Native app has gone to the background? Is there any callback or event which can be captured? The answer is &lt;strong&gt;AppState&lt;/strong&gt;. As a bonus, we will cover adding a security screen to react native application.&lt;/p&gt;

&lt;p&gt;In this article, we will go through &lt;strong&gt;AppState API&lt;/strong&gt; and implement a scenario having a security screen that will be shown while switching between apps and while the app is in the foreground.&lt;/p&gt;

&lt;h3&gt;
  
  
  AppState
&lt;/h3&gt;

&lt;p&gt;This API helps us to know the state of App if the app is &lt;strong&gt;&lt;em&gt;active&lt;/em&gt;&lt;/strong&gt; , &lt;strong&gt;&lt;em&gt;inactive,&lt;/em&gt;&lt;/strong&gt; or in &lt;strong&gt;&lt;em&gt;background&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This API can be used in several use cases :&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Handling Push Notification&lt;/li&gt;
&lt;li&gt;Adding Security Screen.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In other words, any event you want to perform while switching app between &lt;strong&gt;&lt;em&gt;active to foreground&lt;/em&gt;&lt;/strong&gt; OR &lt;strong&gt;&lt;em&gt;foreground to background&lt;/em&gt;&lt;/strong&gt; OR &lt;strong&gt;&lt;em&gt;background to active&lt;/em&gt;&lt;/strong&gt;. Any of the cases can be handled using AppState API.&lt;/p&gt;

&lt;p&gt;In Background, AppState API is using native functionality to trigger these events, like for iOS it uses &lt;a href="https://developer.apple.com/documentation/uikit/app_and_environment/managing_your_app_s_life_cycle"&gt;Life Cycle Events&lt;/a&gt; and those events can be Scene Based or App Based.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1 — Implementing AppState API
&lt;/h3&gt;

&lt;p&gt;To implement AppState, we just have to import it from React Native and add a &lt;strong&gt;&lt;em&gt;change&lt;/em&gt;&lt;/strong&gt; Event listener. That event listener will provide the value of “what will be next /upcoming state for the application”. Using this we can trigger some code on State change.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;&lt;em&gt;appStateVisible&lt;/em&gt;&lt;/strong&gt; holds the value of the current state of the application. We can only see the &lt;strong&gt;&lt;em&gt;active&lt;/em&gt;&lt;/strong&gt; state. But events can be triggered either in background, or foreground (because appState is indirectly using the Native Life cycle events).&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2 — Implementing security screen using AppState API
&lt;/h3&gt;

&lt;p&gt;A security screen is a kind of blank screen that will appear while we are not active on the application (In other words, when we are not using the app there will be a blank/empty screen).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ba8SaURg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/380/1%2A7iSmVSFURqitVpePkwIPvw.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ba8SaURg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/380/1%2A7iSmVSFURqitVpePkwIPvw.gif" alt="Security screen" width="380" height="670"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In above video, you will see if the app comes in the foreground (while switching the app) then a blank screen would appear. And if the notification section is scrolled down, in that case also you will see a blank screen for a moment. &lt;strong&gt;&lt;em&gt;It is the security screen to protect our data/view, while we are not on the app&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The logic of creating this security screen is quite similar to the above logic, we just have to add a condition to check the current state. If appState is in &lt;strong&gt;&lt;em&gt;background&lt;/em&gt;&lt;/strong&gt; or &lt;strong&gt;&lt;em&gt;foreground&lt;/em&gt;&lt;/strong&gt; state, then we have to show the blank screen and if app is &lt;strong&gt;&lt;em&gt;active&lt;/em&gt;&lt;/strong&gt; , render the main content in  &lt;strong&gt;App.js&lt;/strong&gt;&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;In the above code, you can render your main content in appStateVisible == ‘active’ and if you want to add any content to the security screen then add code in the else part.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;We know how we can handle situations where the app is in the background or foreground. There can be various scenarios “how to call API when the app is in the background”, “how to handle push notifications when the app is in the foreground or background” or “how to show the security screen while app is in the foreground”. Now we can handle these situations easily using AppState API.&lt;/p&gt;

&lt;p&gt;Stay tuned to get more ways to use different inbuilt React native APIs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Next Steps
&lt;/h3&gt;

&lt;p&gt;If you liked this blog, you will also find the following &lt;strong&gt;React Native&lt;/strong&gt; blogs interesting and helpful. Feel free to ask any questions in the comment section&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Firebase — &lt;a href="https://enappd.com/blog/intergrate-firebase-in-react-native-app/73"&gt;&lt;strong&gt;Integrate Firebase&lt;/strong&gt;&lt;/a&gt; | &lt;a href="https://enappd.com/blog/firebase-analytics-in-react-native-app/101"&gt;&lt;strong&gt;Analytics&lt;/strong&gt;&lt;/a&gt; | &lt;a href="https://enappd.com/blog/react-native-firebase-crud-image-upload-and-phone-authentication/86"&gt;&lt;strong&gt;Push notifications&lt;/strong&gt;&lt;/a&gt; | &lt;a href="https://enappd.com/blog/react-native-firebase-crud-image-upload-and-phone-authentication/86"&gt;&lt;strong&gt;Firebase CRUD&lt;/strong&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;How To in React Native — &lt;a href="https://enappd.com/blog/geolocation-geocoding-react-native-apps/84"&gt;&lt;strong&gt;Geolocation&lt;/strong&gt;&lt;/a&gt; | &lt;a href="https://enappd.com/blog/react-native-life-cycle-hooks/79"&gt;&lt;strong&gt;Life cycle hooks&lt;/strong&gt;&lt;/a&gt; | &lt;a href="https://enappd.com/blog/pick-images-from-camera-gallery-in-react-native-app/78"&gt;&lt;strong&gt;Image Picker&lt;/strong&gt;&lt;/a&gt; | &lt;a href="https://enappd.com/blog/redux-in-react-native-app/92"&gt;&lt;strong&gt;Redux implementation&lt;/strong&gt;&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-make-api-calls-in-react-native-apps/125"&gt;&lt;strong&gt;Make API calls&lt;/strong&gt;&lt;/a&gt; | &lt;a href="https://enappd.com/blog/navigations-in-react-native-app/124"&gt;&lt;strong&gt;Navigation&lt;/strong&gt;&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-translate-in-react-native-app-globalization-internationalization-and-text-to-speech/120"&gt;&lt;strong&gt;Translation&lt;/strong&gt;&lt;/a&gt; | &lt;a href="https://enappd.com/blog/react-native-qr-code-scanning-using-react-native-camera/117"&gt;&lt;strong&gt;Barcode &amp;amp; QR code scan&lt;/strong&gt;&lt;/a&gt; | &lt;a href="https://enappd.com/blog/send-read-and-delete-sms-in-react-native/107"&gt;&lt;strong&gt;Send &amp;amp; Read SMS&lt;/strong&gt;&lt;/a&gt; | &lt;a href="https://enappd.com/blog/google-vision-with-react-native/96"&gt;&lt;strong&gt;Google Vision&lt;/strong&gt;&lt;/a&gt; | &lt;a href="https://enappd.com/blog/refreshcontrol-pull-to-refresh-in-react-native-apps/130"&gt;&lt;strong&gt;Pull to Refresh&lt;/strong&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Payments — &lt;a href="https://enappd.com/blog/implement-apple-pay-in-react-native-apps/93"&gt;&lt;strong&gt;Apple Pay&lt;/strong&gt;&lt;/a&gt; | &lt;a href="https://enappd.com/blog/stripe-integration-in-react-native-apps-using-firebase/108"&gt;&lt;strong&gt;Stripe payments&lt;/strong&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Authentication — &lt;a href="https://enappd.com/blog/google-login-in-react-native-android-apps-with-firebase/90"&gt;&lt;strong&gt;Google Login&lt;/strong&gt;&lt;/a&gt;| &lt;a href="https://enappd.com/blog/facebook-login-in-react-native-apps/89"&gt;&lt;strong&gt;Facebook login&lt;/strong&gt;&lt;/a&gt; | &lt;a href="https://enappd.com/blog/react-native-firebase-crud-image-upload-and-phone-authentication/86"&gt;&lt;strong&gt;Phone Auth&lt;/strong&gt;&lt;/a&gt; | &lt;a href="https://enappd.com/blog/twitter-login-in-react-native-apps-using-firebase/95"&gt;&lt;strong&gt;Twitter login&lt;/strong&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://enappd.com/blog/how-to-make-stories-ui-like-instagram-and-whatsapp-in-react-native/123"&gt;&lt;strong&gt;Create Instagram / Whatsapp Story Feature in React Native&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://enappd.com/blog/react-native-life-cycle-hooks/79"&gt;&lt;strong&gt;React Native life cycle hooks&lt;/strong&gt;&lt;/a&gt; | &lt;a href="https://enappd.com/blog/redux-in-react-native-app/92"&gt;&lt;strong&gt;Implement Redux&lt;/strong&gt;&lt;/a&gt; | &lt;a href="https://enappd.com/blog/async-actions-with-redux-thunk-middleware-in-react-native-apps-1/100"&gt;&lt;strong&gt;Async actions with Redux&lt;/strong&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://enappd.com/blog/guide-on-react-native-full-app/53"&gt;&lt;strong&gt;Create Awesome Apps in React Native&lt;/strong&gt;&lt;/a&gt; using Full App&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you need a base to start your next React Native app, you can make your next awesome app using &lt;a href="https://store.enappd.com/product/react-native-full-app/"&gt;&lt;strong&gt;React Native Full App&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MkmPpxkC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/0%2A50h94UU2H2pkisje.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MkmPpxkC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/0%2A50h94UU2H2pkisje.jpeg" alt="React Native Full App by Enappd" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;




</description>
      <category>react</category>
      <category>iosappdevelopment</category>
      <category>androidappdevelopmen</category>
      <category>reactnative</category>
    </item>
    <item>
      <title>Migrating Ionic Cordova to Capacitor application — Complete Guide</title>
      <dc:creator>Vaibhav Gehani</dc:creator>
      <pubDate>Sun, 04 Sep 2022 03:28:05 +0000</pubDate>
      <link>https://dev.to/enappd/migrating-ionic-cordova-to-capacitor-application-complete-guide-510l</link>
      <guid>https://dev.to/enappd/migrating-ionic-cordova-to-capacitor-application-complete-guide-510l</guid>
      <description>&lt;h3&gt;
  
  
  Migrating Ionic Cordova to Capacitor application — Complete Guide
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fmFxn2p6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AYjlfQv6uDCzb98AKoghC5A.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fmFxn2p6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AYjlfQv6uDCzb98AKoghC5A.png" alt="" width="880" height="293"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here is the complete guide to converting the Ionic Cordova application to Capacitor (this article works best for Ionic version 5/6 Angular). These days most of the developers are moving to the Capacitor, as it has more stable plugins than Cordova, and Apache has stopped support for the Cordova platform. In this tutorial, we will not just go through the commands to convert Cordova to capacitor but the &lt;strong&gt;complete process of converting&lt;/strong&gt; a Real life Cordova app to Capacitor. Yay !!&lt;/p&gt;

&lt;h3&gt;
  
  
  Capacitor — How is it different from Cordova?
&lt;/h3&gt;

&lt;p&gt;This section is relevant to only those who have been working with Ionic / Cordova for some time. Cordova has been the only choice available for Ionic app developers for quite some time. Cordova helps build an Ionic web app into a device installable app.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;Capacitor is very similar to Cordova, but with some key differences in the app workflow&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here are the differences between Cordova and Capacitor (You’ll appreciate these only if you have been using Cordova earlier, otherwise you can just skip this section)&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Capacitor considers each platform project a &lt;em&gt;source asset&lt;/em&gt; instead of a &lt;em&gt;build time asset&lt;/em&gt;. That means Capacitor wants you to keep the platform source code in the repository, unlike Cordova which always assumes that you will generate the platform code on build time&lt;/li&gt;
&lt;li&gt;Because of the above, Capacitor does not use config.xml or a similar custom configuration for platform settings. Instead, configuration changes are made by editing AndroidManifest.xml for Android and Info.plist for Xcode&lt;/li&gt;
&lt;li&gt;Capacitor does not “run on device” or emulate through the command line. Instead, such operations occur through the platform-specific IDE. So you cannot run an Ionic-capacitor app using a command like ionic run ios . You will have to run iOS apps using &lt;em&gt;Xcode&lt;/em&gt;, and Android apps using &lt;em&gt;Android studio&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Since platform code is not a &lt;em&gt;source asset,&lt;/em&gt; you can directly change the native code using Xcode or Android Studio. This give more flexibility to developers&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In essence, Capacitor is like a fresh, more flexible version of Cordova.&lt;/p&gt;

&lt;h3&gt;
  
  
  Migrating Cordova to Capacitor
&lt;/h3&gt;

&lt;p&gt;Before going on the steps for converting the Ionic Cordova app to Ionic Capacitor — we will look at the App code to be converted. Below is the &lt;strong&gt;&lt;em&gt;package.json&lt;/em&gt;&lt;/strong&gt; file for the Ionic Cordova project.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;If you see the above package file, you will see there is a Cordova framework installed over Ionic. Now let’s start migrating Cordova to Capacitor.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UQKUSiPb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/480/1%2Aj6QXFviQla8-Cjs-f07W0A.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UQKUSiPb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/480/1%2Aj6QXFviQla8-Cjs-f07W0A.gif" alt="" width="480" height="270"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To migrate Cordova to Capacitor, you should have a Cordova project first (LAMMO 😂). Go to your project directory and run the below command to add the Capacitor traces to your Cordova application.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ ionic integrations enable capacitor
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The above command will initialize and add basic capacitor libraries to your Cordova project. There are some base plugins that are needed to run the app on the devices or browsers.&lt;/p&gt;

&lt;p&gt;This command sometimes gives errors [in real life — always gives errors 🚨]. If it throws errors, then install the base plugin using the below command.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ npm install @capacitor/app @capacitor/haptics @capacitor/keyboard @capacitor/status-bar
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Now base plugins are installed, after that, we will initialize the capacitor using the below command&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ npx cap init 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This command will ask you for some basic information related to App. Like the App name, and bundle ID. It will also ask if you want to copy plugin info from &lt;strong&gt;&lt;em&gt;config.xml&lt;/em&gt;&lt;/strong&gt; file, type &lt;strong&gt;&lt;em&gt;‘y’&lt;/em&gt;&lt;/strong&gt; for that.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FRifzvTn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A3BHn6JtzRnNY9jI15WEEVw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FRifzvTn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A3BHn6JtzRnNY9jI15WEEVw.png" alt="" width="880" height="272"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This will create &lt;strong&gt;&lt;em&gt;‘capacitor.config.ts&lt;/em&gt;&lt;/strong&gt; ’ file, it’s equivalent to &lt;strong&gt;&lt;em&gt;config.xml&lt;/em&gt;&lt;/strong&gt; file in the Cordova framework. Let’s have a look at &lt;strong&gt;capacitor.config.ts&lt;/strong&gt; file and modify it for the capacitor framework.&lt;/p&gt;
&lt;h3&gt;
  
  
  Config file for Cordova setting
&lt;/h3&gt;

&lt;p&gt;If you observe this file you will find a Cordova: {} block that contains information regarding Cordova plugins. But we don’t want Cordova now, so we will modify this file (capacitor.config.ts) for the capacitor.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;Now we have added a plugins: {} block, that contains capacitor plugins information. Like Splash Screen, Push Notifications etc. plugins config (plugins {}) contains config of each plugin used in Ionic project. Capacitor can also have the Cordova plugin installed in it (but in our case we only want capacitor plugin to be used).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;if you want to know more about how Config file is configured, the goto&lt;/em&gt;&lt;/strong&gt; &lt;a href="https://capacitorjs.com/docs/config"&gt;&lt;strong&gt;&lt;em&gt;Capacitor config Schema&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt; &lt;strong&gt;&lt;em&gt;.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Whenever you install a plugin, the plugin config needs to be added in this file. Like if you install Twitter plugin then its secret key will be put under config.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note :-&lt;/strong&gt; As we are initialising Capacitor 3, it needs &lt;strong&gt;capacitor.config.ts&lt;/strong&gt; file rather than &lt;strong&gt;capacitor.config.json&lt;/strong&gt; file (JSON file is supported by Capacitor 2 and older).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now we are ready to take off. Before setting up Android and iOS platform, we will remove all the instances/plugin of Cordova and replace it with Capacitor. We will start this with cleaning up the &lt;strong&gt;&lt;em&gt;package.json&lt;/em&gt;&lt;/strong&gt; file. Here cleaning up means, removing all the Cordova existence from App (starting it with package.json file).&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note :-&lt;/strong&gt; My way of removing cordova plugin from package.json file is to search for “cordova”and “@ionic-native” and remove all the strings or blocks related to it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;While removing Cordova plugin from &lt;strong&gt;&lt;em&gt;package.json&lt;/em&gt;&lt;/strong&gt; file, copy the removed plugin somewhere as we should know what plugin we need to add for capacitor. After removal of all the Cordova and ionic-native &lt;strong&gt;&lt;em&gt;package.json&lt;/em&gt;&lt;/strong&gt; will look like :-&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;But you must be feeling, our application is on state of complete break down. Yes, if you try to run ionic serve, you will see it will give lot of error. But wait for a while, our app will be fixed up soon.&lt;/p&gt;

&lt;h4&gt;
  
  
  After adding Capacitor to the application, we have to follow 3 steps:-
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Removing Cordova and ionic-native code usage instances from the Ionic project.&lt;/li&gt;
&lt;li&gt;Installing capacitor plugins&lt;/li&gt;
&lt;li&gt;Replacing Cordova plugin code with capacitor plugin code.&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note :-&lt;/strong&gt; This part will differ for each of the application, as every application uses same or the different plugins.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For removing the Cordova and ionic-native instances, we can search for ionic-native and remove all the instances of it. I will take one example of removing ionic-native and Cordova instances of the Cordova push plugin and adding a new alternative to the Capacitor Push notification plugin.&lt;/p&gt;

&lt;p&gt;To remove and replace the Plugin, we will follow the below steps:-&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1 — Removing Cordova and ionic-native code usage instances from the Ionic project
&lt;/h3&gt;

&lt;p&gt;Remove initialization of Cordova push plugin from app.module.ts :- Goto app.module.ts, remove the import statement of push plugin and also remove the injection of Push module from the providers. You have to remove the below-mentioned lines from the file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { FCM } from '@ionic-native/fcm/ngx'; - Remove FCM import statement

Providers: [
...,
FCM // Remove injection of FCM module
]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we have to remove it from Implementation file as well. Goto the file where your push plugin is imported. [Simply search for “&lt;em&gt;import { FCM } from ‘@ionic-native/fcm/ngx’”&lt;/em&gt;]&lt;/p&gt;

&lt;p&gt;Once you are on the page, remove the &lt;em&gt;import&lt;/em&gt; statement and remove all the existence of that Push Plugin. Our code is in such a place where we do have push plugin implemented.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2— Installing capacitor plugins
&lt;/h3&gt;

&lt;p&gt;Implementing Capacitor Push plugin (Replacing Cordova Push Plugin) :- Its just a simple step, you can go to&lt;a href="https://capacitorjs.com/docs/apis"&gt;Capacitor Plugins&lt;/a&gt; page and search for the plugin you want to use. Before using it we have to install the push plugin using the below code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ npm install @capacitor/push-notifications
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 3— Replacing Cordova plugin code with capacitor plugin code.
&lt;/h3&gt;

&lt;p&gt;Capacitor plugins are easier to use as we do not have to inject them. In our case, we have used the push plugin, so add the below logic accordingly to your application. Put this code in place of your old Cordova-based plugin code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { PushNotifications } from '@capacitor/push-notifications';

const addListeners = async () =&amp;gt; {
  await PushNotifications.addListener('registration', token =&amp;gt; {
    console.info('Registration token: ', token.value);
  });
  await PushNotifications.addListener('registrationError', err =&amp;gt; {
    console.error('Registration error: ', err.error);
  });
  await PushNotifications.addListener('pushNotificationReceived', notification =&amp;gt; {
    console.log('Push notification received: ', notification);
  });
  await PushNotifications.addListener('pushNotificationActionPerformed', notification =&amp;gt; {
    console.log('Push notification action performed', notification.actionId, notification.inputValue);
   });
}

const registerNotifications = async () =&amp;gt; {
  let permStatus = await PushNotifications.checkPermissions();
  if (permStatus.receive === 'prompt') {
     permStatus = await PushNotifications.requestPermissions();
  }
  if (permStatus.receive !== 'granted') {
     throw new Error('User denied permissions!');
  }
  await PushNotifications.register();
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Like this, we can replace a Cordova plugin with a Capacitor plugin. This would be applicable for all of the plugins that need to be replaced with the Capacitor plugin.&lt;/p&gt;

&lt;p&gt;Now our application is completely migrated to the Capacitor framework. And we can add android and iOS platforms to it by running the below command:-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Creating www build folder

$ ionic build

// Installing android and ios packages

$ npm install @capacitor/android
$ npm install @capacitor/ios


// Adding iOS and android platform to the Ionic app

$ npx cap add android
$ npx cap add ios
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Bonus : Using a Cordova plugin with Capacitor 🎉
&lt;/h3&gt;

&lt;p&gt;You will find many of the &lt;strong&gt;&lt;em&gt;plugins are not yet available in Capacitor but are available in Cordova&lt;/em&gt;&lt;/strong&gt;. So, How to set the Cordova in a Capacitor app ? what to do in that situation?; we can also use Cordova plugins in the Ionic capacitor application. Let’s take an example, if you want to add a plugin to pick contacts from the contact book then the capacitor does not have any option for that but we have a Cordova alternative for it (&lt;a href="https://www.npmjs.com/package/cordova-plugin-contacts"&gt;cordova-plugin-contacts&lt;/a&gt;). Run the below command to install the contacts plugin&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ npm install cordova-plugin-contacts
$ npm install @ionic-native/contacts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the plugin is installed, we have to inject it into &lt;strong&gt;&lt;em&gt;module.ts&lt;/em&gt;&lt;/strong&gt; file as shown below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { Contacts } from '@ionic-native/contacts/ngx'; - Importing Contacts

Providers: [
...,
Contacts // Adding Contacts module as provider
]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now for using it, we can simply import the plugin in the component.ts or page.ts and inject the Contacts module.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { Contacts } from '@ionic-native/contacts/ngx';

constructor(private contacts: Contacts) {}

pickContacts() {
  this.contacts.pickContact()
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Now we have successfully converted the Ionic Cordova application to the Ionic Capacitor application. Now the Ionic world is moving to the &lt;a href="https://capacitorjs.com/"&gt;capacitor&lt;/a&gt;, as it has a more stable environment and does not cause any installation issues. You also found — How to set the Cordova plugins in a Capacitor app.&lt;/p&gt;

&lt;h3&gt;
  
  
  Next Steps
&lt;/h3&gt;

&lt;p&gt;If you liked this blog, you will also find the following Ionic blogs interesting and helpful. Feel free to ask any questions in the comment section&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ionic Payment Gateways — &lt;a href="https://enappd.com/blog/ionic-4-stripe-payment-integration-with-firebase-for-apps-and-pwa/17"&gt;Stripe&lt;/a&gt; | &lt;a href="https://enappd.com/blog/ionic-4-paypal-payment-integration-for-apps-and-pwa/16"&gt;PayPal&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-integrate-apple-pay-in-ionic-4-apps/21"&gt;Apple Pay&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-integrate-razorpay-in-ionic-4-apps-and-pwa/20"&gt;RazorPay&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Charts with — &lt;a href="https://enappd.com/blog/ionic-4-charts-using-google-charts/66"&gt;Google Charts&lt;/a&gt;| &lt;a href="https://enappd.com/blog/adding-charts-in-ionic-4-apps-and-pwa-part-3/60"&gt;HighCharts&lt;/a&gt; | &lt;a href="https://enappd.com/blog/adding-charts-in-ionic-4-apps-and-pwa-part-2/54"&gt;d3.js&lt;/a&gt; | &lt;a href="https://enappd.com/blog/charts-in-ionic-4-apps-and-pwa-part-1/52"&gt;Chart.js&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Social Logins — &lt;a href="https://enappd.com/blog/facebook-login-in-ionic-4-apps-using-firebase/25"&gt;Facebook&lt;/a&gt; | &lt;a href="https://enappd.com/blog/google-login-in-ionic-4-apps-using-firebase/39"&gt;Google&lt;/a&gt; | &lt;a href="https://enappd.com/blog/twitter-login-in-ionic-4-apps-using-firebase/24"&gt;Twitter&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Authentications — &lt;a href="https://enappd.com/blog/email-authentication-with-firebase-in-ionic-4/38"&gt;Via Email&lt;/a&gt; | &lt;a href="https://enappd.com/blog/firebase-anonymous-login-in-ionic-4/37"&gt;Anonymous&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Features — &lt;a href="https://enappd.com/blog/using-geolocation-geocoding-and-reverse-geocoding-in-ionic-4/45"&gt;Geolocation&lt;/a&gt; | &lt;a href="https://enappd.com/blog/qr-code-scanning-and-optical-character-recognition-ocr-in-ionic-4/9"&gt;QR Code reader&lt;/a&gt;| &lt;a href="https://enappd.com/blog/best-fitness-plugins-for-ionic-4-how-to-use-pedometer/15"&gt;Pedometer&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Media in Ionic — &lt;a href="https://enappd.com/blog/spotify-like-music-in-ionic-4-apps/48"&gt;Audio&lt;/a&gt; | &lt;a href="https://enappd.com/blog/adding-video-player-in-ionic-4-app/64"&gt;Video&lt;/a&gt; | &lt;a href="https://enappd.com/blog/image-picker-in-ionic-4-app/67"&gt;Image Picker&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-add-image-cropper-in-ionic-4-app/68"&gt;Image Cropper&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Essentials — &lt;a href="https://enappd.com/blog/ionic-4-save-and-retrieve-data-locally-on-device/59"&gt;Native Storage&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-translate-in-ionic-4-globalization-internationalization-and-localization/11"&gt;Translations&lt;/a&gt; | &lt;a href="https://enappd.com/blog/rtl-right-to-left-use-in-ionic-4/50"&gt;RTL&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic messaging — &lt;a href="https://enappd.com/blog/implement-ionic-4-firebase-push/34"&gt;Firebase Push&lt;/a&gt; | &lt;a href="https://enappd.com/blog/automatically-read-sms-in-ionic-4-apps/42"&gt;Reading SMS&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic with Firebase — &lt;a href="https://enappd.com/blog/how-to-integrate-firebase-in-ionic-4-apps/23"&gt;Basics&lt;/a&gt; | &lt;a href="https://enappd.com/blog/firebase-with-ionic-4-hosting-auth-and-db-connection/58"&gt;Hosting and DB&lt;/a&gt; | &lt;a href="https://enappd.com/blog/firebase-cloud-functions-in-ionic-4-complete-guide/32"&gt;Cloud functions&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Ionic React Full App with Capacitor
&lt;/h3&gt;

&lt;p&gt;If you need a base to start your next Ionic 5 React Capacitor app, you can make your next awesome app using &lt;a href="https://store.enappd.com/product/ionic-react-full-app-capacitor/"&gt;Ionic 5 React Full App in Capacitor&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VtnFDcof--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/760/1%2AG3yOFVX4oABx9MhUy-3kng.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VtnFDcof--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/760/1%2AG3yOFVX4oABx9MhUy-3kng.png" alt="Ionic 5 React Full App in Capacitor from Enappd" width="760" height="479"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Ionic Capacitor Full App (Angular)
&lt;/h3&gt;

&lt;p&gt;If you need a base to start your next Angular &lt;strong&gt;Capacitor app&lt;/strong&gt; , you can make your next awesome app using &lt;a href="https://store.enappd.com/product/capacitor-full-app-with-ionic-angular/"&gt;Capacitor Full App&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3CTfBLjg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/736/0%2AUwSHcofTMStMnzAX.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3CTfBLjg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/736/0%2AUwSHcofTMStMnzAX.png" alt="Capacitor Full App with huge number of layouts and features" width="736" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Ionic Full App (Angular and Cordova)
&lt;/h3&gt;

&lt;p&gt;If you need a base to start your next Ionic 5 app, you can make your next awesome app using &lt;a href="https://store.enappd.com/product/ionic-full-app"&gt;Ionic 5 Full App&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--g_hLq_eU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/700/0%2A1ArpKyhiDHZnevwB.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--g_hLq_eU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/700/0%2A1ArpKyhiDHZnevwB.jpeg" alt="Ionic Full App with huge number of layouts and features" width="700" height="442"&gt;&lt;/a&gt;&lt;/p&gt;




</description>
      <category>capacitorjs</category>
      <category>androidappdevelopmen</category>
      <category>ionic</category>
      <category>cordova</category>
    </item>
    <item>
      <title>Deploying the Ionic iOS Application to App Store</title>
      <dc:creator>Vaibhav Gehani</dc:creator>
      <pubDate>Wed, 13 Jul 2022 04:02:34 +0000</pubDate>
      <link>https://dev.to/enappd/deploying-the-ionic-ios-application-to-app-store-3b13</link>
      <guid>https://dev.to/enappd/deploying-the-ionic-ios-application-to-app-store-3b13</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rUivWPII--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A_BN6Jkc0HxGHRK1lgBzhww.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rUivWPII--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A_BN6Jkc0HxGHRK1lgBzhww.png" alt="" width="880" height="293"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Deploying an Ionic iOS application to the App store is easier than deploying an Android application. In the Android application, we have to create an APK/Bundle and sign the APK/Bundle with a Keystore. And in the case of iOS applications, Xcode handles most of the signing and other stuff.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note :- App Store is very strict about the app details, correct information, legal use of resources — all info provided should be very clear and true.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;There are some Prerequisites to following this tutorial and deploying the app to App Store.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You must have &lt;a href="https://developer.apple.com"&gt;Apple Developers Account&lt;/a&gt; (&lt;a href="https://appstoreconnect.apple.com/login"&gt;App Store connect&lt;/a&gt; Account).&lt;/li&gt;
&lt;li&gt;You must have &lt;a href="https://developer.apple.com/xcode/"&gt;Xcode&lt;/a&gt; installed on your Mac.&lt;/li&gt;
&lt;li&gt;The Most important:- You should have an Ionic application.&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;Now let start, and get your hands dirty into the Code. It’s enough of talking.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JYIVi-TA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/450/1%2AqtLLXKOJJjKKNbLcTEzWpg.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JYIVi-TA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/450/1%2AqtLLXKOJJjKKNbLcTEzWpg.gif" alt="" width="450" height="295"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Register into Apple Developers Account
&lt;/h4&gt;

&lt;p&gt;Before Registering you have to enroll in some of the programs. To get all the information about registration. Goto &lt;a href="https://developer.apple.com/programs/enroll/"&gt;Enroll Program&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Adding iOS platform and Building the Ionic application.
&lt;/h3&gt;

&lt;p&gt;As we already assume that you know how to start an Ionic Application. We will not go into details about it, you can check out our other blogs for Ionic app tutorials.&lt;/p&gt;

&lt;h4&gt;
  
  
  Add iOS app platform
&lt;/h4&gt;

&lt;p&gt;Add the iOS platform to your ionic app with these commands (run from project root) :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ npm install [@capacitor/i](http://twitter.com/capacitor/android)os
$ npx cap add ios
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can sync the existing installed plugins and web assets using&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ npx cap sync ios
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will update the corresponding pods for the iOS project and open the project in Xcode using&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ npx cap open ios
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Click on &lt;strong&gt;App&lt;/strong&gt; in left menu → &lt;strong&gt;Signing &amp;amp; Capabilities ,&lt;/strong&gt; select your development Team, keep &lt;strong&gt;Automatically Manage Signing&lt;/strong&gt;  checked.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--aFD5QTuE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2AJJ8veDQk2jS38XGxEPZ6Rw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aFD5QTuE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2AJJ8veDQk2jS38XGxEPZ6Rw.png" alt="" width="800" height="413"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Archive the iOS Application using Xcode.
&lt;/h3&gt;

&lt;p&gt;To Build the iOS application, Open XCode and Select Any iOS Device from the top of the window.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_TJmsosd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AsGd7usTGMkVN_icy_15XkQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_TJmsosd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AsGd7usTGMkVN_icy_15XkQ.png" alt="" width="880" height="55"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As we want to deploy App, which can be run on any iOS device. That's why we have to select &lt;strong&gt;Any iOS Device&lt;/strong&gt;. Then Click on &lt;strong&gt;Product&lt;/strong&gt; and Select “ &lt;strong&gt;Build&lt;/strong&gt; ”. This command will build the App code and will check if there is any Error in Plugins or in Code. If there is no error, then we are good to go (Let's Go..!)&lt;/p&gt;

&lt;p&gt;But before Archiving and following the further step, you have to create an app in app store connect. To Create it, goto to the home page and click on create app option.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MExCrOID--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A2jc04UKJzcwR8xKpH6O0Sw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MExCrOID--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A2jc04UKJzcwR8xKpH6O0Sw.png" alt="" width="880" height="290"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It will ask for the &lt;strong&gt;App name&lt;/strong&gt; and a few more information, here Bundle ID is handled by the XCode. When you click on Bundle ID, it will show some of the bundle IDs connected to your Apple ID.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ynL9w8n_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/558/1%2AV7nI_VfcXbfIkw_nG4WvfA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ynL9w8n_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/558/1%2AV7nI_VfcXbfIkw_nG4WvfA.png" alt="" width="558" height="644"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once the app is created you will see a Dashboard (Now Xcode will check for the App in App Store Connect), where you have to input the information about the Application like &lt;em&gt;App Screenshots&lt;/em&gt;, &lt;em&gt;App Logo,&lt;/em&gt; and &lt;em&gt;Login&lt;/em&gt; Information.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--N54mGb7b--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2Aq45xcchkSYJj4YpEAyPBMw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--N54mGb7b--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2Aq45xcchkSYJj4YpEAyPBMw.png" alt="" width="880" height="694"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note :- If your App has some login mechanism then provide it in the App Access section. As Apple Team will log in to the app and will check the app in detail.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now select the &lt;strong&gt;Archive&lt;/strong&gt; option in &lt;strong&gt;Product&lt;/strong&gt; Options in XCode, This will create a new version of the iOS build for the code. It creates a  &lt;strong&gt;.ipa&lt;/strong&gt; file that is equivalent to the  &lt;strong&gt;.apk&lt;/strong&gt; in Android.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nvrXxVNf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2Ad4-D52u3fmzYUjitYXzayQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nvrXxVNf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2Ad4-D52u3fmzYUjitYXzayQ.png" alt="" width="880" height="52"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once the iOS app is archived, you will get a popup to select Distribution Method. Click on Distribute option, it will ask which way you want to distribute the application.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PsoDaspe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A_ZA8wFfMf2VCGNhSd4DIcg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PsoDaspe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A_ZA8wFfMf2VCGNhSd4DIcg.png" alt="" width="880" height="542"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As we want to distribute the iOS app to the App Store, so select &lt;strong&gt;App Store Connect&lt;/strong&gt; and click on “ &lt;strong&gt;Next&lt;/strong&gt; ”. After selecting Platform, we have to select the &lt;strong&gt;destination&lt;/strong&gt; for the App to be uploaded.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--x1Hq6JV_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AFgiHhI_MINMIJziXb_AoVA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--x1Hq6JV_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AFgiHhI_MINMIJziXb_AoVA.png" alt="" width="880" height="542"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To upload this version of the application, select the “ &lt;strong&gt;Upload&lt;/strong&gt; ” option and click on “ &lt;strong&gt;Next&lt;/strong&gt; ”. This will take some time to upload the Archive to the App Store.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XjwB786B--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2ADWaLUHks69IFn4nKInkzbA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XjwB786B--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2ADWaLUHks69IFn4nKInkzbA.png" alt="" width="880" height="542"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;While Uploading the Archive, it will ask for some options. Like App Store Connect Distribution options.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--X5yQmIr6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A3fF7J429hwRFqz1zxiyDzg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--X5yQmIr6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A3fF7J429hwRFqz1zxiyDzg.png" alt="" width="880" height="542"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Keep it as it is, as we want to upload the App Symbols and Manage Version automatically by the XCode. Now click on “Next”.&lt;/p&gt;

&lt;p&gt;Now the important part comes that makes our work much easier, is managing to sign of Archive. The “Automatically manage to sign” option is auto-selected. Don’t touch it unless you love problematic life 😂, XCode is here to make your life easy.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note :- If you want to Sign the Application manually. Check the later part of the Blog. ⬇️&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3EHHxAz7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AhJ2cLEzFG3rEwyJvKjqqcw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3EHHxAz7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AhJ2cLEzFG3rEwyJvKjqqcw.png" alt="" width="880" height="542"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now click on “Next”, Finally this will Process and it will show the summary of the Application. Much awaited option “ &lt;strong&gt;Upload&lt;/strong&gt; ” button will come up.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--eU6yWxkF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2ARl45PACZObi9-cKSwuIKYQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eU6yWxkF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2ARl45PACZObi9-cKSwuIKYQ.png" alt="" width="880" height="542"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Finally, it is uploading now….!! 😎. If you see it, it shows uploading &lt;strong&gt;App.ipa&lt;/strong&gt; file. This means the Archive contains the &lt;strong&gt;IPA&lt;/strong&gt; file. Which is being uploaded to the App store connect.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ve422kY8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2ApWptGVC51k3kIQZi8FTRrg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ve422kY8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2ApWptGVC51k3kIQZi8FTRrg.png" alt="" width="880" height="542"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Yay, our application is being uploaded to the App store connect. Now we will move to the the &lt;strong&gt;App Store Connect&lt;/strong&gt; Dashboard. To set up and publish the application.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RlXmO5sQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AQk_jHM7SJnOtAa7WXftqwA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RlXmO5sQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AQk_jHM7SJnOtAa7WXftqwA.png" alt="" width="880" height="542"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Checking the App on App Store Connect.
&lt;/h3&gt;

&lt;p&gt;To check App is there in App Store Connect Dashboard. Goto TestFlight Tab — you will see the App uploaded there. From there it can be used for internal testing OR for Deploying the application to the App Store.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3F9g1aKz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AjhX4gNMaszhkC_dWM9dt9w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3F9g1aKz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AjhX4gNMaszhkC_dWM9dt9w.png" alt="" width="880" height="221"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now to deploy the application, you have added a build on the Dashboard. Scroll a bit and click on the Select a build option.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mMdUEzQt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2ABXp2HJq720_f-JEOnbZ_qQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mMdUEzQt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2ABXp2HJq720_f-JEOnbZ_qQ.png" alt="" width="880" height="148"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Selecting a Build will show you the apps present in Testflight. You have to select the proper version of the application (currently there’s only 1 version available).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pjCm_F68--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/552/1%2AJgpfZdF2vqYGm6fvjEcbnw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pjCm_F68--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/552/1%2AJgpfZdF2vqYGm6fvjEcbnw.png" alt="" width="552" height="388"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we have filled in all the information and selected the Build. It is the time for submitting it for the Review.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nL-Y9_Di--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AZLljG-BV1vzGOjG6ZSinvg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nL-Y9_Di--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AZLljG-BV1vzGOjG6ZSinvg.png" alt="" width="880" height="84"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on Submit for Review and App will be submitted for review to the Apple Team. It can take up to a week to review. But Apple Team will Review it and will contact you if there is some problem OR they will publish the Application🎉.&lt;/p&gt;

&lt;h3&gt;
  
  
  Signing the iOS Application Manually
&lt;/h3&gt;

&lt;p&gt;To sign the Application manually — when you want to control the signing steps completely, you have to create a certificate and provisioning profile in the &lt;a href="https://developer.apple.com"&gt;App Store Connect&lt;/a&gt;. Once you login into App Store connect, Goto &lt;a href="https://developer.apple.com/account/resources/certificates/list"&gt;&lt;em&gt;Certificates, ID and Profiles&lt;/em&gt;&lt;/a&gt; and create a certificate.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9R_dGjwv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AX3uzVnd0Xh3NiSdA6RUxpA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9R_dGjwv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AX3uzVnd0Xh3NiSdA6RUxpA.png" alt="" width="880" height="318"&gt;&lt;/a&gt;&lt;br&gt;
Click one &lt;strong&gt;+&lt;/strong&gt; and it will ask for “&lt;em&gt;what type of certificate you want to create&lt;/em&gt;”. We have to select the Apple Distribution option and click on &lt;strong&gt;continue&lt;/strong&gt;. Now it will ask for “Certificate Signing Request” which we have to create using Mac.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7Zx56oB7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AOTLOPYjxN3NPwse84uRQ-Q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7Zx56oB7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AOTLOPYjxN3NPwse84uRQ-Q.png" alt="" width="880" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Creating Certificate Signing Request
&lt;/h4&gt;

&lt;p&gt;Open &lt;strong&gt;Keychain Access&lt;/strong&gt; on your Mac, goto &lt;strong&gt;Certificate Assistance&lt;/strong&gt; , and “Request a Certificate from Certificate Authority”. It will open a Certificate Assistance and you have to enter an Email ID (Apple ID) and select the Saved to Disk option. Click on continue to Create and Download the Certificate Signing Request.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--piDtAdXI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/618/1%2Ai7OYAIwTHR7IDsXyemL0aw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--piDtAdXI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/618/1%2Ai7OYAIwTHR7IDsXyemL0aw.png" alt="" width="618" height="439"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once CertificateSigningRequest (.certSigningRequest) is downloaded. We have to upload that into &lt;a href="https://developer.apple.com/account/resources/certificates/add"&gt;Adding Certificates Section&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6q39UEY8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A8832cgYKBEiZunvt_4XL3A.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6q39UEY8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A8832cgYKBEiZunvt_4XL3A.png" alt="" width="880" height="234"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Creating Profile
&lt;/h4&gt;

&lt;p&gt;We have created the Certificate, now go to &lt;a href="https://developer.apple.com/account/resources/profiles/list"&gt;Profiles Section&lt;/a&gt; and Add a new profile. It will ask for “&lt;em&gt;which type of profile you want to add&lt;/em&gt;”. Select the App Store option from Distribution Section.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Hy-Ernlk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AiZloEcfAUUK5ex79GkbJxQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Hy-Ernlk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AiZloEcfAUUK5ex79GkbJxQ.png" alt="" width="880" height="464"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After clicking on Continue, we have to select the App (using App ID). When you click on the dropdown, it will sync with XCode and suggest the already existing Apps (as Bundle Name). Select the App and click on “Continue”.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4yDXWX0E--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2ABlWW9LluF4DuF26QRn5AJw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4yDXWX0E--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2ABlWW9LluF4DuF26QRn5AJw.png" alt="" width="880" height="464"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once you click on continue, It can ask for the name of the Profile (Use any name). And you can download the Profile (.mobileprofile) after the process.&lt;/p&gt;

&lt;p&gt;Now we have the &lt;strong&gt;Certificate&lt;/strong&gt; and &lt;strong&gt;Profile&lt;/strong&gt;. It’s time to manually sign the iOS application.&lt;/p&gt;

&lt;h4&gt;
  
  
  Manually Sign the iOS application
&lt;/h4&gt;

&lt;p&gt;After selecting the Manually Signing option. It will ask for a Certificate and Profile.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UEbV00ZF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/749/1%2AIKjMJ1x_5iKXjhKRyKpcMQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UEbV00ZF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/749/1%2AIKjMJ1x_5iKXjhKRyKpcMQ.png" alt="" width="749" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on next after selecting the Downloaded Certificate and Profile. Then XCode will sign the iOS application and Send it to the App store connect (Test Flight). Then you can select the Build Version on the Release Page (Shown Above). And your manual signing process is complete.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Now our iOS Application is being deployed to the App Store. You can share the link to the app with the users — after the Apple team reviews the App. So they can download the application and use it. Stay tuned to &lt;a href="https://enappd.com/blog/"&gt;&lt;strong&gt;&lt;em&gt;Enappd Blogs&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt; for more Awesome Blogs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Next Steps
&lt;/h3&gt;

&lt;p&gt;If you liked this blog, you will also find the following blogs interesting and helpful. Feel free to ask any questions in the comment section&lt;/p&gt;

&lt;h3&gt;
  
  
  Ionic Capacitor
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Basic&lt;/strong&gt;  — &lt;a href="https://enappd.com/blog/use-geolocation-geocoding-and-reverse-geocoding-in-ionic-capacitor/131"&gt;Geolocation&lt;/a&gt; | &lt;a href="https://enappd.com/blog/qr-code-and-barcode-scanning-with-ionic-capacitor/127"&gt;Barcode &amp;amp; QR code&lt;/a&gt; | &lt;a href="https://enappd.com/blog/facebook-login-in-capacitor-apps-with-ionic-angular/128"&gt;Facebook Login&lt;/a&gt; (Angular) | &lt;a href="https://enappd.com/blog/facebook-login-in-ionic-react-capacitor-apps/118"&gt;Facebook Login (React)&lt;/a&gt; | &lt;a href="https://enappd.com/blog/icon-splash-in-ionic-react-capacitor-apps/114"&gt;Icon and Splash&lt;/a&gt; | &lt;a href="https://enappd.com/blog/camera-and-gallery-in-ionic-react-app-using-capacitor/110"&gt;Camera &amp;amp; Photo Gallery&lt;/a&gt; | &lt;a href="https://enappd.com/blog/debugging-ionic-apps-using-chrome-and-safari-developers-tools/167"&gt;Debugging with browser&lt;/a&gt;|Theming in Ionic apps&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Advanced&lt;/strong&gt;  — &lt;a href="https://enappd.com/blog/implement-admob-in-ionic-react-capacitor-apps/135"&gt;AdMob&lt;/a&gt; | &lt;a href="https://enappd.com/blog/local-notifications-in-ionic-5-capacitor/132"&gt;Local Notifications&lt;/a&gt; | &lt;a href="https://enappd.com/blog/google-login-in-ionic-react-capacitor-apps/122"&gt;Google Login&lt;/a&gt; | &lt;a href="https://enappd.com/blog/twitter-login-in-ionic-react-capacitor-app/121"&gt;Twitter Login&lt;/a&gt; | &lt;a href="https://enappd.com/blog/html5-games-in-ionic-capacitor-using-phaser/115"&gt;Games using Phaser&lt;/a&gt; | &lt;a href="https://enappd.com/blog/play-music-in-ionic-capacitor-apps/112"&gt;Play music&lt;/a&gt; | &lt;a href="https://enappd.com/blog/firebase-push-notification-in-ionic-react-capacitor/111"&gt;Push Notifications&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Ionic Cordova
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://enappd.com/blog/ionic-app-with-nodejs-express-mysql-sequelize-taxi-app/160"&gt;Taxi Booking App example with Ionic, Node, Express and MySQL&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Ionic Payment Gateways — &lt;a href="https://enappd.com/blog/integrate-stripe-payment-gateway-in-ionic-5-apps-and-pwa-using-firebase/158"&gt;Stripe with Firebase&lt;/a&gt; | &lt;a href="https://enappd.com/blog/ionic-5-stripe-payment-integration-firebase-cloud-functions-vs-node-express-based-server/159"&gt;Stripe with NodeJS&lt;/a&gt; | &lt;a href="https://enappd.com/blog/paypal-integration-in-ionic-apps-and-pwa/142"&gt;PayPal&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-integrate-apple-pay-in-ionic-4-apps/21"&gt;Apple Pay&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-integrate-razorpay-in-ionic-4-apps-and-pwa/20"&gt;RazorPay&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Charts with — &lt;a href="https://enappd.com/blog/ionic-4-charts-using-google-charts/66"&gt;Google Charts&lt;/a&gt;| &lt;a href="https://enappd.com/blog/adding-charts-in-ionic-4-apps-and-pwa-part-3/60"&gt;HighCharts&lt;/a&gt; | &lt;a href="https://enappd.com/blog/adding-charts-in-ionic-4-apps-and-pwa-part-2/54"&gt;d3.js&lt;/a&gt; | &lt;a href="https://enappd.com/blog/charts-in-ionic-4-apps-and-pwa-part-1/52"&gt;Chart.js&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Authentications — &lt;a href="https://enappd.com/blog/firebase-email-authentication-in-ionic-apps/153"&gt;Via Email&lt;/a&gt; | &lt;a href="https://enappd.com/blog/implement-anonymous-login-in-ionic-apps-with-firebase/154"&gt;Anonymous&lt;/a&gt; | &lt;a href="https://enappd.com/blog/facebook-login-in-ionic-apps-using-firebase/150"&gt;Facebook&lt;/a&gt; | &lt;a href="https://enappd.com/blog/implement-google-login-in-ionic-apps-using-firebase/147"&gt;Google&lt;/a&gt; | &lt;a href="https://enappd.com/blog/twitter-login-in-ionic-4-apps-using-firebase/24"&gt;Twitter&lt;/a&gt; | &lt;a href="https://enappd.com/blog/firebase-phone-authentication-in-ionic-5-apps/169"&gt;Via Phone&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Features — &lt;a href="https://enappd.com/blog/ionic-5-complete-guide-on-geolocation/141"&gt;Geolocation&lt;/a&gt;| &lt;a href="https://enappd.com/blog/ionic-complete-guide-barcode-qrcode-scan/140"&gt;QR Code reader&lt;/a&gt; | &lt;a href="https://enappd.com/blog/best-fitness-plugins-for-ionic-4-how-to-use-pedometer/15"&gt;Pedometer&lt;/a&gt;| &lt;a href="https://enappd.com/blog/implement-signature-pad-in-ionic-apps/145"&gt;Signature&lt;/a&gt; &lt;a href="https://enappd.com/blog/implement-signature-pad-in-ionic-apps/145"&gt;Pad&lt;/a&gt; | &lt;a href="https://enappd.com/blog/using-background-geolocation-in-ionic-angular-apps/165"&gt;Background Geolocation&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Media in Ionic — &lt;a href="https://enappd.com/blog/spotify-like-music-in-ionic-4-apps/48"&gt;Audio&lt;/a&gt; | &lt;a href="https://enappd.com/blog/adding-video-player-in-ionic-4-app/64"&gt;Video&lt;/a&gt; | &lt;a href="https://enappd.com/blog/camera-and-image-picker-in-ionic-apps/148"&gt;Image Picker&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-add-image-cropper-in-ionic-apps/149"&gt;Image Cropper&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Essentials — &lt;a href="https://enappd.com/blog/debugging-ionic-apps-using-chrome-and-safari-developers-tools/167"&gt;Debugging with browser&lt;/a&gt;| &lt;a href="https://enappd.com/blog/ionic-4-save-and-retrieve-data-locally-on-device/59"&gt;Native Storage&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-translate-in-ionic-internationalization-and-localization/143"&gt;Translations&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-use-rtl-right-to-left-in-ionic-apps-pwa/152"&gt;RTL&lt;/a&gt; | &lt;a href="https://enappd.com/blog/using-sentry-error-monitoring-with-ionic-angular-applications/164"&gt;Sentry Error Monitoring&lt;/a&gt; | &lt;a href="https://enappd.com/blog/social-sharing-component-in-ionic-5-mobile-web-apps/168"&gt;Social sharing&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic messaging — &lt;a href="https://enappd.com/blog/how-to-implement-firebase-push-notifications-in-ionic-apps/157"&gt;Firebase Push&lt;/a&gt; | &lt;a href="https://enappd.com/blog/automatically-read-sms-in-ionic-4-apps/42"&gt;Reading SMS&lt;/a&gt; | &lt;a href="https://enappd.com/blog/local-notifications-in-ionic-5-capacitor/132"&gt;Local Notifications&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic with Firebase — &lt;a href="https://enappd.com/blog/how-to-integrate-firebase-in-ionic-4-apps/23"&gt;Basics&lt;/a&gt; | &lt;a href="https://enappd.com/blog/firebase-with-ionic-4-hosting-auth-and-db-connection/58"&gt;Hosting and DB&lt;/a&gt; | &lt;a href="https://enappd.com/blog/firebase-cloud-functions-in-ionic-5-complete-guide/166"&gt;Cloud functions&lt;/a&gt; | &lt;a href="https://enappd.com/blog/github-actions-deploying-ionic-angular-app-to-firebase-hosting/146"&gt;Deploy App to Firebase&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-use-firebase-emulators-with-ionic-angular-applications/163"&gt;Firebase simulator&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Unit Testing in Ionic — &lt;a href="https://enappd.com/blog/beginners-guide-to-ionic-angular-unit-testing-part-1/151"&gt;Part 1&lt;/a&gt; | &lt;a href="https://enappd.com/blog/beginners-guide-to-ionic-angular-unit-testing-part-2-mocks-and-spies/155"&gt;Mocks &amp;amp; Spies&lt;/a&gt;| &lt;a href="https://enappd.com/blog/beginners-guide-to-ionic-angular-unit-testing-async-testing/156"&gt;Async Testing&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Ionic React Full App with Capacitor
&lt;/h3&gt;

&lt;p&gt;If you need a base to start your next Ionic 5 React Capacitor app, you can make your next awesome app using &lt;a href="https://store.enappd.com/product/ionic-react-full-app-capacitor/"&gt;Ionic 5 React Full App in Capacitor&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VtnFDcof--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/760/1%2AG3yOFVX4oABx9MhUy-3kng.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VtnFDcof--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/760/1%2AG3yOFVX4oABx9MhUy-3kng.png" alt="Ionic 5 React Full App in Capacitor from Enappd" width="760" height="479"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Ionic Capacitor Full App (Angular)
&lt;/h3&gt;

&lt;p&gt;If you need a base to start your next Angular &lt;strong&gt;Capacitor app&lt;/strong&gt; , you can make your next awesome app using &lt;a href="https://store.enappd.com/product/capacitor-full-app-with-ionic-angular/"&gt;Capacitor Full App&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3CTfBLjg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/736/0%2AUwSHcofTMStMnzAX.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3CTfBLjg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/736/0%2AUwSHcofTMStMnzAX.png" alt="Capacitor Full App with huge number of layouts and features" width="736" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Ionic Full App (Angular and Cordova)
&lt;/h3&gt;

&lt;p&gt;If you need a base to start your next Ionic 5 app, you can make your next awesome app using &lt;a href="https://store.enappd.com/product/ionic-full-app"&gt;Ionic 5 Full App&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--g_hLq_eU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/700/0%2A1ArpKyhiDHZnevwB.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--g_hLq_eU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/700/0%2A1ArpKyhiDHZnevwB.jpeg" alt="Ionic Full App with huge number of layouts and features" width="700" height="442"&gt;&lt;/a&gt;&lt;/p&gt;




</description>
      <category>ionic</category>
      <category>deployment</category>
      <category>ios</category>
      <category>appstore</category>
    </item>
    <item>
      <title>Deploying Ionic Application to Play Store — Android</title>
      <dc:creator>Vaibhav Gehani</dc:creator>
      <pubDate>Sat, 09 Jul 2022 06:02:28 +0000</pubDate>
      <link>https://dev.to/enappd/deploying-ionic-application-to-play-store-android-3ihj</link>
      <guid>https://dev.to/enappd/deploying-ionic-application-to-play-store-android-3ihj</guid>
      <description>&lt;h3&gt;
  
  
  Deploying Ionic Application to Play Store -Android
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9XFtQMZj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A1ErF8mN55qHPtnY6P_BfMQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9XFtQMZj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A1ErF8mN55qHPtnY6P_BfMQ.png" alt="" width="880" height="293"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Most of the developers make the application but lag when they have asked to deploy them on the Play Store (Android). So in this tutorial, we will go through complete procedures Like “How to create a signed bundle for android app and deploy the app to Play Store”.&lt;/p&gt;

&lt;p&gt;It will be a “ &lt;strong&gt;&lt;em&gt;roller coaster ride&lt;/em&gt;&lt;/strong&gt; ” 😎, as we will be going through Android studio to the Android developer console. A lot of setup work is needed to deploy the Ionic Application.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--am1wgODl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/500/1%2AhRjp8e2tgqbyxWlUvZ_pnA.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--am1wgODl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/500/1%2AhRjp8e2tgqbyxWlUvZ_pnA.gif" alt="" width="500" height="372"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There is some Prerequisite you need to have before continuing further.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You need an &lt;a href="https://play.google.com/console"&gt;&lt;strong&gt;&lt;em&gt;Android Developer Account&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://developer.android.com/studio"&gt;&lt;strong&gt;&lt;em&gt;Android Studio&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt; should be installed on your machine.&lt;/li&gt;
&lt;li&gt;You should have an Ionic Application to deploy - [Most Important 😂]&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now we will start with setting up the Android app to be production-ready.&lt;/p&gt;

&lt;h3&gt;
  
  
  Making Android App Production Ready 📲
&lt;/h3&gt;

&lt;p&gt;I am assuming you have an Ionic Capacitor/Cordova application and it is ready to be deployed. And if you are new to the Ionic framework you can know more about that on &lt;a href="https://enappd.com/blog/"&gt;Enappd Blogs&lt;/a&gt;. Before moving on to Android Studio to create a Bundle file, there are some best practices that should be followed to create a production-ready code.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Delete all the unused files like unused assets/code, it helps to minimize the size of the &lt;strong&gt;www&lt;/strong&gt; folder that will be later used in creating an APK or Bundle file.&lt;/li&gt;
&lt;li&gt;Run npm run lint to remove all the lint errors in the code, it maintains the code up to a standard.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now we will move to the android studio, where we will create the Signed Bundle file. Earlier &lt;a href="https://play.google.com/console/"&gt;&lt;strong&gt;&lt;em&gt;Google Play console&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt; accepts the APK format but now it started accepting the Bundle file.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;What is APK and Bundle File?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;APK stands for &lt;strong&gt;Android Package Kit&lt;/strong&gt; and it is the type of format file used by Android Devices to install the apps into it. Android Package contains different elements that are needed to install the app on the device like app metadata. APK format is a variant of JAR (Java variant).&lt;/p&gt;

&lt;p&gt;Android App Bundle is a file (with the .aab file extension) that you upload to Google Play. App bundles are signed binaries that organize your app’s code and resources into modules. If you want to read more about this go &lt;a href="https://developer.android.com/guide/app-bundle/app-bundle-format#:~:text=An%20Android%20App%20Bundle%20is,as%20illustrated%20in%20figure%201."&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BJ9lXXz8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AIvmOkJgwIJdXuG6yxAh6cA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BJ9lXXz8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AIvmOkJgwIJdXuG6yxAh6cA.png" alt="" width="880" height="124"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Checking Android API level (Minimum Req)
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;Before creating the Bundle file, keep in mind your android app should be on Android API level 30 as accepted by Google Play Console (at the time of release of Blog)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To check what level your android app is — you can go to &lt;strong&gt;platforms/android/project.properties&lt;/strong&gt; and check the &lt;strong&gt;target&lt;/strong&gt; variable. Below is the attached screenshot, of how to check the target.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Axg1rfLc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A5DfWnYxf4f2Uo84SKEyItg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Axg1rfLc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A5DfWnYxf4f2Uo84SKEyItg.png" alt="" width="880" height="195"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If your Ionic android application is on a lower API level (&amp;lt;30) then to update it — add the below code to the &lt;strong&gt;config.xml&lt;/strong&gt; file&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;preference name="android-targetSdkVersion" value="30" /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above code will help ionic-cli to know, which version of Android API needs to be added (in this case 30). If you want to change the Android level just change the value field in the above code. Now we can remove the android platform and reinstall it using the below commands.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ ionic cordova platform rm android
$ ionic cordova platform add android
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the Android platform is added again, you can check the &lt;em&gt;project.properties&lt;/em&gt; target variable. Now we are ready to create a signed bundle using Android Studio.&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating Signed Bundle File using Android Studio
&lt;/h3&gt;

&lt;p&gt;Open Android Studio by locating your Android folder (&lt;em&gt;platforms/android&lt;/em&gt;) and go to the &lt;strong&gt;Build&lt;/strong&gt; menu and select &lt;strong&gt;Generate Signed Bundle / APK&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TGJbcx4A--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/862/1%2ArwsXOJvgMmLG7YulpFZHDw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TGJbcx4A--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/862/1%2ArwsXOJvgMmLG7YulpFZHDw.png" alt="" width="862" height="836"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After selecting generate signed Bundle/APK, select &lt;strong&gt;Android App Bundle&lt;/strong&gt; and click next (you can read the advantages/benefits of the Bundle file over APK)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--M8_QFFTT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2Au_TSnzVu3oMivAmm4FxOIA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--M8_QFFTT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2Au_TSnzVu3oMivAmm4FxOIA.png" alt="" width="880" height="515"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From here, we have to follow the steps carefully, we have to create a &lt;strong&gt;Keystore&lt;/strong&gt; file using which we will sign the Bundle file. Before creating a Keystore file, we will dive into “what is a Keystore file”.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9haim_2c--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AHTJA-G8_ozhfxLGjM1ei6g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9haim_2c--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AHTJA-G8_ozhfxLGjM1ei6g.png" alt="" width="880" height="859"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What is a Keystore File? 🔑
&lt;/h3&gt;

&lt;p&gt;The Keystore file contains the pair of the public and private keys that can be used in signing the file (any file can be signed using &lt;strong&gt;Keystore&lt;/strong&gt; , not only APK). Here, &lt;strong&gt;signing the file&lt;/strong&gt; means claiming the ownership of the file. If I sign an APK/Bundle file with a &lt;strong&gt;Keystore&lt;/strong&gt; then it shows I have both private and public keys and I am the owner of that signed File.4&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note :- Keep in mind, the generate keystore file should be &lt;strong&gt;protected&lt;/strong&gt; as if we want to update the application in future then the Bundle file should be signed with same Keystore.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The Keystore file contains the &lt;strong&gt;Keystore file password&lt;/strong&gt; and a &lt;strong&gt;key with password and validity.&lt;/strong&gt; Some other basic information is also needed while creating the file like name, org, and country code.&lt;/p&gt;

&lt;p&gt;Fill in all the required information for the Keystore file and click on “OK”. Now it returns to the previous dialog with filled-in details.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YVrLRPfa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AFqyMUEKMwR2NAtImuNOhNA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YVrLRPfa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AFqyMUEKMwR2NAtImuNOhNA.png" alt="" width="880" height="529"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We have created and selected the &lt;strong&gt;Keystore&lt;/strong&gt; file that would be used to sign the Bundle File. Now we just have to click on “Next” to sign it with that Keystore. Once you click on “Next”, it will ask, In which environment do you want to sign the Bundle File. Select “release” and click on Finish.&lt;/p&gt;

&lt;p&gt;Now, you will see a popup in the bottom right section of Android Studio, where it will ask you to locate the Signed Bundle file. (you can can click on locate or goto (platforms/android/app/release/app-release.aab).&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note :- If you didn’t get any response after clicking finish (at last step). Then you must have wrong password or have other problem. To resolve this, try to create a signed APK (rather than creating a bundle file) using Keystore. It will show you the possible error.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now we are ready with our &lt;strong&gt;app-release.aab&lt;/strong&gt; file and we just have configured a few things in &lt;a href="https://play.google.com/console"&gt;Google Play console&lt;/a&gt; and uploaded the &lt;strong&gt;app-release.aab&lt;/strong&gt; file.&lt;/p&gt;

&lt;h3&gt;
  
  
  Configuring Google Play Console
&lt;/h3&gt;

&lt;p&gt;First of all, we have to create an app in our Playstore console, this app is complete details of our app — along with Bundle. This app will be published in Google Play Store. To create the app click on the “Create app” option in the dashboard.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UeXfE0zn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AMW4UgT1WkC69m4pkQNLulg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UeXfE0zn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AMW4UgT1WkC69m4pkQNLulg.png" alt="" width="880" height="134"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After clicking on creating an app, it will ask for several app-level details like App name, Default language, app or game, free or paid, and will require some declarations at last (get check the boxes ✅). After filling in all the details click on Create app.&lt;/p&gt;

&lt;p&gt;Now app is created, the first thing you have to do is to &lt;strong&gt;create a release.&lt;/strong&gt; Select Release Overview on the side menu and select create a release and you will see the below screen.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0f1dlqrM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AznyoXdRz7gfnkbdFWdJvyg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0f1dlqrM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AznyoXdRz7gfnkbdFWdJvyg.png" alt="" width="880" height="543"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There is an option for App Bundle, click on the upload button and select the generated &lt;strong&gt;app-release.aab&lt;/strong&gt; file. Google Play Console will verify the bundle file, if it has some errors it will show there itself.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Possible Errors :- If you have uploaded a Bundle with wrong Keystore, you will get error of wrong SHA signing OR you will get the error for wrong Android API level (below API level 30).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;After successful upload, it will show the uploaded Bundle file as below screenshot :-&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3cfOOpSR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2ADzbWDx4qjPJa9EPKvjZ8Tg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3cfOOpSR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2ADzbWDx4qjPJa9EPKvjZ8Tg.png" alt="" width="880" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After setting up the release, you have to click on &lt;strong&gt;Review Release.&lt;/strong&gt; If there are some errors in creating a release it will show up (you will get an option to fix those error). While fixing those errors you will be taken to the Dashboard to update the Store details like App screenshots, Details, and other stuff.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uswcMOVu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AoSvL-AhAH2OdSzBHrCTGtA.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uswcMOVu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AoSvL-AhAH2OdSzBHrCTGtA.jpeg" alt="" width="880" height="581"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Dashboard contains various setting up info, like Target Audience, app access and more. You can also create an internal testing team and release an app for only a limited group of people. Some of the Information is mandatory — without entering it, you will not be able to release the application.&lt;/p&gt;

&lt;p&gt;Select Dashboard, Goto “Set up your App” and click on “Set up your Listing”. This is the most important part to set up, this info will be seen by users on the Play store.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lndmkagZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AS7g0C02wCQdE1ORAKjR8Fw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lndmkagZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AS7g0C02wCQdE1ORAKjR8Fw.png" alt="" width="880" height="191"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once you click on Store Listing, it will ask for the App name, description, app icon, and for few screenshots of the app on the device/simulator.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jjRy-Gsa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AujvZCzs-fLyOn-r8q7rl9g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jjRy-Gsa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AujvZCzs-fLyOn-r8q7rl9g.png" alt="" width="880" height="502"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on “Save” to submit the Store information and go back to &lt;strong&gt;Release Overview&lt;/strong&gt; and Continue there.&lt;/p&gt;

&lt;p&gt;Once you are done with all the information — click on “Review Release”. Then check all the information before submitting the app. Clicking “Submit” will submit your app to the Google team for review. It will take some days for review and after that, your application will be released to the Play Store 🚀.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UdoQwbUZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AbqZpxT-e0BzOVAKeg4hWUQ.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UdoQwbUZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AbqZpxT-e0BzOVAKeg4hWUQ.jpeg" alt="" width="880" height="291"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Now our Android Application is being deployed to the Google Play Store. You can share the link to the app with the users, so they can download the application and use it. Stay tuned to &lt;a href="https://enappd.com/blog/"&gt;&lt;strong&gt;&lt;em&gt;Enappd Blogs&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt; for more Awesome Blogs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Next Steps
&lt;/h3&gt;

&lt;p&gt;If you liked this blog, you will also find the following blogs interesting and helpful. Feel free to ask any questions in the comment section&lt;/p&gt;

&lt;h3&gt;
  
  
  Ionic Capacitor
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Basic&lt;/strong&gt;  — &lt;a href="https://enappd.com/blog/use-geolocation-geocoding-and-reverse-geocoding-in-ionic-capacitor/131"&gt;Geolocation&lt;/a&gt; | &lt;a href="https://enappd.com/blog/qr-code-and-barcode-scanning-with-ionic-capacitor/127"&gt;Barcode &amp;amp; QR code&lt;/a&gt; | &lt;a href="https://enappd.com/blog/facebook-login-in-capacitor-apps-with-ionic-angular/128"&gt;Facebook Login&lt;/a&gt; (Angular) | &lt;a href="https://enappd.com/blog/facebook-login-in-ionic-react-capacitor-apps/118"&gt;Facebook Login (React)&lt;/a&gt; | &lt;a href="https://enappd.com/blog/icon-splash-in-ionic-react-capacitor-apps/114"&gt;Icon and Splash&lt;/a&gt; | &lt;a href="https://enappd.com/blog/camera-and-gallery-in-ionic-react-app-using-capacitor/110"&gt;Camera &amp;amp; Photo Gallery&lt;/a&gt; | &lt;a href="https://enappd.com/blog/debugging-ionic-apps-using-chrome-and-safari-developers-tools/167"&gt;Debugging with browser&lt;/a&gt;|Theming in Ionic apps&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Advanced&lt;/strong&gt;  — &lt;a href="https://enappd.com/blog/implement-admob-in-ionic-react-capacitor-apps/135"&gt;AdMob&lt;/a&gt; | &lt;a href="https://enappd.com/blog/local-notifications-in-ionic-5-capacitor/132"&gt;Local Notifications&lt;/a&gt; | &lt;a href="https://enappd.com/blog/google-login-in-ionic-react-capacitor-apps/122"&gt;Google Login&lt;/a&gt; | &lt;a href="https://enappd.com/blog/twitter-login-in-ionic-react-capacitor-app/121"&gt;Twitter Login&lt;/a&gt; | &lt;a href="https://enappd.com/blog/html5-games-in-ionic-capacitor-using-phaser/115"&gt;Games using Phaser&lt;/a&gt; | &lt;a href="https://enappd.com/blog/play-music-in-ionic-capacitor-apps/112"&gt;Play music&lt;/a&gt; | &lt;a href="https://enappd.com/blog/firebase-push-notification-in-ionic-react-capacitor/111"&gt;Push Notifications&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Ionic Cordova
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://enappd.com/blog/ionic-app-with-nodejs-express-mysql-sequelize-taxi-app/160"&gt;Taxi Booking App example with Ionic, Node, Express and MySQL&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Ionic Payment Gateways — &lt;a href="https://enappd.com/blog/integrate-stripe-payment-gateway-in-ionic-5-apps-and-pwa-using-firebase/158"&gt;Stripe with Firebase&lt;/a&gt; | &lt;a href="https://enappd.com/blog/ionic-5-stripe-payment-integration-firebase-cloud-functions-vs-node-express-based-server/159"&gt;Stripe with NodeJS&lt;/a&gt; | &lt;a href="https://enappd.com/blog/paypal-integration-in-ionic-apps-and-pwa/142"&gt;PayPal&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-integrate-apple-pay-in-ionic-4-apps/21"&gt;Apple Pay&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-integrate-razorpay-in-ionic-4-apps-and-pwa/20"&gt;RazorPay&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Charts with — &lt;a href="https://enappd.com/blog/ionic-4-charts-using-google-charts/66"&gt;Google Charts&lt;/a&gt;| &lt;a href="https://enappd.com/blog/adding-charts-in-ionic-4-apps-and-pwa-part-3/60"&gt;HighCharts&lt;/a&gt; | &lt;a href="https://enappd.com/blog/adding-charts-in-ionic-4-apps-and-pwa-part-2/54"&gt;d3.js&lt;/a&gt; | &lt;a href="https://enappd.com/blog/charts-in-ionic-4-apps-and-pwa-part-1/52"&gt;Chart.js&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Authentications — &lt;a href="https://enappd.com/blog/firebase-email-authentication-in-ionic-apps/153"&gt;Via Email&lt;/a&gt; | &lt;a href="https://enappd.com/blog/implement-anonymous-login-in-ionic-apps-with-firebase/154"&gt;Anonymous&lt;/a&gt; | &lt;a href="https://enappd.com/blog/facebook-login-in-ionic-apps-using-firebase/150"&gt;Facebook&lt;/a&gt; | &lt;a href="https://enappd.com/blog/implement-google-login-in-ionic-apps-using-firebase/147"&gt;Google&lt;/a&gt; | &lt;a href="https://enappd.com/blog/twitter-login-in-ionic-4-apps-using-firebase/24"&gt;Twitter&lt;/a&gt; | &lt;a href="https://enappd.com/blog/firebase-phone-authentication-in-ionic-5-apps/169"&gt;Via Phone&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Features — &lt;a href="https://enappd.com/blog/ionic-5-complete-guide-on-geolocation/141"&gt;Geolocation&lt;/a&gt;| &lt;a href="https://enappd.com/blog/ionic-complete-guide-barcode-qrcode-scan/140"&gt;QR Code reader&lt;/a&gt; | &lt;a href="https://enappd.com/blog/best-fitness-plugins-for-ionic-4-how-to-use-pedometer/15"&gt;Pedometer&lt;/a&gt;| &lt;a href="https://enappd.com/blog/implement-signature-pad-in-ionic-apps/145"&gt;Signature&lt;/a&gt; &lt;a href="https://enappd.com/blog/implement-signature-pad-in-ionic-apps/145"&gt;Pad&lt;/a&gt; | &lt;a href="https://enappd.com/blog/using-background-geolocation-in-ionic-angular-apps/165"&gt;Background Geolocation&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Media in Ionic — &lt;a href="https://enappd.com/blog/spotify-like-music-in-ionic-4-apps/48"&gt;Audio&lt;/a&gt; | &lt;a href="https://enappd.com/blog/adding-video-player-in-ionic-4-app/64"&gt;Video&lt;/a&gt; | &lt;a href="https://enappd.com/blog/camera-and-image-picker-in-ionic-apps/148"&gt;Image Picker&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-add-image-cropper-in-ionic-apps/149"&gt;Image Cropper&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Essentials — &lt;a href="https://enappd.com/blog/debugging-ionic-apps-using-chrome-and-safari-developers-tools/167"&gt;Debugging with browser&lt;/a&gt;| &lt;a href="https://enappd.com/blog/ionic-4-save-and-retrieve-data-locally-on-device/59"&gt;Native Storage&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-translate-in-ionic-internationalization-and-localization/143"&gt;Translations&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-use-rtl-right-to-left-in-ionic-apps-pwa/152"&gt;RTL&lt;/a&gt; | &lt;a href="https://enappd.com/blog/using-sentry-error-monitoring-with-ionic-angular-applications/164"&gt;Sentry Error Monitoring&lt;/a&gt; | &lt;a href="https://enappd.com/blog/social-sharing-component-in-ionic-5-mobile-web-apps/168"&gt;Social sharing&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic messaging — &lt;a href="https://enappd.com/blog/how-to-implement-firebase-push-notifications-in-ionic-apps/157"&gt;Firebase Push&lt;/a&gt; | &lt;a href="https://enappd.com/blog/automatically-read-sms-in-ionic-4-apps/42"&gt;Reading SMS&lt;/a&gt; | &lt;a href="https://enappd.com/blog/local-notifications-in-ionic-5-capacitor/132"&gt;Local Notifications&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic with Firebase — &lt;a href="https://enappd.com/blog/how-to-integrate-firebase-in-ionic-4-apps/23"&gt;Basics&lt;/a&gt; | &lt;a href="https://enappd.com/blog/firebase-with-ionic-4-hosting-auth-and-db-connection/58"&gt;Hosting and DB&lt;/a&gt; | &lt;a href="https://enappd.com/blog/firebase-cloud-functions-in-ionic-5-complete-guide/166"&gt;Cloud functions&lt;/a&gt; | &lt;a href="https://enappd.com/blog/github-actions-deploying-ionic-angular-app-to-firebase-hosting/146"&gt;Deploy App to Firebase&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-use-firebase-emulators-with-ionic-angular-applications/163"&gt;Firebase simulator&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Unit Testing in Ionic — &lt;a href="https://enappd.com/blog/beginners-guide-to-ionic-angular-unit-testing-part-1/151"&gt;Part 1&lt;/a&gt; | &lt;a href="https://enappd.com/blog/beginners-guide-to-ionic-angular-unit-testing-part-2-mocks-and-spies/155"&gt;Mocks &amp;amp; Spies&lt;/a&gt;| &lt;a href="https://enappd.com/blog/beginners-guide-to-ionic-angular-unit-testing-async-testing/156"&gt;Async Testing&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Ionic React Full App with Capacitor
&lt;/h3&gt;

&lt;p&gt;If you need a base to start your next Ionic 5 React Capacitor app, you can make your next awesome app using &lt;a href="https://store.enappd.com/product/ionic-react-full-app-capacitor/"&gt;Ionic 5 React Full App in Capacitor&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VtnFDcof--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/760/1%2AG3yOFVX4oABx9MhUy-3kng.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VtnFDcof--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/760/1%2AG3yOFVX4oABx9MhUy-3kng.png" alt="Ionic 5 React Full App in Capacitor from Enappd" width="760" height="479"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Ionic Capacitor Full App (Angular)
&lt;/h3&gt;

&lt;p&gt;If you need a base to start your next Angular &lt;strong&gt;Capacitor app&lt;/strong&gt; , you can make your next awesome app using &lt;a href="https://store.enappd.com/product/capacitor-full-app-with-ionic-angular/"&gt;Capacitor Full App&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3CTfBLjg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/736/0%2AUwSHcofTMStMnzAX.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3CTfBLjg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/736/0%2AUwSHcofTMStMnzAX.png" alt="Capacitor Full App with huge number of layouts and features" width="736" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Ionic Full App (Angular and Cordova)
&lt;/h3&gt;

&lt;p&gt;If you need a base to start your next Ionic 5 app, you can make your next awesome app using &lt;a href="https://store.enappd.com/product/ionic-full-app"&gt;Ionic 5 Full App&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--g_hLq_eU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/700/0%2A1ArpKyhiDHZnevwB.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--g_hLq_eU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/700/0%2A1ArpKyhiDHZnevwB.jpeg" alt="Ionic Full App with huge number of layouts and features" width="700" height="442"&gt;&lt;/a&gt;&lt;/p&gt;




</description>
      <category>ionicframework</category>
      <category>androidappdevelopment</category>
      <category>deployment</category>
      <category>playstore</category>
    </item>
    <item>
      <title>PayPal Payment Integration using Braintree in Ionic 6 Vue app</title>
      <dc:creator>Vaibhav Gehani</dc:creator>
      <pubDate>Wed, 06 Jul 2022 02:57:04 +0000</pubDate>
      <link>https://dev.to/enappd/paypal-payment-integration-using-braintree-in-ionic-6-vue-app-51ik</link>
      <guid>https://dev.to/enappd/paypal-payment-integration-using-braintree-in-ionic-6-vue-app-51ik</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bRCX3WeV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2APvoz-L7aRm0JSd_7NuUq4A.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bRCX3WeV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2APvoz-L7aRm0JSd_7NuUq4A.png" alt="" width="880" height="293"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this tutorial, we will go through PayPal payment using Braintree in Ionic 6. Previously Paypal supported the &lt;a href="https://ionicframework.com/docs/native/paypal"&gt;Cordova PayPal Plugin&lt;/a&gt;, which is no more maintained by PayPal, hence it has issues while making payments using PayPal Login. PayPal now recommends using Braintree for mobile payments, while web payment still works fine with the generic PayPal JS script. You can read more about the web integration in our blog — &lt;a href="https://enappd.com/blog/paypal-integration-in-ionic-apps-and-pwa/142/"&gt;PayPal integration in Ionic PWA&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;For ease of development, it is recommended to have same payment method i.e. Braintree for both mobile and web, instead of PayPal for web and Braintree for mobile.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This type of integration requires a Backend (server) to generate tokens and the final transaction is also done by the server. For this tutorial, we will be using a Node JS server and will be calling APIs from the Ionic app using an HTTP client.&lt;/p&gt;

&lt;h3&gt;
  
  
  Steps to Implement PayPal Integration Using Braintree:-
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Create a Braintree sandbox account and get the required keys&lt;/li&gt;
&lt;li&gt;Setup Ionic 6 Vue project&lt;/li&gt;
&lt;li&gt;Setup Node JS project&lt;/li&gt;
&lt;li&gt;Creating Node JS APIs for Braintree&lt;/li&gt;
&lt;li&gt;Braintree/PayPal integration in an Ionic app using Node JS API’s&lt;/li&gt;
&lt;li&gt;Testing&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Before we proceed, a little bit about Ionic and Braintree&lt;/p&gt;

&lt;h3&gt;
  
  
  What is Braintree?
&lt;/h3&gt;

&lt;p&gt;Braintree offers a variety of products that make it easy for users to accept payments in their apps or website. Think of Braintree as the credit card terminal you swipe your card through at the grocery store. Braintree supports the following major types of payment methods&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ACH Direct Debit&lt;/li&gt;
&lt;li&gt;Apple Pay&lt;/li&gt;
&lt;li&gt;Google Pay&lt;/li&gt;
&lt;li&gt;PayPal&lt;/li&gt;
&lt;li&gt;Samsung Pay&lt;/li&gt;
&lt;li&gt;Credit / Debit cards&lt;/li&gt;
&lt;li&gt;Union Pay&lt;/li&gt;
&lt;li&gt;Venmo&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What is Ionic?
&lt;/h3&gt;

&lt;p&gt;Ionic framework is a mobile app framework, which supports other front-end frameworks like Angular, React, Vue, and Vanilla JS, and builds apps for both Android and iOS from the same code.&lt;/p&gt;

&lt;p&gt;If you create Native apps in Android, you code in Java. If you create Native apps in iOS, you code in Obj-C or Swift. Both of these are powerful but complex languages. &lt;strong&gt;With Ionic you can write a single piece of code for your app that can run on both iOS and Android&lt;/strong&gt; and web (as PWA), that too with the simplicity of HTML, CSS, and JS.&lt;/p&gt;

&lt;p&gt;It is important to note the contribution of Cordova/Capacitor in this. Ionic is only a UI wrapper made up of HTML, CSS, and JS. So, by default, Ionic cannot run as an app on an iOS or Android device. Cordova/Capacitor is the built environment that containerizes (sort of) this Ionic web app and converts it into a device installable app, along with providing this app access to native APIs like Camera, web access, etc.&lt;/p&gt;

&lt;h3&gt;
  
  
  Ionic and Payment Gateways
&lt;/h3&gt;

&lt;p&gt;Ionic can create a wide variety of apps, and hence a wide variety of payment gateways can be implemented in Ionic apps. The popular ones are PayPal, Stripe, Braintree, in-app purchases, etc. For more details on payment gateways, you can read our blogs on &lt;a href="https://medium.com/enappd/payment-solutions-in-ionic-8c4bb28ce5cc"&gt;Payment Gateway Solutions in Ionic&lt;/a&gt;, &lt;a href="https://enappd.com/blog/ionic-5-stripe-payment-integration-firebase-cloud-functions-vs-node-express-based-server/159"&gt;Stripe integration in Ionic&lt;/a&gt;, &lt;a href="https://enappd.com/blog/how-to-integrate-apple-pay-in-ionic-4-apps/21"&gt;Apple pay in Ionic&lt;/a&gt; etc.&lt;/p&gt;

&lt;p&gt;Also, there are different types of Ionic Apps you can build for the same functionality. The most popular ones are :&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Front-end: Angular | Build environment: Cordova&lt;/li&gt;
&lt;li&gt;Front-end: Angular | Build environment: Capacitor&lt;/li&gt;
&lt;li&gt;Front-end: React | Build environment: Capacitor&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Front-end: Vue | Build environment: Capacitor ✅&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;PayPal can be integrated into websites as well as mobile apps. In this blog, we’ll learn &lt;strong&gt;how to integrate the PayPal payment gateway in Vue/Capacitor Ionic 6 apps using Braintree.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;OK, enough of talking, let’s start building our PayPal Braintree Payment System.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pQTtbrst--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/480/1%2AueLYIFH8YFD0eIqKFY8Jgw.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pQTtbrst--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/480/1%2AueLYIFH8YFD0eIqKFY8Jgw.gif" alt="" width="480" height="284"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1 — Create Braintree sandbox account and get the required keys
&lt;/h3&gt;

&lt;p&gt;This step is required to proceed further, we will be needing several keys to integrate PayPal in the Ionic 6 app as well as in Node JS script. To get these keys to go to &lt;a href="https://sandbox.braintreegateway.com/login"&gt;Braintree Sandbox Account&lt;/a&gt;. Once you log in, you can go to settings and select API.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rrB30Jey--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A4Z_gnQyxm4qzSa1fszFVfA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rrB30Jey--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A4Z_gnQyxm4qzSa1fszFVfA.png" alt="" width="880" height="219"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the API section, scroll down and you will get the Required API key. We need three keys to initialize Braintree in Node JS scripts&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Merchant Id&lt;/li&gt;
&lt;li&gt;Public Key and&lt;/li&gt;
&lt;li&gt;Private Key&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JsnuoJmk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AQSv8L8ofyjBN6l-voJ3WMQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JsnuoJmk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AQSv8L8ofyjBN6l-voJ3WMQ.png" alt="" width="880" height="170"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dKH5Azzo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2Ac3hzrZdf94LcBV4CRPSYsA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dKH5Azzo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2Ac3hzrZdf94LcBV4CRPSYsA.png" alt="" width="880" height="289"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Save these IDs, we will use them in initializing the Braintree on the server-side.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2 — Set up the Ionic 6 project
&lt;/h3&gt;

&lt;p&gt;In this part, we will create and configure the Ionic 6 Vue Project and also set up a new Node JS Script.&lt;/p&gt;

&lt;h4&gt;
  
  
  Creating and configuring the Ionic 6 application.
&lt;/h4&gt;

&lt;p&gt;To create a new Ionic 6 project, run the below command:-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ ionic start PayPal --blank --type=vue
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This will create a blank app in the working directory and if you want to know more about creating the Ionic 6 project, go to &lt;a href="https://enappd.com/blog/introduction-to-ionic-vue-beginners-guide/176/"&gt;Ionic Vue Beginners Blog&lt;/a&gt;. Now once we have created the Ionic Vue app, we can configure the app for Braintree, to do that follow the below steps. Before that, you can install the Axios (that will be needing to call node server APIs) package using the below command:-&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ npm i axios
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;a) Mount CDN to Ionic Vue app in&lt;/strong&gt;  &lt;strong&gt;home.vue file&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
How will the Ionic app load Braintree? Currently, there is no Cordova or Capacitor plugin for Braintree. Hence we will add the CDN to the home file i.e. home.vue, below is the CDN for Braintree JavaScript SDK.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;script src="https://js.braintreegateway.com/js/braintree-2.32.1.min.js"&amp;gt;&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;By adding this SDK CDN, Braintree will be available throughout the application. Below is the method you can use to mount the CDN on home.vue page.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;createElement method will create an HTML component dynamically and we can add the src element (i.e. Braintree CDN). Once the script tag is loaded, then we have to initialize the Braintree setup using the event listener.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;b) Using Braintree variable in Ionic 6 application&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Once we mount the SDK CDN, we can use the Braintree variable on any page by using the below-defined syntax&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;declare const braintree;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Now in home.vue we can add this, we will use this variable to set up the Client-side application for successful payment.&lt;/p&gt;
&lt;h3&gt;
  
  
  Step 3 — Setup Node JS project
&lt;/h3&gt;

&lt;p&gt;Create a separate folder for the node server. To create a Node JS script, we will run &lt;strong&gt;npm init&lt;/strong&gt; in the working directory.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ npm init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The above command will ask a few basic questions and creates the package.json file in the working directory. Now you can create the index.js file (All logic will be contained in the index file because we’re making a simple server). Once you have run the above commands, the project structure will look like this&lt;/p&gt;

&lt;p&gt;We have to install some of the libraries that will help in implementing the node script. To install the libraries run the below command:-&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ npm install _cors express braintree body-parser_
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;To know more about &lt;a href="https://www.npmjs.com/package/cors"&gt;&lt;em&gt;cors&lt;/em&gt;&lt;/a&gt;, &lt;a href="https://www.npmjs.com/package/express"&gt;&lt;em&gt;express&lt;/em&gt;&lt;/a&gt;, &lt;a href="https://www.npmjs.com/package/body-parser"&gt;&lt;em&gt;body-parser&lt;/em&gt;&lt;/a&gt;, and &lt;a href="https://www.npmjs.com/package/braintree"&gt;&lt;em&gt;braintree&lt;/em&gt;&lt;/a&gt; you can follow the links. You can also check official &lt;a href="https://ionicframework.com/docs/troubleshooting/cors"&gt;Ionic documentation on CORS&lt;/a&gt; which we believe is very good for understanding.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mMIGBwN0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/291/1%2A1-_17l8nH7ybzjl8BD7RxA.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mMIGBwN0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/291/1%2A1-_17l8nH7ybzjl8BD7RxA.jpeg" alt="Project Structure" width="291" height="143"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Project Structure&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Now we have all the basic requirements to start our node script.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;  — Check your project’s package.json file, it should contain the value stated below in the scripts section. If it doesn’t, just add manually:-&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--l6vH7Oe0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/624/1%2AaueX2NUPIkFc-V1LCwNi7w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--l6vH7Oe0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/624/1%2AaueX2NUPIkFc-V1LCwNi7w.png" alt="package.json file" width="624" height="100"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Step 4 — Creating Express JS APIs for Braintree
&lt;/h3&gt;

&lt;p&gt;Creating Braintree APIs will allow us to get the &lt;strong&gt;Client ID&lt;/strong&gt; requested from the client-side. We will use the Braintree package to implement those APIs. First of all, import the Braintree using the below command in index.js file&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;_const_ braintree = require("braintree");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Now use the Braintree object to initialize the Braintree Gateway. This initialization requires those keys (which we have saved in step 2) and environment value (i.e. for now we are using &lt;strong&gt;&lt;em&gt;Sandbox&lt;/em&gt;&lt;/strong&gt; , later you can use production value). Use the below command to initialize the Gateway.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;_const_ gateway = new braintree.BraintreeGateway({
environment: braintree.Environment.Sandbox,
merchantId: "USE_YOUR_MERCHENT_ID",
publicKey: "USE_YOUR_PUBLIC_KEY",
privateKey: "USE_YOUR_PRIVATE_KEY"
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This Gateway object will be used to get the &lt;strong&gt;Client ID&lt;/strong&gt; and used in doing transactions.&lt;/p&gt;
&lt;h4&gt;
  
  
  Payment Flow with Braintree
&lt;/h4&gt;

&lt;p&gt;The following flowchart will get you up to speed with the payment flow. With this in mind, you’ll be able to better follow the code steps given further&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ENOq-O9S--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AkAd0KmHKlhYfMVmYrAxHPg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ENOq-O9S--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AkAd0KmHKlhYfMVmYrAxHPg.png" alt="" width="880" height="720"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;First, our Ionic application will call the Node JS API that will return the CLIENT ID generated using the API mentioned below:-&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;app.get("/brainTreeClientToken", (_req_, _res_) _=&amp;gt;_ {
 gateway.clientToken.generate({}).then((_response_) _=&amp;gt;_ {
  _console_.log('Token', response);
  res.send(response);
 });
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;‘/brainTreeClientToken’&lt;/strong&gt; API will be called from the Ionic app using &lt;a href="https://www.npmjs.com/package/axios"&gt;&lt;strong&gt;Axios&lt;/strong&gt;&lt;/a&gt; (later we will see in step 4). Once the client-side (Ionic app-side) gets the token it will set up the Braintree using the setup call (will see in step 4). After setup, the client will initiate payment using the Pay with PayPal button. Clicking the PayPal button will open In-App Browser and the sandbox will create a random user and provide info containing nonce (the token string used in making the transaction successful).&lt;/p&gt;

&lt;p&gt;For making transactions, we will create Node JS API that will checkout payment using amount and nonce. Below is the transaction API:-&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;app.post("/checkoutWithPayment", jsonParser, (_req_, _res_) _=&amp;gt;_ {
  _const_ nonceFromTheClient = req.body.nonceFromTheClient;
  _const_ payment = req.body.paymentAmount;
  gateway.transaction.sale({
   amount: payment,
   paymentMethodNonce: nonceFromTheClient,
   options: {
     submitForSettlement: true
   }
  }).then((_result_) _=&amp;gt;_ {
    res.send(result);
  });
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;In the above API &lt;strong&gt;nonceFromTheClient&lt;/strong&gt; and &lt;strong&gt;paymentAmount&lt;/strong&gt; will be passed through the Ionic 6 app and using the gateway object we will make a transaction. This will return a transaction status containing complete info about the customer, and payment and also contains the status of payment. This will complete the flow of payment using PayPal. Below is the complete script code:-&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In the above script, you can replace route it in app.listen with the port 3000 . So it becomes app.listen(3000,()=&amp;gt;...&lt;/li&gt;
&lt;li&gt;You can also create .catch for the .generate and .sale methods in the server. This way, if you get any error from the Braintree server, you will be able to see that in the node server terminal&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Run the server using npm start or if you want to deploy code to some cloud server you can do that as well. If you’re running the server in the local system, the APIs will have a localhost URL. You can test web payments directly in the local system. For phone payments, you might have to deploy the node server on a cloud.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5 — Braintree integration in Ionic Vue App using Node JS APIs
&lt;/h3&gt;

&lt;p&gt;In this part we will go through client-side (Ionic app) integration, using which we can make the PayPal transaction. We have seen how to initialize Braintree in the Ionic app (stated in step 2).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;declare const braintree
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The following method can be used to retrieve the client ID from the server. This method will be called during the Braintree setup.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;getClientTokenForPaypal(): Promise &amp;lt;_any_&amp;gt; {
  return new Promise((_resolve_) _=&amp;gt;_ { Axios.get('https://couponappserver.herokuapp.com/brainTreeClientToken').then((_res_) _=&amp;gt;_{
resolve(res.data);
  });
 })
},
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Now we can set up Braintree using the below code. &lt;strong&gt;Notice that the **&lt;/strong&gt;.setup is the function that defines for the first time that we are going to use PayPal as the payment gateway, using Braintree as the provider.**&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Keep in mind this setup will require the CLIENT_ID that will be generated by server API (mentioned in Step 3). So first we will call the server API and then pass the CLIENT_ID to setup method. You can call this function when page loads ( i.e. in mounted() method). In this case, we are calling this function once script is loaded to application&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;initializeBraintree() {
  _const_ that = this;
  this.getClientTokenForPaypal().then((_res_: _any_) _=&amp;gt;_ {
   _let_ checkout: _any_;
   braintree.setup(res.clientToken, 'custom', {
   paypal: {
    container: 'paypal-container',
   },
   onReady: _function_ (_integration_: _any_) {
    checkout = integration;
   },
   onCancelled: () _=&amp;gt;_ {
    checkout.teardown(() _=&amp;gt;_ { checkout = null });
   },
   onPaymentMethodReceived: (_obj_: _any_) _=&amp;gt;_ {
    checkout.teardown(() _=&amp;gt;_ {
      checkout = null;
      that.handleBraintreePayment(obj.nonce);
    });
   }
  });
});
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;In the above method, first, we call the getClientTokenForPaypal() the method that will call the Node JS server brainTreeClientToken API and returns the token. Once we get the client token, we can set up Braintree using it. This setup method will initialize the PayPal-container that will be used to render the PayPal button in HTML.&lt;/p&gt;

&lt;p&gt;Once the client token is obtained, the Paypal button will be automatically rendered in the HTML file in this place. Make sure you have this in your HTML file&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;ion-button class="paypalCss" id="paypal-container"&amp;gt;&amp;lt;/ion-button&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This will render the Paypal button in Page view and will look like the below screen :-&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1ilChhw7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/430/1%2AMvORSvPtD4H1XJWxH7aS-A.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1ilChhw7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/430/1%2AMvORSvPtD4H1XJWxH7aS-A.jpeg" alt="" width="430" height="54"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Paypal button rendered in Ionic HTML view after client ID is obtained&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Now we have completed the setup and we can make payment using this button. When we click the button it will open the In-app Browser and the sandbox will handle the payment and users info. This will return the nonce value in the callback defined in the setup call.&lt;/p&gt;

&lt;p&gt;One more thing we have to keep in mind is that sometimes, the PayPal payment screen does not go off when we make a payment (due to some screen refresh JavaScript issues). To remove it manually, we have to use the &lt;strong&gt;teardown()&lt;/strong&gt; method defined in the checkout variable (initialized on &lt;strong&gt;onReady()&lt;/strong&gt; callback).&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;onReady: _function_ (_integration_) {
checkout = integration;
},
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Below is the callback that will handle the nonce token and pass it on to another method that will handle the transaction.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;onPaymentMethodReceived: (_obj_) _=&amp;gt;_ {
checkout.teardown(() _=&amp;gt;_ {
checkout = null;
that.handleBraintreePayment(obj.nonce);
});
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;We will pass the nonce value to &lt;strong&gt;handleBraintreePayment()&lt;/strong&gt; method that will further call the transaction API defined in Node JS server. Here you can reinitialize the Braintree and show an alert after payment.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;handleBraintreePayment(_nonce_: _any_) {
  this.makePaymentRequest(this.paymentAmount,nonce)
  .then((_transaction_: _any_) _=&amp;gt;_ {
    this.initializeBraintree();
    this.showDoneAlert();
  })
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;The abovemakePaymentRequest()&lt;/strong&gt; method will call the transaction API defined in Node JS server, which will make the original payment using Braintree. Below is the function call:-&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;makePaymentRequest(_amount_: _any_, _nonce_: _any_): Promise &amp;lt;_any_&amp;gt; {
return new Promise((_resolve_) _=&amp;gt;_ {
_const_ paymentDetails = {
paymentAmount: amount,
nonceFromTheClient: nonce
}
Axios.post('https://couponappserver.herokuapp.com/checkoutWithPayment', paymentDetails)
.then((_res_) _=&amp;gt;_{
resolve(res.data);
});
});
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The above function will contain the &lt;strong&gt;paymentAmount&lt;/strong&gt; and &lt;strong&gt;nonce&lt;/strong&gt; value and will pass them to the server API. That will return the transaction object and we can decide the client end logic according to the response that we get from the server. This will complete the PayPal Braintree integration from both the client-side and server-side. Below is the complete Vue and ts file code:-&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;




&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h3&gt;
  
  
  Step 6 — Testing
&lt;/h3&gt;

&lt;p&gt;As mentioned earlier, it is easy to test this setup in a web domain, because the server can run on localhost, and the Ionic app can call the server while running with ionic serve . Here is how the payment flow looks&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BWJUKcpn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/485/1%2A-YE2LgNaTROcl-RbMYBNhg.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BWJUKcpn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/485/1%2A-YE2LgNaTROcl-RbMYBNhg.gif" alt="" width="485" height="650"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To test it on your device, you will need to deploy the server on a cloud so you can call the APIs from the app. If there is a way you can call localhost APIs from your app (I don’t know any), that should work as well!&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion:-
&lt;/h3&gt;

&lt;p&gt;Congratulations !! 🎉 You just learned how to integrate the awesome Braintree payment system to make payments using PayPal.&lt;/p&gt;

&lt;p&gt;You can make payments using both PayPal accounts and Debit / Credit Cards. This way of integration can work both in Web view and mobile apps. If you want to know more about any feature integration, you can check out our amazing tutorials at &lt;a href="https://enappd.com/blog/"&gt;Enappd Blogs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Happy coding!&lt;/p&gt;

&lt;h3&gt;
  
  
  Next Steps
&lt;/h3&gt;

&lt;p&gt;If you liked this blog, you will also find the following blogs interesting and helpful. Feel free to ask any questions in the comment section&lt;/p&gt;

&lt;h3&gt;
  
  
  Ionic Capacitor
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Basic&lt;/strong&gt;  — &lt;a href="https://enappd.com/blog/use-geolocation-geocoding-and-reverse-geocoding-in-ionic-capacitor/131"&gt;Geolocation&lt;/a&gt; | &lt;a href="https://enappd.com/blog/qr-code-and-barcode-scanning-with-ionic-capacitor/127"&gt;Barcode &amp;amp; QR code&lt;/a&gt; | &lt;a href="https://enappd.com/blog/facebook-login-in-capacitor-apps-with-ionic-angular/128"&gt;Facebook Login&lt;/a&gt; (Angular) | &lt;a href="https://enappd.com/blog/facebook-login-in-ionic-react-capacitor-apps/118"&gt;Facebook Login (React)&lt;/a&gt; | &lt;a href="https://enappd.com/blog/icon-splash-in-ionic-react-capacitor-apps/114"&gt;Icon and Splash&lt;/a&gt; | &lt;a href="https://enappd.com/blog/camera-and-gallery-in-ionic-react-app-using-capacitor/110"&gt;Camera &amp;amp; Photo Gallery&lt;/a&gt; | &lt;a href="https://enappd.com/blog/debugging-ionic-apps-using-chrome-and-safari-developers-tools/167"&gt;Debugging with browser&lt;/a&gt;|Theming in Ionic apps&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Advanced&lt;/strong&gt;  — &lt;a href="https://enappd.com/blog/implement-admob-in-ionic-react-capacitor-apps/135"&gt;AdMob&lt;/a&gt; | &lt;a href="https://enappd.com/blog/local-notifications-in-ionic-5-capacitor/132"&gt;Local Notifications&lt;/a&gt; | &lt;a href="https://enappd.com/blog/google-login-in-ionic-react-capacitor-apps/122"&gt;Google Login&lt;/a&gt; | &lt;a href="https://enappd.com/blog/twitter-login-in-ionic-react-capacitor-app/121"&gt;Twitter Login&lt;/a&gt; | &lt;a href="https://enappd.com/blog/html5-games-in-ionic-capacitor-using-phaser/115"&gt;Games using Phaser&lt;/a&gt; | &lt;a href="https://enappd.com/blog/play-music-in-ionic-capacitor-apps/112"&gt;Play music&lt;/a&gt; | &lt;a href="https://enappd.com/blog/firebase-push-notification-in-ionic-react-capacitor/111"&gt;Push Notifications&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Ionic Cordova
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://enappd.com/blog/ionic-app-with-nodejs-express-mysql-sequelize-taxi-app/160"&gt;Taxi Booking App example with Ionic, Node, Express and MySQL&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Ionic Payment Gateways — &lt;a href="https://enappd.com/blog/integrate-stripe-payment-gateway-in-ionic-5-apps-and-pwa-using-firebase/158"&gt;Stripe with Firebase&lt;/a&gt; | &lt;a href="https://enappd.com/blog/ionic-5-stripe-payment-integration-firebase-cloud-functions-vs-node-express-based-server/159"&gt;Stripe with NodeJS&lt;/a&gt; | &lt;a href="https://enappd.com/blog/paypal-integration-in-ionic-apps-and-pwa/142"&gt;PayPal&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-integrate-apple-pay-in-ionic-4-apps/21"&gt;Apple Pay&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-integrate-razorpay-in-ionic-4-apps-and-pwa/20"&gt;RazorPay&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Charts with — &lt;a href="https://enappd.com/blog/ionic-4-charts-using-google-charts/66"&gt;Google Charts&lt;/a&gt;| &lt;a href="https://enappd.com/blog/adding-charts-in-ionic-4-apps-and-pwa-part-3/60"&gt;HighCharts&lt;/a&gt; | &lt;a href="https://enappd.com/blog/adding-charts-in-ionic-4-apps-and-pwa-part-2/54"&gt;d3.js&lt;/a&gt; | &lt;a href="https://enappd.com/blog/charts-in-ionic-4-apps-and-pwa-part-1/52"&gt;Chart.js&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Authentications — &lt;a href="https://enappd.com/blog/firebase-email-authentication-in-ionic-apps/153"&gt;Via Email&lt;/a&gt; | &lt;a href="https://enappd.com/blog/implement-anonymous-login-in-ionic-apps-with-firebase/154"&gt;Anonymous&lt;/a&gt; | &lt;a href="https://enappd.com/blog/facebook-login-in-ionic-apps-using-firebase/150"&gt;Facebook&lt;/a&gt; | &lt;a href="https://enappd.com/blog/implement-google-login-in-ionic-apps-using-firebase/147"&gt;Google&lt;/a&gt; | &lt;a href="https://enappd.com/blog/twitter-login-in-ionic-4-apps-using-firebase/24"&gt;Twitter&lt;/a&gt; | &lt;a href="https://enappd.com/blog/firebase-phone-authentication-in-ionic-5-apps/169"&gt;Via Phone&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Features — &lt;a href="https://enappd.com/blog/ionic-5-complete-guide-on-geolocation/141"&gt;Geolocation&lt;/a&gt;| &lt;a href="https://enappd.com/blog/ionic-complete-guide-barcode-qrcode-scan/140"&gt;QR Code reader&lt;/a&gt; | &lt;a href="https://enappd.com/blog/best-fitness-plugins-for-ionic-4-how-to-use-pedometer/15"&gt;Pedometer&lt;/a&gt;| &lt;a href="https://enappd.com/blog/implement-signature-pad-in-ionic-apps/145"&gt;Signature&lt;/a&gt; &lt;a href="https://enappd.com/blog/implement-signature-pad-in-ionic-apps/145"&gt;Pad&lt;/a&gt; | &lt;a href="https://enappd.com/blog/using-background-geolocation-in-ionic-angular-apps/165"&gt;Background Geolocation&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Media in Ionic — &lt;a href="https://enappd.com/blog/spotify-like-music-in-ionic-4-apps/48"&gt;Audio&lt;/a&gt; | &lt;a href="https://enappd.com/blog/adding-video-player-in-ionic-4-app/64"&gt;Video&lt;/a&gt; | &lt;a href="https://enappd.com/blog/camera-and-image-picker-in-ionic-apps/148"&gt;Image Picker&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-add-image-cropper-in-ionic-apps/149"&gt;Image Cropper&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Essentials — &lt;a href="https://enappd.com/blog/debugging-ionic-apps-using-chrome-and-safari-developers-tools/167"&gt;Debugging with browser&lt;/a&gt;| &lt;a href="https://enappd.com/blog/ionic-4-save-and-retrieve-data-locally-on-device/59"&gt;Native Storage&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-translate-in-ionic-internationalization-and-localization/143"&gt;Translations&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-use-rtl-right-to-left-in-ionic-apps-pwa/152"&gt;RTL&lt;/a&gt; | &lt;a href="https://enappd.com/blog/using-sentry-error-monitoring-with-ionic-angular-applications/164"&gt;Sentry Error Monitoring&lt;/a&gt; | &lt;a href="https://enappd.com/blog/social-sharing-component-in-ionic-5-mobile-web-apps/168"&gt;Social sharing&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic messaging — &lt;a href="https://enappd.com/blog/how-to-implement-firebase-push-notifications-in-ionic-apps/157"&gt;Firebase Push&lt;/a&gt; | &lt;a href="https://enappd.com/blog/automatically-read-sms-in-ionic-4-apps/42"&gt;Reading SMS&lt;/a&gt; | &lt;a href="https://enappd.com/blog/local-notifications-in-ionic-5-capacitor/132"&gt;Local Notifications&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic with Firebase — &lt;a href="https://enappd.com/blog/how-to-integrate-firebase-in-ionic-4-apps/23"&gt;Basics&lt;/a&gt; | &lt;a href="https://enappd.com/blog/firebase-with-ionic-4-hosting-auth-and-db-connection/58"&gt;Hosting and DB&lt;/a&gt; | &lt;a href="https://enappd.com/blog/firebase-cloud-functions-in-ionic-5-complete-guide/166"&gt;Cloud functions&lt;/a&gt; | &lt;a href="https://enappd.com/blog/github-actions-deploying-ionic-angular-app-to-firebase-hosting/146"&gt;Deploy App to Firebase&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-use-firebase-emulators-with-ionic-angular-applications/163"&gt;Firebase simulator&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Unit Testing in Ionic — &lt;a href="https://enappd.com/blog/beginners-guide-to-ionic-angular-unit-testing-part-1/151"&gt;Part 1&lt;/a&gt; | &lt;a href="https://enappd.com/blog/beginners-guide-to-ionic-angular-unit-testing-part-2-mocks-and-spies/155"&gt;Mocks &amp;amp; Spies&lt;/a&gt;| &lt;a href="https://enappd.com/blog/beginners-guide-to-ionic-angular-unit-testing-async-testing/156"&gt;Async Testing&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Ionic React Full App with Capacitor
&lt;/h3&gt;

&lt;p&gt;If you need a base to start your next Ionic 5 React Capacitor app, you can make your next awesome app using &lt;a href="https://store.enappd.com/product/ionic-react-full-app-capacitor/"&gt;Ionic 5 React Full App in Capacitor&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VtnFDcof--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/760/1%2AG3yOFVX4oABx9MhUy-3kng.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VtnFDcof--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/760/1%2AG3yOFVX4oABx9MhUy-3kng.png" alt="Ionic 5 React Full App in Capacitor from Enappd" width="760" height="479"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Ionic Capacitor Full App (Angular)
&lt;/h3&gt;

&lt;p&gt;If you need a base to start your next Angular &lt;strong&gt;Capacitor app&lt;/strong&gt; , you can make your next awesome app using &lt;a href="https://store.enappd.com/product/capacitor-full-app-with-ionic-angular/"&gt;Capacitor Full App&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3CTfBLjg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/736/0%2AUwSHcofTMStMnzAX.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3CTfBLjg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/736/0%2AUwSHcofTMStMnzAX.png" alt="Capacitor Full App with huge number of layouts and features" width="736" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Ionic Full App (Angular and Cordova)
&lt;/h3&gt;

&lt;p&gt;If you need a base to start your next Ionic 5 app, you can make your next awesome app using &lt;a href="https://store.enappd.com/product/ionic-full-app"&gt;Ionic 5 Full App&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--g_hLq_eU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/700/0%2A1ArpKyhiDHZnevwB.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--g_hLq_eU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/700/0%2A1ArpKyhiDHZnevwB.jpeg" alt="Ionic Full App with huge number of layouts and features" width="700" height="442"&gt;&lt;/a&gt;&lt;/p&gt;




</description>
      <category>braintree</category>
      <category>vue</category>
      <category>ionic</category>
      <category>paypal</category>
    </item>
    <item>
      <title>Build Offline Ionic Angular 5 Applications</title>
      <dc:creator>Vaibhav Gehani</dc:creator>
      <pubDate>Wed, 29 Jun 2022 02:52:55 +0000</pubDate>
      <link>https://dev.to/enappd/build-offline-ionic-angular-5-applications-32f8</link>
      <guid>https://dev.to/enappd/build-offline-ionic-angular-5-applications-32f8</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IdCTVAp4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AaGE2hUVcPYAouCiXb6YfLg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IdCTVAp4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AaGE2hUVcPYAouCiXb6YfLg.png" alt="" width="880" height="293"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In mobile apps, we have come across many conditions in which, the rendered data (from the server) is the same most of the time but is repeatedly fetched from the server. This data fetching every time from the server is useless and a huge waste of data bandwidth. Another similar situation where we can’t even access the app is — when we call the sever with no network/internet then there will be NO_INTERNET error in the App.&lt;/p&gt;

&lt;p&gt;In such situations, we can customize the Ionic App, and manage the application when there is no internet. To do that we have to first recognize the status of the Network/Internet connection, and then perform online or offline logic.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why do you need offline Performance?
&lt;/h3&gt;

&lt;p&gt;Why do we need offline application performance ?? .. The Answer is to improve the user experience and maintain the state of the application properly, even with network fluctuations. As in today’s world, everything is dependent on the Internet and most applications won’t work if there is no Internet available. In some cases, it can, while in other cases we strictly need the Internet to perform some action. So the complete offline performance is dependent on your business logic. e.g If you have an online text editor it can let you type and edit after the initial loading of the document without any internet, but, for saving and other syncing features it will require internet.&lt;/p&gt;

&lt;h3&gt;
  
  
  Any drawbacks of Offline Performance?
&lt;/h3&gt;

&lt;p&gt;With many advantages, offline performance brings many challenges for the developers. As this brings unexpected things to happen like no proper syncing of offline database and online database, it will lead the application to the dead state. And one of the major points, User is unpredictable and can take any action — such an unhandled case can cause an inconsistent app state, so keep in mind while giving offline privileges to the user.&lt;/p&gt;

&lt;h3&gt;
  
  
  How do Ionic 5 Applications works offline?
&lt;/h3&gt;

&lt;p&gt;We will modify our Ionic application to have two major features, required for offline functionality:-&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Store the DB tables on the device's local storage&lt;/strong&gt; :- We will store some of the users and necessary information in the local storage (LocalStorage API, or any browser database). It will help us to operate the application offline as we have that data stored in local storage. This will resolve some of the problems that are less dependent on the Server. If your application has a very small database, you can sync all data of the user to phone storage. However, if you have large data of individual users, you can store data only for that session. This logic can be different for different apps, and one has to design the business logic accordingly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Store API calls in local storage&lt;/strong&gt; :- With data, we also store the APIs in local storage, we store APIs in such a way that it helps us recognize which API is completely served (i.e. response is received) and which one is left to be served. This helps us to make application flow more stable, as if there is no network available and we want to perform an HTTP POST request to our server then we store the API request in the local storage and will perform it later as soon as the network is available. e.g. Like syncing documents with an online database.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Implementing the Offline features in Ionic App :
&lt;/h3&gt;

&lt;p&gt;We will assume that you are already familiar with simple Ionic Angular apps, if not — do check our other blogs to learn about its setup. We will start with an already set up Ionic Angular application — and ionic commands will be used directly in the project root directory.&lt;/p&gt;

&lt;h4&gt;
  
  
  Network detection plugin
&lt;/h4&gt;

&lt;p&gt;The below command will install the packages and library required for network detection in the working Ionic project.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ ionic cordova plugin add cordova-plugin-network-information
$ npm install @ionic-native/network
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Using this command we will detect whether we have the network connection or not.&lt;/p&gt;
&lt;h4&gt;
  
  
  &lt;strong&gt;Maintaining user data in the local storage table&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Maintaining users' tables in local storage can give an illusion to the application - that the app is working in offline mode. So while login/registering, we will save the user's data in local storage and use that user's data everywhere we need in the application. Be sure not to store secure data like ca_rds_ and &lt;em&gt;passwords&lt;/em&gt; in the offline database.&lt;/p&gt;

&lt;p&gt;Before that, we have to install the &lt;strong&gt;cordova-sqlite-storage&lt;/strong&gt; plugin &amp;amp; &lt;strong&gt;@ionic/storage&lt;/strong&gt; in our project.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ ionic cordova plugin add cordova-sqlite-storage
$ npm install --save @ionic/storage
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The above command will install the storage plugin and package in the working project and now we have to Import &lt;em&gt;[Line 14, Line 19]&lt;/em&gt; and Inject the SQLite and N/W information module &lt;em&gt;[Line 31, Line 39]&lt;/em&gt; in &lt;strong&gt;app.module.ts&lt;/strong&gt;&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;In &lt;strong&gt;app.module.ts&lt;/strong&gt; , we have declared an &lt;strong&gt;APP_INITIALIZER&lt;/strong&gt; which basically runs the &lt;strong&gt;&lt;em&gt;load&lt;/em&gt;()&lt;/strong&gt; function (shown below in code) defined in the &lt;strong&gt;InitUserProvider&lt;/strong&gt; service file, during the initial load of the application (Before loading any components). This &lt;strong&gt;&lt;em&gt;load&lt;/em&gt;()&lt;/strong&gt; function will check if there is an existing user in the local storage (if any then set it as the &lt;strong&gt;&lt;em&gt;loggedInUser&lt;/em&gt;&lt;/strong&gt; ). It will be dependent on network status, if the network exists — then the User will be fetched from the server. And if there is no network, then localUser will be saved as &lt;strong&gt;loggedInUser&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;async load() {
  if (this.networkStatus) {
    const onlineUser = await this.api.getUserFromServer(this.userid)
    this.api.setLoggedInUser(onlineUser)
  }
  else {
    const localUser = await this.data.getStoredUserData();
    this.api.setLoggedInUser(localUser);
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;And during registering or login flow we can set the user in the local storage using the &lt;strong&gt;&lt;em&gt;setUserData&lt;/em&gt;&lt;/strong&gt; &lt;em&gt;()&lt;/em&gt; function defined in &lt;strong&gt;DataService&lt;/strong&gt; file &lt;strong&gt;(create data service file using the ionic generate service *path/filename*)&lt;/strong&gt;. You can add the below line in your existing login/register logic.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;await this.data.setUserData(userData);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;In the above line, &lt;strong&gt;&lt;em&gt;userData&lt;/em&gt;&lt;/strong&gt; is the user's data fetched from the server or any database. You must be wondering that we are fetching the data from the server then why is offline data saved here? Only at first login, we have to fetch the data from the server after that we simply use the local storage data, every time.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;Here in &lt;strong&gt;DataService&lt;/strong&gt; , we use the &lt;strong&gt;set&lt;/strong&gt; and &lt;strong&gt;get&lt;/strong&gt; methods of the storage module. This will store the data in &lt;strong&gt;key: value&lt;/strong&gt; pairs in the local storage. We are done with storing the data and now we can get the Data when the app is offline. To check whether the app is offline or online, we will use the Network module. Below is the code for &lt;strong&gt;&lt;em&gt;load&lt;/em&gt;&lt;/strong&gt; () function that will run when the app is initialized:-&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Here we first set the Network listener using &lt;strong&gt;checkInternetConnection method&lt;/strong&gt; &lt;em&gt;[Line 16]&lt;/em&gt; that will detect whether we have the network or not and on the basis of that we fetch the user's data from the server or from the local storage.&lt;/p&gt;

&lt;p&gt;You can modify the above code according to your app structure, as this code will help you to work offline with the user table.&lt;/p&gt;

&lt;h4&gt;
  
  
  Maintaining API Storage database
&lt;/h4&gt;

&lt;p&gt;In this section, we will explore how can we store the API calls in the local storage. We will define a procedure that will help our application to work in an offline manner, this procedure will help us to save the API data(if there is no network/internet) and call it later when the network is available. Overall we have 2 flows:-&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The Application does not have the network/Internet:-&lt;/strong&gt; In this flow, we will save the HTTP request(API — path and data) in the local storage and then make the HTTP request when network/Internet is available. And once the HTTP request is served, then we will set a &lt;strong&gt;completed&lt;/strong&gt; flag to true. This procedure will help us to store the API and later call that when the network is available.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Application has the Network/Internet:-&lt;/strong&gt; This will be the normal flow in which we have the network/internet. We first save the HTTP request(API) in local storage and make the HTTP request and make its completed flag to true. Remember we always store the HTTP request in local storage anyway, network is available or not, this makes flow easier to code.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JF8MonZz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A0mQGXI7WWw7mfrA9w8OCXw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JF8MonZz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A0mQGXI7WWw7mfrA9w8OCXw.png" alt="" width="880" height="473"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the above 2 flows, the initial steps are the same but further, they are divided into 2 parts that will be decided on the basis of the availability of the network. We will implement this logic in a separate service file i.e. &lt;strong&gt;API-manage&lt;/strong&gt; r (to create the service file run the below command)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ ionic generate service services/api-manager
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Once the above command is executed the service file will be added to the project, Now we can start to code our main logic:-&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AcDoQHSH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/490/1%2AZeYBlVyHQw9trIm4pwomGA.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AcDoQHSH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/490/1%2AZeYBlVyHQw9trIm4pwomGA.gif" alt="" width="490" height="294"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Below is the code for the API-Manager (we will explain it later):-&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;In the above code, we store and make the HTTP request using the &lt;strong&gt;&lt;em&gt;storeCallAndRespond()&lt;/em&gt;&lt;/strong&gt; function &lt;em&gt;[Line 96]&lt;/em&gt;. In this function, we simply store the API Request in a particular format mentioned below:-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;_const_ action: StoredRequest = {
  url: url,
  type: method,
  data: data ? data : null,
  time: new Date().getTime(),
  completed: false,
  response: null,
  header: header,
  id: Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 5)
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This Action object contains the parameters that will be used in making HTTP requests like &lt;em&gt;URL&lt;/em&gt;, &lt;em&gt;method&lt;/em&gt;(type), &lt;em&gt;completed&lt;/em&gt; flag, &lt;em&gt;response&lt;/em&gt; (set the response when an HTTP request is served), &lt;em&gt;headers&lt;/em&gt;, and the &lt;em&gt;unique Id&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Now we can set the API request using &lt;strong&gt;&lt;em&gt;storeRequest&lt;/em&gt;&lt;/strong&gt; () method that is defined in API-manager itself :-&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;storeRequest(_action_) {
  this.storage.get(environment.REQ_STORAGE_KEY).
  then((_storedOperation_) _=&amp;gt;_ {
    _let_ storedObj = JSON.parse(storedOperations);
   if (storedObj) {
    storedObj.push(action);
   } else {
    storedObj = [action];
 }
return this.storage.set(environment.REQ_STORAGE_KEY, JSON.stringify(storedObj));
});
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The above code will push the existing API request object (action) into the local storage DB. Till this point above two points have the same flow. Now onwards on the bases of network/internet availability, we will differentiate between the flow:- &lt;strong&gt;(further logic is contained inside the &lt;em&gt;repeatRequest&lt;/em&gt;() method)&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;async repeatRequest(_action_) {
  return new Promise(async (_resolve_, _reject_) _=&amp;gt;_ {
    _let_ response;
    if (!this.networkStatus) { &amp;lt;-- No Internet
    // No Internet
      resolve(action.data);
    } else { &amp;lt;-- Internet is working
    // Internet is there
      if (action.type === 'GET') {
        response = await this.http.request(action.type, action.url,
        {headers: action.header}).toPromise();
      } else {
        response = await this.http.request(
        action.type,
        action.url,
       {body: action.data, headers: action.header}
        ).toPromise();}
      this.updateActionObject(action, response);
      resolve(response);
     }
});
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;In this flow, we will first check whether the network/internet is available or not &lt;em&gt;[denoted in the above code using ←]&lt;/em&gt;, and if we have the network — we will make the HTTP request using the &lt;strong&gt;action&lt;/strong&gt; object and make that API stored Object’s( &lt;strong&gt;action&lt;/strong&gt; ) &lt;strong&gt;completed&lt;/strong&gt; flag &lt;em&gt;true&lt;/em&gt; and save the response in it.&lt;/p&gt;

&lt;p&gt;And if the app doesn’t have the network then we will simply resolve the promise and continue the UI flow, This procedure will make no change in UI rendering and the end-user will not feel like there is no internet/network. After this, once the network is back the flow will call the &lt;strong&gt;&lt;em&gt;checkForUnCompleteAPI&lt;/em&gt;&lt;/strong&gt; () method &lt;em&gt;[Line 1 in below Code]&lt;/em&gt; that will serve the uncalled(i.e. completed: false) HTTP request.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;The above code will check for the API request array in local storage and if any, then passes it to the &lt;strong&gt;&lt;em&gt;sendRequests&lt;/em&gt;&lt;/strong&gt; () method that will make the uncompleted HTTP request using the &lt;strong&gt;action&lt;/strong&gt;  object:-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sendRequests(_operations_: StoredRequest[]) {

_let_ obs = [];
_let_ oneObs;
for (_let_ op of operations) {
  if (!op.completed) {
  if (op.type === 'GET') {
   oneObs = this.http.request(op.type, op.url, {headers: op.header});
  } else {
   oneObs = this.http.request(op.type, op.url, {body: op.data, headers:
op.header});
  }
  _console_.log('Array res', oneObs);
  obs.push(oneObs);
 }
}
return forkJoin(obs);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above code will check for the &lt;strong&gt;completed&lt;/strong&gt; flag for each API request, and if the &lt;strong&gt;completed&lt;/strong&gt; flag is &lt;em&gt;false&lt;/em&gt; then make an HTTP request using the stored action object.&lt;/p&gt;

&lt;p&gt;This above-defined code (i.e. API-manager service) will be helpful when our UI is dependent on the API call but we do not have the network, then we store the API call in local storage with all its parameter and once the internet comes back then we try to make that HTTP request at that time.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to modify HTTP requests in the existing App?
&lt;/h3&gt;

&lt;p&gt;Now we will look at how we add this HTTP API logic to the existing application which earlier has direct API calls:-&lt;/p&gt;

&lt;p&gt;Where you have API calls (i.e. HTTP calls) in your application, there instead of directly making that HTTP call we will pass the required parameters to the &lt;strong&gt;&lt;em&gt;storeCallAndRespond()&lt;/em&gt;&lt;/strong&gt; function like below:-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;updateUser(_id_, _userData_): Promise &amp;lt;_any_&amp;gt; {
return new Promise(async (_resolve_, _reject_) _=&amp;gt;_ {
  _const_ response = await
  this.apiManager.storeCallAndRespond('PUT', ` `${this.url}/clients/${id}`, { Authorization: `JWT ${this.token}` }, userData);
  resolve(response);
 });
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We will pass the required HTTP options to the &lt;strong&gt;&lt;em&gt;storeCallAndRespond&lt;/em&gt;&lt;/strong&gt; () method &lt;em&gt;[Below Code]&lt;/em&gt; defined under API-manager. There are 3 arguments that are passed to &lt;strong&gt;&lt;em&gt;storeCallAndRespond()&lt;/em&gt;&lt;/strong&gt; method :- 1) Request Method. 2) Request URL. 3) Request Header&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;storeCallAndRespond(method, url, header, data?): Promise &amp;lt;any&amp;gt; {
  return new Promise(async (resolve, reject) =&amp;gt; {
    const action: StoredRequest = {
        url: url,
        type: method,
        data: data ? data : null,
        time: new Date().getTime(),
        completed: false,
        response: null,
        header: header,
        id: Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 5)
    };
   const Store = await this.storeRequest(action);
   this.repeatRequest(action).then((response) =&amp;gt; {
    console.log('Response', response);
    resolve(response);
   })
 });
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;In this tutorial, we have learned how we can covert our Ionic 5 application into an offline working application. So now you are ready to fit this feature in your existing or new application with ease. If you want to know more about different features and methods to handle any of the technology, just go to &lt;a href="https://enappd.com/blog/"&gt;&lt;strong&gt;Enappd Blogs Section&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Next Steps
&lt;/h3&gt;

&lt;p&gt;If you liked this blog, you will also find the following Ionic blogs interesting and helpful. Feel free to ask any questions in the comment section&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ionic Payment Gateways — &lt;a href="https://enappd.com/blog/ionic-4-stripe-payment-integration-with-firebase-for-apps-and-pwa/17"&gt;Stripe&lt;/a&gt; | &lt;a href="https://enappd.com/blog/ionic-4-paypal-payment-integration-for-apps-and-pwa/16"&gt;PayPal&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-integrate-apple-pay-in-ionic-4-apps/21"&gt;Apple Pay&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-integrate-razorpay-in-ionic-4-apps-and-pwa/20"&gt;RazorPay&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Charts with — &lt;a href="https://enappd.com/blog/ionic-4-charts-using-google-charts/66"&gt;Google Charts&lt;/a&gt;| &lt;a href="https://enappd.com/blog/adding-charts-in-ionic-4-apps-and-pwa-part-3/60"&gt;HighCharts&lt;/a&gt; | &lt;a href="https://enappd.com/blog/adding-charts-in-ionic-4-apps-and-pwa-part-2/54"&gt;d3.js&lt;/a&gt; | &lt;a href="https://enappd.com/blog/charts-in-ionic-4-apps-and-pwa-part-1/52"&gt;Chart.js&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Social Logins — &lt;a href="https://enappd.com/blog/facebook-login-in-ionic-4-apps-using-firebase/25"&gt;Facebook&lt;/a&gt; | &lt;a href="https://enappd.com/blog/google-login-in-ionic-4-apps-using-firebase/39"&gt;Google&lt;/a&gt; | &lt;a href="https://enappd.com/blog/twitter-login-in-ionic-4-apps-using-firebase/24"&gt;Twitter&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Authentications — &lt;a href="https://enappd.com/blog/email-authentication-with-firebase-in-ionic-4/38"&gt;Via Email&lt;/a&gt; | &lt;a href="https://enappd.com/blog/firebase-anonymous-login-in-ionic-4/37"&gt;Anonymous&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Features — &lt;a href="https://enappd.com/blog/using-geolocation-geocoding-and-reverse-geocoding-in-ionic-4/45"&gt;Geolocation&lt;/a&gt; | &lt;a href="https://enappd.com/blog/qr-code-scanning-and-optical-character-recognition-ocr-in-ionic-4/9"&gt;QR Code reader&lt;/a&gt;| &lt;a href="https://enappd.com/blog/best-fitness-plugins-for-ionic-4-how-to-use-pedometer/15"&gt;Pedometer&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Media in Ionic — &lt;a href="https://enappd.com/blog/spotify-like-music-in-ionic-4-apps/48"&gt;Audio&lt;/a&gt; | &lt;a href="https://enappd.com/blog/adding-video-player-in-ionic-4-app/64"&gt;Video&lt;/a&gt; | &lt;a href="https://enappd.com/blog/image-picker-in-ionic-4-app/67"&gt;Image Picker&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-add-image-cropper-in-ionic-4-app/68"&gt;Image Cropper&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Essentials — &lt;a href="https://enappd.com/blog/ionic-4-save-and-retrieve-data-locally-on-device/59"&gt;Native Storage&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-translate-in-ionic-4-globalization-internationalization-and-localization/11"&gt;Translations&lt;/a&gt; | &lt;a href="https://enappd.com/blog/rtl-right-to-left-use-in-ionic-4/50"&gt;RTL&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic messaging — &lt;a href="https://enappd.com/blog/implement-ionic-4-firebase-push/34"&gt;Firebase Push&lt;/a&gt; | &lt;a href="https://enappd.com/blog/automatically-read-sms-in-ionic-4-apps/42"&gt;Reading SMS&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic with Firebase — &lt;a href="https://enappd.com/blog/how-to-integrate-firebase-in-ionic-4-apps/23"&gt;Basics&lt;/a&gt; | &lt;a href="https://enappd.com/blog/firebase-with-ionic-4-hosting-auth-and-db-connection/58"&gt;Hosting and DB&lt;/a&gt; | &lt;a href="https://enappd.com/blog/firebase-cloud-functions-in-ionic-4-complete-guide/32"&gt;Cloud functions&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Ionic React Full App with Capacitor
&lt;/h3&gt;

&lt;p&gt;If you need a base to start your next Ionic 5 React Capacitor app, you can make your next awesome app using &lt;a href="https://store.enappd.com/product/ionic-react-full-app-capacitor/"&gt;Ionic 5 React Full App in Capacitor&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VtnFDcof--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/760/1%2AG3yOFVX4oABx9MhUy-3kng.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VtnFDcof--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/760/1%2AG3yOFVX4oABx9MhUy-3kng.png" alt="Ionic 5 React Full App in Capacitor from Enappd" width="760" height="479"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Ionic Capacitor Full App (Angular)
&lt;/h3&gt;

&lt;p&gt;If you need a base to start your next Angular &lt;strong&gt;Capacitor app&lt;/strong&gt; , you can make your next awesome app using &lt;a href="https://store.enappd.com/product/capacitor-full-app-with-ionic-angular/"&gt;Capacitor Full App&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3CTfBLjg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/736/0%2AUwSHcofTMStMnzAX.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3CTfBLjg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/736/0%2AUwSHcofTMStMnzAX.png" alt="Capacitor Full App with huge number of layouts and features" width="736" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Ionic Full App (Angular and Cordova)
&lt;/h3&gt;

&lt;p&gt;If you need a base to start your next Ionic 5 app, you can make your next awesome app using &lt;a href="https://store.enappd.com/product/ionic-full-app"&gt;Ionic 5 Full App&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--g_hLq_eU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/700/0%2A1ArpKyhiDHZnevwB.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--g_hLq_eU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/700/0%2A1ArpKyhiDHZnevwB.jpeg" alt="Ionic Full App with huge number of layouts and features" width="700" height="442"&gt;&lt;/a&gt;&lt;/p&gt;




</description>
      <category>hybridappdevelopment</category>
      <category>angular</category>
      <category>ionic</category>
      <category>cordovaplugin</category>
    </item>
    <item>
      <title>Integrating Ionic Vue Application with Firebase — Firestore CRUD operations</title>
      <dc:creator>Vaibhav Gehani</dc:creator>
      <pubDate>Sat, 25 Jun 2022 06:52:45 +0000</pubDate>
      <link>https://dev.to/enappd/integrating-ionic-vue-application-with-firebase-firestore-crud-operations-4c5h</link>
      <guid>https://dev.to/enappd/integrating-ionic-vue-application-with-firebase-firestore-crud-operations-4c5h</guid>
      <description>&lt;h3&gt;
  
  
  Integrating Ionic Vue Application with Firebase — Firestore CRUD operations
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AGLvqLae--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A8HepPqrsdvtFHopkRe9VSA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AGLvqLae--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A8HepPqrsdvtFHopkRe9VSA.png" alt="" width="880" height="293"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this tutorial, we will learn how we can integrate the Ionic Vue application with Firebase firestore and use basic database operations. Firebase is one of the best options to opt for when dealing with a small number of users (for unpaid versions). You can add a lot of things using Firebase like push notifications, database providers, authentication methods, Firebase functions, and many more.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is Ionic?
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Ionic&lt;/strong&gt; is a complete open-source SDK for hybrid mobile app development created by Max Lynch, Ben Sperry, and Adam Bradley of Drifty Co. in 2013. Ionic provides tools and services for developing hybrid mobile apps using Web technologies like CSS, HTML5, and Sass. Apps can be built with these Web technologies and then distributed through native app stores to be installed on devices.&lt;/p&gt;

&lt;p&gt;We can use Cordova or Capacitor to build these awesome apps and have native functionalities. With this, we get some amazing native plugins to use like Image cropper, Camera, and many more.&lt;/p&gt;

&lt;h3&gt;
  
  
  Capacitor — How is it different from Cordova?
&lt;/h3&gt;

&lt;p&gt;This section is relevant to only those who have been working with Ionic / Cordova for some time. Cordova has been the only choice available for Ionic app developers for quite some time. Cordova helps build an Ionic web app into a device installable app.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;Capacitor is very similar to Cordova, but with some key differences in the app workflow&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here are the differences between Cordova and Capacitor (You’ll appreciate these only if you have been using Cordova earlier, otherwise you can just skip)&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Capacitor considers each platform project a &lt;em&gt;source asset&lt;/em&gt; instead of a &lt;em&gt;build time asset&lt;/em&gt;. That means Capacitor wants you to keep the platform source code in the repository, unlike Cordova which always assumes that you will generate the platform code on build time&lt;/li&gt;
&lt;li&gt;Because of the above, Capacitor does not use config.xml a similar custom configuration for platform settings. Instead, configuration changes are made by editing AndroidManifest.xml for Android and Info.plist for Xcode&lt;/li&gt;
&lt;li&gt;Capacitor does not “run on device” or emulate through the command line. Instead, such operations occur through the platform-specific IDE. So you cannot run an Ionic-capacitor app using a command like ionic run ios . You will have to run iOS apps using Xcode, and Android apps using Android studio&lt;/li&gt;
&lt;li&gt;Since platform code is not a &lt;em&gt;source asset,&lt;/em&gt; you can directly change the native code using Xcode or Android Studio. This gives more flexibility to developers&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In essence, Capacitor is like a fresh, more flexible version of Cordova.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is Vue?
&lt;/h3&gt;

&lt;p&gt;Vue is a progressive framework for building user interfaces. Unlike other monolithic frameworks, Vue is designed from the ground up to be incrementally adoptable. The core library is focused on the view layer only, and is easy to pick up and integrate with other libraries or existing projects. On the other hand, Vue is also perfectly capable of powering sophisticated Single-Page Applications when used in combination with &lt;a href="https://vuejs.org/v2/guide/single-file-components.html"&gt;modern tooling&lt;/a&gt; and &lt;a href="https://github.com/vuejs/awesome-vue#components--libraries"&gt;supporting libraries&lt;/a&gt;. (If you want to know more about Ionic Vue then read Introduction to Ionic Vue Blog)&lt;/p&gt;

&lt;h3&gt;
  
  
  Firebase 🔥
&lt;/h3&gt;

&lt;p&gt;If you already know what is firebase — SKIP this section.&lt;/p&gt;

&lt;p&gt;Firebase is a popular Backend-as-a-Service (BaaS) platform. It started as a &lt;a href="http://blog.ycombinator.com/firebase-yc-s11-raises-5-dollars-dot-6m-series-a-from-union-square-ventures-and-flybridge"&gt;YC11 startup&lt;/a&gt; and grew up into a next-generation app-development platform on Google Cloud Platform. It is getting popular by the day because of the ease of integration and the variety of functionalities available on it.&lt;/p&gt;

&lt;p&gt;A lot of quick integrations are available with Firebase. Some of these are listed below:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Real-time Database 🗄️&lt;/li&gt;
&lt;li&gt;Firestore Database&lt;/li&gt;
&lt;li&gt;Email Authentication 📧&lt;/li&gt;
&lt;li&gt;Social logins📱&lt;/li&gt;
&lt;li&gt;In-app messages&lt;/li&gt;
&lt;li&gt;Push notifications&lt;/li&gt;
&lt;li&gt;Analytics 📊&lt;/li&gt;
&lt;li&gt;Crashlytics 💥&lt;/li&gt;
&lt;li&gt;Remote config&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Firebase is quickly growing to become the most popular mobile app back-end platform. And now we got an easy way to handle the firebase project by using the &lt;strong&gt;emulator&lt;/strong&gt;. You can be running a firebase project in the localhost rather than spending bucks on creating a cloud instance, It makes the work easy and clean. And If you want to know more about Firebase Emulator you can to &lt;a href="https://enappd.com/blog/how-to-use-firebase-emulators-with-ionic-angular-applications/163/"&gt;Firebase Emulator Blog&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Connect the Ionic Vue app with Firebase
&lt;/h3&gt;

&lt;p&gt;In this section, we will go through three steps :&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Set up the firebase project from the firebase console&lt;/li&gt;
&lt;li&gt;Create Ionic VueProject (integrate it with the firebase)&lt;/li&gt;
&lt;li&gt;At last, perform the CRUD operation in Cloud Firestore.&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Step — 1. Setting up firebase project:-&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Firstly we have to create a new Firebase project in &lt;a href="https://console.firebase.google.com/"&gt;firebase Console&lt;/a&gt;, then just click on &lt;strong&gt;&lt;em&gt;Add Project&lt;/em&gt;&lt;/strong&gt; and enter project details.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tJPTw3-F--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/914/1%2AfpCWNXgmZJh-X_JwWbRolQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tJPTw3-F--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/914/1%2AfpCWNXgmZJh-X_JwWbRolQ.png" alt="" width="880" height="481"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now once the firebase project is created then go to cloud firestore and create a firestore database. And keep in mind you should create the firestore database in test mode &lt;strong&gt;(Test mode enables the read, write, update and delete permission for everybody)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--c3gtKA9H--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/285/1%2AkZDN6bsEs_Yix3Hdpzqadg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--c3gtKA9H--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/285/1%2AkZDN6bsEs_Yix3Hdpzqadg.png" alt="" width="285" height="353"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we are ready to integrate the Firebase with the Ionic Vue, But we have to copy the Firebase Project Config so that we can use that in the Vue Project. To copy the config just go to &lt;em&gt;project settings&lt;/em&gt; and copy the firebase project. &lt;strong&gt;(We just want project Id)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--23WcTPkB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2Akci9NM0iQsdzv4E0n0oF4Q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--23WcTPkB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2Akci9NM0iQsdzv4E0n0oF4Q.png" alt="" width="880" height="390"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  2. Creating a new Ionic Vue Project and Integrating it with the Firebase project
&lt;/h4&gt;

&lt;p&gt;You can get the completed source code of the Ionic Vue Application &lt;a href="https://github.com/enappd/ionic-vue-firebase"&gt;HERE&lt;/a&gt;. And before Integrating we have to create a new Ionic Vue Project, To create a new Ionic project follow the below steps:-&lt;/p&gt;

&lt;p&gt;To create an Ionic Vue project, you have to follow the same steps as for Ionic react or angular. But keep in mind that you have the latest version of Ionic-cli as Vue is updated in the newer version (Ionic-cli V6.12.2 — At the time of blog). You can update ionic-cli using the below command:-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ npm install -g @ionic/cli
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Once the update is complete, Now we can create a new Ionic + Vue application. To create you can run the below command:-&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ ionic start firebaseVue blank --type vue
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The above command contains the &lt;strong&gt;name of the project&lt;/strong&gt; after that you can pass &lt;strong&gt;template&lt;/strong&gt; types like ‘blank’, ‘tabs’ to choose the layout of the Ionic Vue project. And at last, we have given &lt;strong&gt;vue&lt;/strong&gt; as the &lt;strong&gt;type of framework&lt;/strong&gt; to use. The command will take some time to create the project, and after that, a new project will be created in the working directory. We are done with creating a new Ionic Vue project, and now we will integrate it with Firebase.&lt;/p&gt;

&lt;p&gt;To integrate Ionic Vue with firebase, we have to install firebase in our project using the below command :&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install firebase
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Once the firebase is installed in Ionic Vue Project, we have to create the &lt;strong&gt;firebase-service.ts&lt;/strong&gt; file in the &lt;strong&gt;src&lt;/strong&gt; directory of the Vue Project. &lt;strong&gt;src&lt;/strong&gt; folder structure will look like this:-&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--n8F9s4cX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/216/1%2AEZ93ClRK0l7kFxlvM5QyUw.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--n8F9s4cX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/216/1%2AEZ93ClRK0l7kFxlvM5QyUw.jpeg" alt="" width="216" height="223"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;firebase-service.ts&lt;/strong&gt; will contain all of the logic related to firebase like initialization of the firebase project, query related logic. First, we will look at the initialization of the Firebase project in the Ionic Vue project.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;In the above code, we first import the installed firebase by using the import statement in &lt;strong&gt;firebase-service.ts&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import firebase from "firebase/app";

import "firebase/firestore";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Now we will use the firebase instance to initialize the firebase project using its &lt;strong&gt;initializeApp&lt;/strong&gt; () method. To initialize the firebase project, we have to use the &lt;strong&gt;projectID&lt;/strong&gt; (which we have copied from Firebase Config).&lt;/p&gt;

&lt;p&gt;You will also need Firebase CLI to use some of the Firebase commands. If you want to know more about how to install &lt;strong&gt;firebase/cli&lt;/strong&gt; you can go &lt;a href="https://firebase.google.com/docs/cli"&gt;here&lt;/a&gt; and check the requirements for your OS.&lt;/p&gt;

&lt;p&gt;You must be logged in to Firebase. (If not use the &lt;em&gt;firebase login&lt;/em&gt; command to login into your terminal, this command will work after installing firebase/cli)&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;_const_ db = firebase.initializeApp({
   projectId: ' **Your firebase projectID**'
}).firestore();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Now DB instance is created, we will use this DB instance to use the collections and docs in the cloud firestore. &lt;strong&gt;firebase-service.ts&lt;/strong&gt; exports the function that contains the sub-functions which perform the query-related logic. We have taken the example of READING the data from firestore collection. We will explain more in the next section.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;_const_ readFromFirebase = async (_collectionName_) _=&amp;gt;_ {
  _const_ FirebaseCollection = db.collection(collectionName);
  _const_ querySnapshot = await FirebaseCollection.get();
  _const_ result = querySnapshot.docs.map((_doc_: _any_) _=&amp;gt;_ {
  return {...doc.data()}
});
  return result;
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;In this code, &lt;strong&gt;db.collection(collectionName)&lt;/strong&gt; will create a instance of the collection/table. And we will use that instance to read the data from the table using &lt;strong&gt;&lt;em&gt;get&lt;/em&gt;&lt;/strong&gt; () method of the instance.&lt;/p&gt;
&lt;h4&gt;
  
  
  3. Adding CRUD operation using Cloud Firestore
&lt;/h4&gt;

&lt;p&gt;We have added the &lt;strong&gt;firebase-service.ts&lt;/strong&gt; file to the Vue project and initialized the firebase project. Now we will create the views using which we will perform the CRUD operations.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Create Operation:-&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To perform the CREATE operation, we will build a simple UI that will take the input as the &lt;em&gt;username&lt;/em&gt; and &lt;em&gt;password&lt;/em&gt;. The given input will be saved into the &lt;strong&gt;users&lt;/strong&gt; collection in the cloud firestore. We will use the &lt;strong&gt;Create.vue&lt;/strong&gt; file to perform the Create Operation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WMlqEhLv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/215/1%2AOf8D-tsINXcUlESpUDs6pg.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WMlqEhLv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/215/1%2AOf8D-tsINXcUlESpUDs6pg.jpeg" alt="" width="215" height="118"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once you create the &lt;strong&gt;Create.vue&lt;/strong&gt; file, we will add the UI and related Logic in the file. In the below code, we call the firebase-service &lt;strong&gt;createOperation() method&lt;/strong&gt; &lt;em&gt;[Line 68 in below code]&lt;/em&gt; with the User Object. The code is given as below, we will explain the firbase CRUD part later :&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;Above code UI will render like:-&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hos2imxy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/301/1%2Aa21aV_z15Hqww-4yb2JzLA.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hos2imxy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/301/1%2Aa21aV_z15Hqww-4yb2JzLA.jpeg" alt="" width="301" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the above code, we have created the two input fields (for &lt;em&gt;username&lt;/em&gt; and &lt;em&gt;password&lt;/em&gt;) and two buttons (for Saving Data and getting the List of Users). To perform the Create Operation, we have defined &lt;strong&gt;createOperation()&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;async createOperation() {
  _const_ userObject = {
    username: this.username,
    password: this.password
   }
  _console_.log('Data', this.username, this.password);
  _const_ UsersData = await firebaseService().createOperation('Users',
  userObject);
},
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;simply call the create operation() function defined in &lt;strong&gt;firebase-service.ts&lt;/strong&gt; file &lt;em&gt;(Created earlier in the blog)&lt;/em&gt; with &lt;strong&gt;collectionName&lt;/strong&gt; and &lt;strong&gt;userData&lt;/strong&gt; as the argument &lt;em&gt;[Line 68 in above code]&lt;/em&gt;. And in reading Operation (View Data Button) &lt;em&gt;[Line 29 in above code]&lt;/em&gt; navigate to ** Read.vue**&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Read Operation:-&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To perform the Read operation, add the &lt;strong&gt;Read.vue&lt;/strong&gt; file and show the list of users with update and delete buttons. Below is the Code for &lt;strong&gt;Read.vue&lt;/strong&gt; file which consists of the UI rendering and Read Operation related Logic.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;The above Code will render UI like this:-&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2FLAiqB6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/298/1%2AOTX-4RKcftp0YMkJZwD-IA.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2FLAiqB6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/298/1%2AOTX-4RKcftp0YMkJZwD-IA.jpeg" alt="" width="298" height="443"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The above code consists of &lt;strong&gt;created&lt;/strong&gt; () method &lt;em&gt;[Line 36 in above code]&lt;/em&gt; which is called as soon as the &lt;strong&gt;Read.vue&lt;/strong&gt; page is loaded into the DOM. So in this method, we will call the firebase-service’s method to GET/READ all the users in the &lt;strong&gt;Users&lt;/strong&gt; collection.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;created() {
  _const_ usersList = firebaseService().readOperation('Users');
  usersList.then((_data_: _any_) _=&amp;gt;_ {
  this.usersList = data;
  })
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Now we can render the list of users (i.e. this. &lt;strong&gt;usersList&lt;/strong&gt; ) using the ion-list, and will use the “ &lt;strong&gt;v-for&lt;/strong&gt; ” prop &lt;em&gt;[Line 10 in above code]&lt;/em&gt; to render it.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;ion-list&amp;gt;
  &amp;lt;ion-item v-for="(item, index) in usersList" :key="index"&amp;gt;
    {{ item.username }}
    &amp;lt;ion-button slot="end" @click="updateOperation(item, index)"&amp;gt;update&amp;lt;/ion-button&amp;gt;
    &amp;lt;ion-button slot="end" @click="deleteOperation(item, index)"&amp;gt;Delete&amp;lt;/ion-button&amp;gt;
  &amp;lt;/ion-item&amp;gt;
&amp;lt;/ion-list&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;3. Delete and Update Operation:-&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;And for delete operation, will call the &lt;strong&gt;&lt;em&gt;deleteOperation&lt;/em&gt;&lt;/strong&gt; () method (defined in firebase-service.ts) and pass in the &lt;strong&gt;collectionName&lt;/strong&gt; and users &lt;em&gt;username&lt;/em&gt; as the arguments.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;deleteOperation(_item_: _any_, _index_: _any_) {
  _console_.log(item);
  this.usersList.splice(index, 1);
  firebaseService().deleteOperation('Users', item.username);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;For Update Operation method &lt;em&gt;[Line 50 in read.vue file]&lt;/em&gt;, we just navigate to the Update.Vue page with users' username as the &lt;strong&gt;params&lt;/strong&gt; [passing {id: data.username}] using the router capability.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;async updateOperation(_item_: _any_, _index_: _any_) {
  _const_ data: _any_ = await firebaseService().findIdForDoc('Users', item.username);
  this.$router.push({name: 'Update', params: {id: data.username}})
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;4. Update Operation:-&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To perform the update operation, we just create &lt;strong&gt;Update.vue&lt;/strong&gt; file. And will add the updated page UI and query-related logic to it. Below is the code for the &lt;strong&gt;Update.Vue&lt;/strong&gt; file.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;The above code will render like this :-&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--i1P6VfJg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/302/1%2AL9ONaNUOwHdgg9Ez9cpk_A.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--i1P6VfJg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/302/1%2AL9ONaNUOwHdgg9Ez9cpk_A.jpeg" alt="" width="302" height="432"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We have passed the user's username from the &lt;strong&gt;Read.vue&lt;/strong&gt; file &lt;em&gt;[Line 54 in read.vue file]&lt;/em&gt;, And will get that in Update.Vue file using the props option. Now we can refer username as &lt;strong&gt;this.id&lt;/strong&gt; in the entire code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;props: ['id']
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Now to perform the update operation we define the &lt;strong&gt;&lt;em&gt;updateOperation&lt;/em&gt;&lt;/strong&gt; () method. And inside this function will call the &lt;strong&gt;&lt;em&gt;updateOperation&lt;/em&gt;&lt;/strong&gt; () method (defined in firebase-service file) and pass in the &lt;strong&gt;collectionName&lt;/strong&gt; and updated user data as the argument.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;async updateOperation() {
  _const_ updated = await firebaseService().updateOperation('Users', this.usersData);
  this.router.push('/read');
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Now we are done with all of the CRUD operations performed in Firebase collections. But to make this code work we have to change the router file defined in &lt;strong&gt;&lt;em&gt;router/index.ts&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;The above code will handle all the routes present in the Ionic Vue application, you can change your &lt;strong&gt;index.ts&lt;/strong&gt; file to this code. We have defined many firebase-service.ts functions on different pages. Below is the complete code for the &lt;strong&gt;firebase-service.ts&lt;/strong&gt; file.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;In this tutorial, we have learned how to integrate the Ionic Vue application with Firebase cloud Firestore and along with it learned about a few basics of the Ionic Vue App. You can get the Source Code of this Ionic Vue Application &lt;a href="https://github.com/enappd/ionic-vue-firebase"&gt;HERE&lt;/a&gt;. And if you want to know more about any of the technology or feature you can visit &lt;a href="https://enappd.com/blog/"&gt;Enappd Blogs&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Next Steps
&lt;/h3&gt;

&lt;p&gt;If you liked this blog, you will also find the following Ionic blogs interesting and helpful. Feel free to ask any questions in the comment section&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ionic Payment Gateways — &lt;a href="https://enappd.com/blog/ionic-4-stripe-payment-integration-with-firebase-for-apps-and-pwa/17"&gt;Stripe&lt;/a&gt; | &lt;a href="https://enappd.com/blog/ionic-4-paypal-payment-integration-for-apps-and-pwa/16"&gt;PayPal&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-integrate-apple-pay-in-ionic-4-apps/21"&gt;Apple Pay&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-integrate-razorpay-in-ionic-4-apps-and-pwa/20"&gt;RazorPay&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Charts with — &lt;a href="https://enappd.com/blog/ionic-4-charts-using-google-charts/66"&gt;Google Charts&lt;/a&gt;| &lt;a href="https://enappd.com/blog/adding-charts-in-ionic-4-apps-and-pwa-part-3/60"&gt;HighCharts&lt;/a&gt; | &lt;a href="https://enappd.com/blog/adding-charts-in-ionic-4-apps-and-pwa-part-2/54"&gt;d3.js&lt;/a&gt; | &lt;a href="https://enappd.com/blog/charts-in-ionic-4-apps-and-pwa-part-1/52"&gt;Chart.js&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Social Logins — &lt;a href="https://enappd.com/blog/facebook-login-in-ionic-4-apps-using-firebase/25"&gt;Facebook&lt;/a&gt; | &lt;a href="https://enappd.com/blog/google-login-in-ionic-4-apps-using-firebase/39"&gt;Google&lt;/a&gt; | &lt;a href="https://enappd.com/blog/twitter-login-in-ionic-4-apps-using-firebase/24"&gt;Twitter&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Authentications — &lt;a href="https://enappd.com/blog/email-authentication-with-firebase-in-ionic-4/38"&gt;Via Email&lt;/a&gt; | &lt;a href="https://enappd.com/blog/firebase-anonymous-login-in-ionic-4/37"&gt;Anonymous&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Features — &lt;a href="https://enappd.com/blog/using-geolocation-geocoding-and-reverse-geocoding-in-ionic-4/45"&gt;Geolocation&lt;/a&gt; | &lt;a href="https://enappd.com/blog/qr-code-scanning-and-optical-character-recognition-ocr-in-ionic-4/9"&gt;QR Code reader&lt;/a&gt;| &lt;a href="https://enappd.com/blog/best-fitness-plugins-for-ionic-4-how-to-use-pedometer/15"&gt;Pedometer&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Media in Ionic — &lt;a href="https://enappd.com/blog/spotify-like-music-in-ionic-4-apps/48"&gt;Audio&lt;/a&gt; | &lt;a href="https://enappd.com/blog/adding-video-player-in-ionic-4-app/64"&gt;Video&lt;/a&gt; | &lt;a href="https://enappd.com/blog/image-picker-in-ionic-4-app/67"&gt;Image Picker&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-add-image-cropper-in-ionic-4-app/68"&gt;Image Cropper&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Essentials — &lt;a href="https://enappd.com/blog/ionic-4-save-and-retrieve-data-locally-on-device/59"&gt;Native Storage&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-translate-in-ionic-4-globalization-internationalization-and-localization/11"&gt;Translations&lt;/a&gt; | &lt;a href="https://enappd.com/blog/rtl-right-to-left-use-in-ionic-4/50"&gt;RTL&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic messaging — &lt;a href="https://enappd.com/blog/implement-ionic-4-firebase-push/34"&gt;Firebase Push&lt;/a&gt; | &lt;a href="https://enappd.com/blog/automatically-read-sms-in-ionic-4-apps/42"&gt;Reading SMS&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic with Firebase — &lt;a href="https://enappd.com/blog/how-to-integrate-firebase-in-ionic-4-apps/23"&gt;Basics&lt;/a&gt; | &lt;a href="https://enappd.com/blog/firebase-with-ionic-4-hosting-auth-and-db-connection/58"&gt;Hosting and DB&lt;/a&gt; | &lt;a href="https://enappd.com/blog/firebase-cloud-functions-in-ionic-4-complete-guide/32"&gt;Cloud functions&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Ionic React Full App with Capacitor
&lt;/h3&gt;

&lt;p&gt;If you need a base to start your next Ionic 5 React Capacitor app, you can make your next awesome app using &lt;a href="https://store.enappd.com/product/ionic-react-full-app-capacitor/"&gt;Ionic 5 React Full App in Capacitor&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VtnFDcof--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/760/1%2AG3yOFVX4oABx9MhUy-3kng.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VtnFDcof--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/760/1%2AG3yOFVX4oABx9MhUy-3kng.png" alt="Ionic 5 React Full App in Capacitor from Enappd" width="760" height="479"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Ionic Capacitor Full App (Angular)
&lt;/h3&gt;

&lt;p&gt;If you need a base to start your next Angular &lt;strong&gt;Capacitor app&lt;/strong&gt; , you can make your next awesome app using &lt;a href="https://store.enappd.com/product/capacitor-full-app-with-ionic-angular/"&gt;Capacitor Full App&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3CTfBLjg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/736/0%2AUwSHcofTMStMnzAX.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3CTfBLjg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/736/0%2AUwSHcofTMStMnzAX.png" alt="Capacitor Full App with huge number of layouts and features" width="736" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Ionic Full App (Angular and Cordova)
&lt;/h3&gt;

&lt;p&gt;If you need a base to start your next Ionic 5 app, you can make your next awesome app using &lt;a href="https://store.enappd.com/product/ionic-full-app"&gt;Ionic 5 Full App&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--g_hLq_eU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/700/0%2A1ArpKyhiDHZnevwB.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--g_hLq_eU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/700/0%2A1ArpKyhiDHZnevwB.jpeg" alt="Ionic Full App with huge number of layouts and features" width="700" height="442"&gt;&lt;/a&gt;&lt;/p&gt;




</description>
      <category>firestore</category>
      <category>ionic</category>
      <category>vue</category>
      <category>firebase</category>
    </item>
    <item>
      <title>Integrating Ionic 5 Application with kommunicate Bot</title>
      <dc:creator>Vaibhav Gehani</dc:creator>
      <pubDate>Sat, 18 Jun 2022 05:39:17 +0000</pubDate>
      <link>https://dev.to/enappd/integrating-ionic-5-application-with-kommunicate-bot-4i87</link>
      <guid>https://dev.to/enappd/integrating-ionic-5-application-with-kommunicate-bot-4i87</guid>
      <description>&lt;h3&gt;
  
  
  Integrating Ionic 5 Application with Kommunicate Bot
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LtbZE5P8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A8TrXg0LcxQj5gCcuN0xqtw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LtbZE5P8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A8TrXg0LcxQj5gCcuN0xqtw.png" alt="" width="880" height="293"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Integration of a Bot with the mobile application is one of the most interesting topics we have written on. Many of the developers need to integrate a Bot with the apps for proper handling of customers. Bots can help us reduce staff requirements.&lt;/p&gt;

&lt;p&gt;You &lt;strong&gt;could&lt;/strong&gt; integrate a customer support &lt;strong&gt;chatbot&lt;/strong&gt; in your business to cater to simple queries of customers and pass on only the complex queries to customer support agents. Humans react to others based on their moods and emotions, so bots can’t completely replace humans. But can improve the overall efficiency of response.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JkXFuVck--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/480/1%2AuQQeQf3ccmLaPB80Mx617g.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JkXFuVck--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/480/1%2AuQQeQf3ccmLaPB80Mx617g.gif" alt="" width="480" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this tutorial, we will integrate the &lt;strong&gt;Kommunicate&lt;/strong&gt; bot service with the &lt;strong&gt;Ionic 5 Angular&lt;/strong&gt; application and we can facilitate the user with some prebuild or custom builds Bots using &lt;a href="https://www.kommunicate.io/"&gt;&lt;strong&gt;kommunicate.io&lt;/strong&gt;&lt;/a&gt; &lt;strong&gt;.&lt;/strong&gt; First, create an account on this service, and keep that credential with you as it will help you to integrate the Bot.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is Kommunicate.io?
&lt;/h3&gt;

&lt;p&gt;Kommunicate is the intelligent chat-based support, which provides you the bots or the custom chat windows where you can provide support to your customers. Kommunicate provides the complete solution, As it provides the dashboard which can help us to look at the stats of support we have provided.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hGjNRhjE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2ApF6PXaa3Xx0ezi6LkoTZHw.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hGjNRhjE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2ApF6PXaa3Xx0ezi6LkoTZHw.jpeg" alt="" width="880" height="445"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The dashboard shows the &lt;strong&gt;Incoming / Open / Resolved&lt;/strong&gt; Conversations, that have been done with the customers. This platform also works as a team management tool, it helps us to assign the conversations between the teammates (i.e. if you use customer support, not the bot service). Below is the &lt;strong&gt;&lt;em&gt;Conversations Tab&lt;/em&gt;&lt;/strong&gt; :-&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BFTfRHoc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A5KNjySQUSIKOGROdUNt8Vw.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BFTfRHoc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A5KNjySQUSIKOGROdUNt8Vw.jpeg" alt="" width="880" height="518"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The above is a &lt;em&gt;Resolved Conversation&lt;/em&gt; that has been initially assigned to ChatBot and later handled by Human. We have the option that helps us to include both ChatBot and human support. Using this Platform we can list the users which are using the chat services or logged in to the applications. Below is the Users tab:-&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AtwOQu-d--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2ASXCCHnRs7BDW446Ivvkjog.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AtwOQu-d--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2ASXCCHnRs7BDW446Ivvkjog.png" alt="" width="880" height="498"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The above Users tab helps us to manage the conversations of the User by assigning them to the teammates. And now the most interesting part of our blog is here, we will configure the prebuild Kompose Bots. Below is the Bot Integration Tab:-&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0i9Wb0b5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AkDFWZdol7WRUoqMbpSVjSQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0i9Wb0b5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AkDFWZdol7WRUoqMbpSVjSQ.png" alt="" width="880" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can configure the prebuild bot using &lt;strong&gt;Kompose. I&lt;/strong&gt; f you want to integrate your own Bot — one can be built using IBM Watson or Amazon Lex or any other Bot service. For this tutorial, we will configure our prebuild Bot using Kompose. In the below steps, we will configure the Kompose Bot:-&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1:- Initialize your Kompose Bot and enter the basic details:-&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GO0ri-Hr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/689/1%2Au0G8yiHup4QVXGJVlav0EA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GO0ri-Hr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/689/1%2Au0G8yiHup4QVXGJVlav0EA.png" alt="" width="689" height="565"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the first steps, we will give a name to our bot with an awesome avatar and we can choose a speaking language for our Bot. Once you save and proceed then you will be asked a question &lt;strong&gt;“Should bot hand off the conversation to a human team member when it is unable to recognize any user query”.&lt;/strong&gt; For now, we will disable this feature:-&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WcSFHOLD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/685/1%2Afs7nk6a1HdWJ0FXCzufZXg.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WcSFHOLD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/685/1%2Afs7nk6a1HdWJ0FXCzufZXg.jpeg" alt="" width="685" height="359"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Our Basic setup is complete and we will proceed to the advanced setup of Bot like questioning and answering of Bot with Customers. Using Kompose we can set up the Bot in 4 parts:-&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Welcome Message:-&lt;/strong&gt; This is the first part in which we provide the bot with the inviting/welcoming message. The great part is that we can suggest the reply option to the Customers. So that they don’t have to type.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FLNJKtin--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/636/1%2AHUk426VajbAnSy83UbrTKQ.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FLNJKtin--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/636/1%2AHUk426VajbAnSy83UbrTKQ.jpeg" alt="" width="636" height="398"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.&lt;/strong&gt;  &lt;strong&gt;Setting up questions and answers:-&lt;/strong&gt; We can design our own questions and answers that our Bot can face by the customers. And you can also add buttons or texts so that users can reply easily by clicking buttons. You can design any number of questions and answers you want so that the bot can answer more and more questions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--b2aWp_cK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A77IHRWIUKrINitMDkDCJ2g.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--b2aWp_cK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A77IHRWIUKrINitMDkDCJ2g.jpeg" alt="" width="880" height="388"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.&lt;/strong&gt;  &lt;strong&gt;Setting Response on Unknown User Input:-&lt;/strong&gt; You can set a common response for all unmatched Customer Input. To that, you have to simply add up the response in the below tab:-&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UNvfRpEp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2ASGkGpqkOuBj-C9J8ts5GtQ.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UNvfRpEp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2ASGkGpqkOuBj-C9J8ts5GtQ.jpeg" alt="" width="880" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now your awesome Bot is all ready to respond to all of the customer queries, if you want to configure more you can do that by adding more questions and features to it. Finally, you will get your &lt;strong&gt;&lt;em&gt;Bot ID&lt;/em&gt;&lt;/strong&gt; (that will be used in our application) in the &lt;strong&gt;&lt;em&gt;Manage Bot&lt;/em&gt;&lt;/strong&gt;  Tab:-&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rKpxhKYx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/920/1%2AnDL1fJnggGl5Lh1tiCPedQ.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rKpxhKYx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/920/1%2AnDL1fJnggGl5Lh1tiCPedQ.jpeg" alt="" width="880" height="249"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we can start integrating our Bot with the Ionic 5 Angular application using some plugins and packages.&lt;/p&gt;

&lt;h3&gt;
  
  
  Integrating kommunicate Bot with Ionic Application
&lt;/h3&gt;

&lt;p&gt;To integrate the Ionic 5 application with Kommunicate, we have to first install the packages and plugins that are required in this procedure. To install the packages run the below commands:-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ ionic cordova plugin add kommunicate-cordova-plugin
$ npm install @ionic- **native** /kommunicate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;And if you are using a capacitor you can this plugin by running the below command:-&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ npm **install** kommunicate-cordova- **plugin** 
$ npx cap **sync** 
$ npm **install** @ionic- **native** /kommunicate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Now once the packages and plugins are installed, now we have to grab our &lt;strong&gt;APP_ID&lt;/strong&gt; from &lt;a href="https://dashboard.kommunicate.io/settings/install"&gt;&lt;strong&gt;Kommunicate Dashboard&lt;/strong&gt;&lt;/a&gt;. APP_ID is a unique application ID assigned to your Kommunicate account — remember, APP_ID is different from BOT_ID. You can have many BOT_IDs in 1 account. Finally, we start to Code our own ChatBot.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--b-T2Pewl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/400/1%2A7vE2W-7vRa16-LBzdJxOmA.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--b-T2Pewl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/400/1%2A7vE2W-7vRa16-LBzdJxOmA.gif" alt="" width="400" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So first of all we will Import &lt;em&gt;[Line 9]&lt;/em&gt; and Inject &lt;em&gt;[Line 20]&lt;/em&gt; the Kommunicate Module in the &lt;strong&gt;app.module.ts&lt;/strong&gt; file under the Providers:-&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;We will move to the Home page, where we will implement our main Logic.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;There are two ways the bot can be integrated:- (First under the difference b/w these two methods)&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The Different between above two methods :-&lt;/p&gt;

&lt;p&gt;First method only have Chat Support (Human to Human interaction), Chat window is provided by the Kommunicate Plugin and Admin can interact with App users through Kommunicate Dashboard.&lt;/p&gt;

&lt;p&gt;In Second, we included a Bot (Human to Bot interaction), where we created a Bot in Kommunicate Dashboard and trained it by some question and answers.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The Custom Chat Window:-&lt;/strong&gt; In this part, a normal chat window is generated by the Kommunicate Module using which the App Admin and Customer will interact (&lt;strong&gt;i.e. the Customer will write up through the Chat window, and App Provider/Owner will reply through Kommunicate dashboard)&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This method is more of a &lt;strong&gt;Support Chat window only&lt;/strong&gt; , where humans is interacting with humans. One side is handled by Admin (using Kommunicate Dashboard) and another side is handled by Application User. &lt;strong&gt;&lt;em&gt;[There is no interaction with Bot]&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now First Import &lt;em&gt;[Line 3]&lt;/em&gt; &lt;strong&gt;Kommunicate Module&lt;/strong&gt; to the &lt;strong&gt;Home Page&lt;/strong&gt; and then Inject &lt;em&gt;[Line 20]&lt;/em&gt; it into the Page. At this place the APP_ID (i.e. we have copied from Dashboard).&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;In the above code, we have used the &lt;strong&gt;APP_ID&lt;/strong&gt; &lt;em&gt;[Line 15]&lt;/em&gt; and LoggedIn user data to start the custom conversation with the Owner. By calling the &lt;strong&gt;&lt;em&gt;initateBot&lt;/em&gt;&lt;/strong&gt; () function &lt;em&gt;[Line 22]&lt;/em&gt; the Chat Window will launch up and you can interact with the App Provider/Owner.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PEVQ3Pmr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/300/1%2AlRLbfqVz8vWpnmvhfrwB9A.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PEVQ3Pmr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/300/1%2AlRLbfqVz8vWpnmvhfrwB9A.png" alt="" width="300" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Above the screen is the Chat Window screen with Custom chat, where customers can chat with the Humans executives. And executives can respond from the Kommunicate Dashboard like below:-&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MWMnL0fu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AS05Y2wCXP1CJFnkc2i80Bw.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MWMnL0fu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AS05Y2wCXP1CJFnkc2i80Bw.jpeg" alt="" width="880" height="522"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And keep in mind that, you must save the &lt;strong&gt;clientKey (response from conversationBuilder Function &lt;em&gt;[Line 25 in home.page.ts]&lt;/em&gt;)&lt;/strong&gt;in the Database or in local storage so that the chat window can be initiated with the same user data. Here &lt;strong&gt;Client Key&lt;/strong&gt; is unique for every user that logs in and chats with Admin. And that’s it for the custom chat window.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. The ChatBot Window:-&lt;/strong&gt; In this chat window we will interact with our own Awesome chatBot that we have created through Kompose. To integrate that we have made a few changes to the above Home PageCode.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;The only change that has been done is in the Configuration &lt;em&gt;[Line 18]&lt;/em&gt; (i.e. change in &lt;strong&gt;conversationObject&lt;/strong&gt; ). In this, we have used the &lt;strong&gt;botId&lt;/strong&gt; attribute that will help us to include our ChatBot in chat windows. You can change the &lt;strong&gt;botId&lt;/strong&gt; to change the Bot used in the Application.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SGvhC-db--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/300/1%2Amey1vDqrG8_RT0JbAa2vpw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SGvhC-db--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/300/1%2Amey1vDqrG8_RT0JbAa2vpw.png" alt="" width="300" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I have tested My &lt;strong&gt;Botiya Bot&lt;/strong&gt; in place of Awesome Bot, You can test any of your bots by changing the BotIds. And If you want to take over / hand off your Bot and assign it to your teammate you can do it from the dashboard Conversations section.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9JBlA2Sq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AXmvK2HN1WSUQTQdt_qjNhg.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9JBlA2Sq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AXmvK2HN1WSUQTQdt_qjNhg.jpeg" alt="" width="880" height="516"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There we can assign the Bot chat to a teammate by switching between the assign to tag. So that's it, this way you can easily integrate your ChatBot with your Ionic 5 application.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;So In this tutorial, we have learned how we can integrate ChatBot with our Ionic 5 application. Now you can add this feature to your awesome application which will benefit you in many ways and your Customers will be happy with your services. If you want to explore more about other features, you can go to our &lt;a href="https://enappd.com/blog/"&gt;&lt;strong&gt;&lt;em&gt;Blogs&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Next Steps
&lt;/h3&gt;

&lt;p&gt;If you liked this blog, you will also find the following Ionic blogs interesting and helpful. Feel free to ask any questions in the comment section&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ionic Payment Gateways — &lt;a href="https://enappd.com/blog/ionic-4-stripe-payment-integration-with-firebase-for-apps-and-pwa/17"&gt;Stripe&lt;/a&gt; | &lt;a href="https://enappd.com/blog/ionic-4-paypal-payment-integration-for-apps-and-pwa/16"&gt;PayPal&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-integrate-apple-pay-in-ionic-4-apps/21"&gt;Apple Pay&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-integrate-razorpay-in-ionic-4-apps-and-pwa/20"&gt;RazorPay&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Charts with — &lt;a href="https://enappd.com/blog/ionic-4-charts-using-google-charts/66"&gt;Google Charts&lt;/a&gt;| &lt;a href="https://enappd.com/blog/adding-charts-in-ionic-4-apps-and-pwa-part-3/60"&gt;HighCharts&lt;/a&gt; | &lt;a href="https://enappd.com/blog/adding-charts-in-ionic-4-apps-and-pwa-part-2/54"&gt;d3.js&lt;/a&gt; | &lt;a href="https://enappd.com/blog/charts-in-ionic-4-apps-and-pwa-part-1/52"&gt;Chart.js&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Social Logins — &lt;a href="https://enappd.com/blog/facebook-login-in-ionic-4-apps-using-firebase/25"&gt;Facebook&lt;/a&gt; | &lt;a href="https://enappd.com/blog/google-login-in-ionic-4-apps-using-firebase/39"&gt;Google&lt;/a&gt; | &lt;a href="https://enappd.com/blog/twitter-login-in-ionic-4-apps-using-firebase/24"&gt;Twitter&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Authentications — &lt;a href="https://enappd.com/blog/email-authentication-with-firebase-in-ionic-4/38"&gt;Via Email&lt;/a&gt; | &lt;a href="https://enappd.com/blog/firebase-anonymous-login-in-ionic-4/37"&gt;Anonymous&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Features — &lt;a href="https://enappd.com/blog/using-geolocation-geocoding-and-reverse-geocoding-in-ionic-4/45"&gt;Geolocation&lt;/a&gt; | &lt;a href="https://enappd.com/blog/qr-code-scanning-and-optical-character-recognition-ocr-in-ionic-4/9"&gt;QR Code reader&lt;/a&gt;| &lt;a href="https://enappd.com/blog/best-fitness-plugins-for-ionic-4-how-to-use-pedometer/15"&gt;Pedometer&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Media in Ionic — &lt;a href="https://enappd.com/blog/spotify-like-music-in-ionic-4-apps/48"&gt;Audio&lt;/a&gt; | &lt;a href="https://enappd.com/blog/adding-video-player-in-ionic-4-app/64"&gt;Video&lt;/a&gt; | &lt;a href="https://enappd.com/blog/image-picker-in-ionic-4-app/67"&gt;Image Picker&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-add-image-cropper-in-ionic-4-app/68"&gt;Image Cropper&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Essentials — &lt;a href="https://enappd.com/blog/ionic-4-save-and-retrieve-data-locally-on-device/59"&gt;Native Storage&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-translate-in-ionic-4-globalization-internationalization-and-localization/11"&gt;Translations&lt;/a&gt; | &lt;a href="https://enappd.com/blog/rtl-right-to-left-use-in-ionic-4/50"&gt;RTL&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic messaging — &lt;a href="https://enappd.com/blog/implement-ionic-4-firebase-push/34"&gt;Firebase Push&lt;/a&gt; | &lt;a href="https://enappd.com/blog/automatically-read-sms-in-ionic-4-apps/42"&gt;Reading SMS&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic with Firebase — &lt;a href="https://enappd.com/blog/how-to-integrate-firebase-in-ionic-4-apps/23"&gt;Basics&lt;/a&gt; | &lt;a href="https://enappd.com/blog/firebase-with-ionic-4-hosting-auth-and-db-connection/58"&gt;Hosting and DB&lt;/a&gt; | &lt;a href="https://enappd.com/blog/firebase-cloud-functions-in-ionic-4-complete-guide/32"&gt;Cloud functions&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Ionic React Full App with Capacitor
&lt;/h3&gt;

&lt;p&gt;If you need a base to start your next Ionic 5 React Capacitor app, you can make your next awesome app using &lt;a href="https://store.enappd.com/product/ionic-react-full-app-capacitor/"&gt;Ionic 5 React Full App in Capacitor&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VtnFDcof--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/760/1%2AG3yOFVX4oABx9MhUy-3kng.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VtnFDcof--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/760/1%2AG3yOFVX4oABx9MhUy-3kng.png" alt="Ionic 5 React Full App in Capacitor from Enappd" width="760" height="479"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Ionic Capacitor Full App (Angular)
&lt;/h3&gt;

&lt;p&gt;If you need a base to start your next Angular &lt;strong&gt;Capacitor app&lt;/strong&gt; , you can make your next awesome app using &lt;a href="https://store.enappd.com/product/capacitor-full-app-with-ionic-angular/"&gt;Capacitor Full App&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3CTfBLjg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/736/0%2AUwSHcofTMStMnzAX.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3CTfBLjg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/736/0%2AUwSHcofTMStMnzAX.png" alt="Capacitor Full App with huge number of layouts and features" width="736" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Ionic Full App (Angular and Cordova)
&lt;/h3&gt;

&lt;p&gt;If you need a base to start your next Ionic 5 app, you can make your next awesome app using &lt;a href="https://store.enappd.com/product/ionic-full-app"&gt;Ionic 5 Full App&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--g_hLq_eU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/700/0%2A1ArpKyhiDHZnevwB.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--g_hLq_eU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/700/0%2A1ArpKyhiDHZnevwB.jpeg" alt="Ionic Full App with huge number of layouts and features" width="700" height="442"&gt;&lt;/a&gt;&lt;/p&gt;




</description>
      <category>kommunicate</category>
      <category>angular</category>
      <category>hybridappdevelopment</category>
      <category>chatbots</category>
    </item>
    <item>
      <title>Understanding Monorepos and implementing it.</title>
      <dc:creator>Vaibhav Gehani</dc:creator>
      <pubDate>Fri, 22 Apr 2022 05:56:04 +0000</pubDate>
      <link>https://dev.to/enappd/understanding-monorepos-and-implementing-it-51mf</link>
      <guid>https://dev.to/enappd/understanding-monorepos-and-implementing-it-51mf</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Xq30fcW---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AnpNptLEbsf7nU6K7MYCY6Q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Xq30fcW---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AnpNptLEbsf7nU6K7MYCY6Q.png" alt="" width="880" height="293"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this tutorial, we will understand &lt;strong&gt;what Monorepos are?&lt;/strong&gt; and &lt;strong&gt;how to make a monorepo&lt;/strong&gt;. We are not going to discuss various monorepo management software in this blog, and just leave this blog as an introduction to the term.&lt;/p&gt;

&lt;p&gt;Now you must be wondering &lt;strong&gt;&lt;em&gt;what is this mono repo?&lt;/em&gt;&lt;/strong&gt;  &lt;strong&gt;&lt;em&gt;why this is used?&lt;/em&gt;&lt;/strong&gt;  &lt;strong&gt;&lt;em&gt;How this can be helpful in development and deployment?&lt;/em&gt;&lt;/strong&gt; We will cover each and every query related to monorepo.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;When we say ‘repo’ we are considering a repository of code. Like a GitHub repo&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  What is Monorepos?
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Monorepos&lt;/em&gt;&lt;/strong&gt; are the combined repository of different entities of the project/company. You must be familiar with multi repos (i.e. Single Repos for each entity of the project), these combined multi repos under a single repo can be called monorepo.&lt;/p&gt;

&lt;p&gt;Monorepos are sometimes hard to handle but due to a single point of dependencies these mono repo help to contribute more to the projects and generate common codes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Monorepos should be used?
&lt;/h3&gt;

&lt;p&gt;If you have any project containing an Android app, iOS app, and dashboard then managing all of them together will be difficult. All these entities will have different repos, will have their separate dependencies, and will be deployed separately. So to manage such cases properly, monorepos are introduced. All of the project entities are under a single repository. Maintaining single repo have the following advantage:-&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Single Source of Code:-&lt;/strong&gt; As different components of projects are under a single repository. So mono repo is the single source of code — which can be shared among the collaborators easily.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Consistency:-&lt;/strong&gt; Monorepos maintains the code quality standards. Quality of complete repo is maintained as developers can get ideas of coding standards from another subproject. Also common config files for &lt;em&gt;Linting&lt;/em&gt; and other clean code mechanisms.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Easier management of dependencies:-&lt;/strong&gt; All modules required by the different sub-projects are maintained under a single repo, we can reuse the same library in many projects. Also updating the dependency in each project can be easier.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Single Contribution:-&lt;/strong&gt; All developer contributes under a single repository and it would help the developer to contribute more.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Identical Coding/Directory style:-&lt;/strong&gt; This helps to achieve good code quality. Coding style can be identified as a developer can access other projects also.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Improve cross-team collaboration:-&lt;/strong&gt; Here In this several developers can contribute to different projects. Developers can fix bugs for each other as the code base is the same for all.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The above points lead to good collaboration and code can be easily shared, so monorepos have the advantage in some cases. Many of the Big Tech Giants have the mono repos like Google, Microsoft, and many others.&lt;/p&gt;

&lt;h3&gt;
  
  
  When Monorepos should not be used?
&lt;/h3&gt;

&lt;p&gt;Sometimes monorepo is like a blessing but sometimes it is a curse 😂 . In some cases handling monorepos becomes complex as the repository size becomes larger, then it's hard to manage.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Affected Master Branch:-&lt;/strong&gt; If in case the master branch breaks, then it's hard to manage the project. It can destroy the project and lead to a state where we have to go for some alternative.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hard to Understand CodeBase:-&lt;/strong&gt; It's sometimes hard to understand the code base for new developers, as all the projects are under a single repository.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A larger amount of data:-&lt;/strong&gt; Adding all the projects under a single repository will tremendously increase the size of the repo. This may affect the processing speed, build times and also affects the cost of storage.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Code Reviewing:-&lt;/strong&gt; Large number of pull requests and code reviews generated by each project could affect other project developers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Exposure of Code:-&lt;/strong&gt; Monorepos contains all the projects under a single repository. If two teams are working on different projects (Under the same repo) and want to hide their code — they can’t. This could not be achieved in monorepos.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  How to Create Monorepos?
&lt;/h3&gt;

&lt;p&gt;To implement monorepos, we simply have to move the different project repos under one project folder. In this tutorial, we will take two different projects like 1) React-Native and 2) Ionic Project. Here you can have multiple projects with different languages/technologies. The project structure will look like below: -&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sgnqkovW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/959/1%2A9mHRO82aIzz0JsoV1INBEg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sgnqkovW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/959/1%2A9mHRO82aIzz0JsoV1INBEg.png" alt="" width="880" height="203"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;These two projects further have their own project structure. like the first project is &lt;strong&gt;IONIC&lt;/strong&gt; Framework project and the second is React-Native Project. Let's consider both are part of the single Business Project.&lt;/p&gt;

&lt;p&gt;Now to add this monorepo to &lt;em&gt;Github&lt;/em&gt;, we need to run some git commands. But you must have &lt;em&gt;Git&lt;/em&gt; installed in your system. (if already installed it's Great, if not go to &lt;a href="https://git-scm.com/downloads"&gt;&lt;em&gt;Git Downloads&lt;/em&gt;&lt;/a&gt;). Now run the below command to initialize the &lt;em&gt;Git&lt;/em&gt; in your local project.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ git init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now to add this monorepo to Github, we need to create the repository in &lt;a href="https://github.com/"&gt;&lt;em&gt;Github.com&lt;/em&gt;&lt;/a&gt;. Once you have created the repository, you can run the below command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ git add .
$ git commit -m "Monorepo commit"
$ git remote add origin &amp;lt;your_repo_url&amp;gt;
$ git push origin master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you will see that your monorepo contains both of your projects. Developers can contribute to any of the projects and can keep the Coding style the same for a complete Business project.&lt;/p&gt;

&lt;h3&gt;
  
  
  Is that all?
&lt;/h3&gt;

&lt;p&gt;No, monorepos concepts are evolving and many software are coming for managing the monorepos. &lt;a href="https://lerna.js.org/"&gt;Lerna&lt;/a&gt; and &lt;a href="https://nx.dev/"&gt;Nx&lt;/a&gt; are very popular these days. This kind of software manage monorepos in many ways :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You can explore the code structure properly&lt;/li&gt;
&lt;li&gt;You can only build/test from what is affected in code&lt;/li&gt;
&lt;li&gt;You can manage dependency management&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We will learn about these in upcoming blogs, this blog just serves as an introduction to the monorepos trend.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Now you know enough about monorepos. You can decide if you want to use the monorepos for your Project implementation or not. According to me if your project needs many similar codebases which can have similar dependencies, then you must try the monorepos. They are easy to maintain and improve the developers' contribution.&lt;/p&gt;

&lt;h3&gt;
  
  
  Next Steps
&lt;/h3&gt;

&lt;p&gt;If you liked this blog, you will also find the following blogs interesting and helpful. Feel free to ask any questions in the comment section&lt;/p&gt;

&lt;h4&gt;
  
  
  Ionic Capacitor
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Basic&lt;/strong&gt;  — &lt;a href="https://enappd.com/blog/use-geolocation-geocoding-and-reverse-geocoding-in-ionic-capacitor/131"&gt;Geolocation&lt;/a&gt; | &lt;a href="https://enappd.com/blog/qr-code-and-barcode-scanning-with-ionic-capacitor/127"&gt;Barcode &amp;amp; QR code&lt;/a&gt; | &lt;a href="https://enappd.com/blog/facebook-login-in-capacitor-apps-with-ionic-angular/128"&gt;Facebook Login&lt;/a&gt; (Angular) | &lt;a href="https://enappd.com/blog/facebook-login-in-ionic-react-capacitor-apps/118"&gt;Facebook Login (React)&lt;/a&gt; | &lt;a href="https://enappd.com/blog/icon-splash-in-ionic-react-capacitor-apps/114"&gt;Icon and Splash&lt;/a&gt; | &lt;a href="https://enappd.com/blog/camera-and-gallery-in-ionic-react-app-using-capacitor/110"&gt;Camera &amp;amp; Photo Gallery&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Advanced&lt;/strong&gt;  — &lt;a href="https://enappd.com/blog/implement-admob-in-ionic-react-capacitor-apps/135"&gt;AdMob&lt;/a&gt; | &lt;a href="https://enappd.com/blog/local-notifications-in-ionic-5-capacitor/132"&gt;Local Notifications&lt;/a&gt; | &lt;a href="https://enappd.com/blog/google-login-in-ionic-react-capacitor-apps/122"&gt;Google Login&lt;/a&gt; | &lt;a href="https://enappd.com/blog/twitter-login-in-ionic-react-capacitor-app/121"&gt;Twitter Login&lt;/a&gt; | &lt;a href="https://enappd.com/blog/html5-games-in-ionic-capacitor-using-phaser/115"&gt;Games using Phaser&lt;/a&gt; | &lt;a href="https://enappd.com/blog/play-music-in-ionic-capacitor-apps/112"&gt;Play music&lt;/a&gt; | &lt;a href="https://enappd.com/blog/firebase-push-notification-in-ionic-react-capacitor/111"&gt;Push Notifications&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Ionic Cordova
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://enappd.com/blog/ionic-app-with-nodejs-express-mysql-sequelize-taxi-app/160"&gt;Taxi Booking App example with Ionic, Node, Express and MySQL&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Ionic Payment Gateways — &lt;a href="https://enappd.com/blog/integrate-stripe-payment-gateway-in-ionic-5-apps-and-pwa-using-firebase/158"&gt;Stripe with Firebase&lt;/a&gt; | &lt;a href="https://enappd.com/blog/ionic-5-stripe-payment-integration-firebase-cloud-functions-vs-node-express-based-server/159"&gt;Stripe with NodeJS&lt;/a&gt; | &lt;a href="https://enappd.com/blog/paypal-integration-in-ionic-apps-and-pwa/142"&gt;PayPal&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-integrate-apple-pay-in-ionic-4-apps/21"&gt;Apple Pay&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-integrate-razorpay-in-ionic-4-apps-and-pwa/20"&gt;RazorPay&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Charts with — &lt;a href="https://enappd.com/blog/ionic-4-charts-using-google-charts/66"&gt;Google Charts&lt;/a&gt;| &lt;a href="https://enappd.com/blog/adding-charts-in-ionic-4-apps-and-pwa-part-3/60"&gt;HighCharts&lt;/a&gt; | &lt;a href="https://enappd.com/blog/adding-charts-in-ionic-4-apps-and-pwa-part-2/54"&gt;d3.js&lt;/a&gt; | &lt;a href="https://enappd.com/blog/charts-in-ionic-4-apps-and-pwa-part-1/52"&gt;Chart.js&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Authentications — &lt;a href="https://enappd.com/blog/firebase-email-authentication-in-ionic-apps/153"&gt;Via Email&lt;/a&gt; | &lt;a href="https://enappd.com/blog/implement-anonymous-login-in-ionic-apps-with-firebase/154"&gt;Anonymous&lt;/a&gt; | &lt;a href="https://enappd.com/blog/facebook-login-in-ionic-apps-using-firebase/150"&gt;Facebook&lt;/a&gt; | &lt;a href="https://enappd.com/blog/implement-google-login-in-ionic-apps-using-firebase/147"&gt;Google&lt;/a&gt; | &lt;a href="https://enappd.com/blog/twitter-login-in-ionic-4-apps-using-firebase/24"&gt;Twitter&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Features — &lt;a href="https://enappd.com/blog/ionic-5-complete-guide-on-geolocation/141"&gt;Geolocation&lt;/a&gt;| &lt;a href="https://enappd.com/blog/ionic-complete-guide-barcode-qrcode-scan/140"&gt;QR Code reader&lt;/a&gt; | &lt;a href="https://enappd.com/blog/best-fitness-plugins-for-ionic-4-how-to-use-pedometer/15"&gt;Pedometer&lt;/a&gt;| &lt;a href="https://enappd.com/blog/implement-signature-pad-in-ionic-apps/145"&gt;Signature&lt;/a&gt; Pad | &lt;a href="https://enappd.com/blog/using-background-geolocation-in-ionic-angular-apps/165"&gt;Background Geolocation&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Media in Ionic — &lt;a href="https://enappd.com/blog/spotify-like-music-in-ionic-4-apps/48"&gt;Audio&lt;/a&gt; | &lt;a href="https://enappd.com/blog/adding-video-player-in-ionic-4-app/64"&gt;Video&lt;/a&gt; | &lt;a href="https://enappd.com/blog/camera-and-image-picker-in-ionic-apps/148"&gt;Image Picker&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-add-image-cropper-in-ionic-apps/149"&gt;Image Cropper&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Essentials — &lt;a href="https://enappd.com/blog/ionic-4-save-and-retrieve-data-locally-on-device/59"&gt;Native Storage&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-translate-in-ionic-internationalization-and-localization/143"&gt;Translations&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-use-rtl-right-to-left-in-ionic-apps-pwa/152"&gt;RTL&lt;/a&gt; | &lt;a href="https://enappd.com/blog/using-sentry-error-monitoring-with-ionic-angular-applications/164"&gt;Sentry Error Monitoring&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic messaging — &lt;a href="https://enappd.com/blog/how-to-implement-firebase-push-notifications-in-ionic-apps/157"&gt;Firebase Push&lt;/a&gt; | &lt;a href="https://enappd.com/blog/automatically-read-sms-in-ionic-4-apps/42"&gt;Reading SMS&lt;/a&gt; | &lt;a href="https://enappd.com/blog/local-notifications-in-ionic-5-capacitor/132"&gt;Local Notifications&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic with Firebase — &lt;a href="https://enappd.com/blog/how-to-integrate-firebase-in-ionic-4-apps/23"&gt;Basics&lt;/a&gt; | &lt;a href="https://enappd.com/blog/firebase-with-ionic-4-hosting-auth-and-db-connection/58"&gt;Hosting and DB&lt;/a&gt; | &lt;a href="https://enappd.com/blog/firebase-cloud-functions-in-ionic-4-complete-guide/32"&gt;Cloud functions&lt;/a&gt; | &lt;a href="https://enappd.com/blog/github-actions-deploying-ionic-angular-app-to-firebase-hosting/146"&gt;Deploy App to Firebase&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-use-firebase-emulators-with-ionic-angular-applications/163"&gt;Firebase simulator&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Unit Testing in Ionic — &lt;a href="https://enappd.com/blog/beginners-guide-to-ionic-angular-unit-testing-part-1/151"&gt;Part 1&lt;/a&gt; | &lt;a href="https://enappd.com/blog/beginners-guide-to-ionic-angular-unit-testing-part-2-mocks-and-spies/155"&gt;Mocks &amp;amp; Spies&lt;/a&gt;| &lt;a href="https://enappd.com/blog/beginners-guide-to-ionic-angular-unit-testing-async-testing/156"&gt;Async Testing&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Ionic React Full App with Capacitor
&lt;/h3&gt;

&lt;p&gt;If you need a base to start your next Ionic 5 React Capacitor app, you can make your next awesome app using &lt;a href="https://store.enappd.com/product/ionic-react-full-app-capacitor/"&gt;Ionic 5 React Full App in Capacitor&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VtnFDcof--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/760/1%2AG3yOFVX4oABx9MhUy-3kng.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VtnFDcof--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/760/1%2AG3yOFVX4oABx9MhUy-3kng.png" alt="Ionic 5 React Full App in Capacitor from Enappd" width="760" height="479"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Ionic Capacitor Full App (Angular)
&lt;/h3&gt;

&lt;p&gt;If you need a base to start your next Angular &lt;strong&gt;Capacitor app&lt;/strong&gt; , you can make your next awesome app using &lt;a href="https://store.enappd.com/product/capacitor-full-app-with-ionic-angular/"&gt;Capacitor Full App&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3CTfBLjg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/736/0%2AUwSHcofTMStMnzAX.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3CTfBLjg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/736/0%2AUwSHcofTMStMnzAX.png" alt="Capacitor Full App with huge number of layouts and features" width="736" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Ionic Full App (Angular and Cordova)
&lt;/h3&gt;

&lt;p&gt;If you need a base to start your next Ionic 5 app, you can make your next awesome app using &lt;a href="https://store.enappd.com/product/ionic-full-app"&gt;Ionic 5 Full App&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--g_hLq_eU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/700/0%2A1ArpKyhiDHZnevwB.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--g_hLq_eU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/700/0%2A1ArpKyhiDHZnevwB.jpeg" alt="Ionic Full App with huge number of layouts and features" width="700" height="442"&gt;&lt;/a&gt;&lt;/p&gt;




</description>
      <category>lerna</category>
      <category>nx</category>
      <category>git</category>
      <category>monorepo</category>
    </item>
    <item>
      <title>Contacts Plugins In Ionic 5 Application</title>
      <dc:creator>Vaibhav Gehani</dc:creator>
      <pubDate>Mon, 11 Apr 2022 04:35:50 +0000</pubDate>
      <link>https://dev.to/enappd/contacts-plugins-in-ionic-5-application-1028</link>
      <guid>https://dev.to/enappd/contacts-plugins-in-ionic-5-application-1028</guid>
      <description>&lt;h3&gt;
  
  
  Contacts Plugins In Ionic Angular Application
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--X0zLQgJT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A7256mCwrPAsbaanZB4dBoA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--X0zLQgJT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A7256mCwrPAsbaanZB4dBoA.png" alt="" width="880" height="293"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this tutorial, we will learn how to implement Cordova’s &lt;a href="https://ionicframework.com/docs/native/contacts"&gt;Contacts Plugin&lt;/a&gt; in the Ionic 5 Angular Application on Android Phone (you can use the same plugin on other platforms also). Contact Plugin helps to implement various functionality like getting contact from the Phone’s contact list, and saving new contact info into the phone’s native contact list. Implementing this Plugin is quite simple and easy, only we have to Inject the plugin dependency and use it in the required Pages.&lt;/p&gt;

&lt;p&gt;We will be implementing, a simple Contacts App with the below stated features:-&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Add contacts from Native Contact List of phone and save it into Local Storage.&lt;/li&gt;
&lt;li&gt;Creating new Contact and saving them into the Native Contact List.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  What is Ionic?
&lt;/h3&gt;

&lt;p&gt;Skip this section if you know about Ionic.&lt;/p&gt;

&lt;p&gt;You probably already know about Ionic, but I’m putting it here just for the sake of beginners. &lt;strong&gt;Ionic&lt;/strong&gt; is a complete open-source SDK for hybrid mobile app development created by &lt;a href="https://medium.com/u/a76fa51de1ba"&gt;Max Lynch&lt;/a&gt;, &lt;a href="https://medium.com/u/14b1be5c1354"&gt;Ben Sperry&lt;/a&gt; and Adam Bradley of Drifty Co. in 2013. Ionic provides tools and services for developing hybrid mobile apps using Web technologies like CSS, HTML5, and Sass. Apps can be built with these Web technologies and then distributed through native app stores to be installed on devices by leveraging Cordova.&lt;/p&gt;

&lt;p&gt;So, in other words — If you create Native apps in Android, you code in Java. If you create Native apps in iOS, you code in Obj-C or Swift. Both of these are powerful but complex languages. &lt;strong&gt;With Cordova (and Ionic) you can write a single piece of code for your app that can run on both iOS and Android&lt;/strong&gt; (and windows!), that too with the simplicity of HTML, CSS, and JS.&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating the Contacts App
&lt;/h3&gt;

&lt;p&gt;We will follow some easy steps to implement Contacts Plugin in the Ionic 5 Angular application:-&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Creating Ionic 5 Angular Project.&lt;/li&gt;
&lt;li&gt;Installing Contacts Plugin in Ionic 5 Angular Application and adding the Contacts Plugin Logic.&lt;/li&gt;
&lt;li&gt;Building the application on the Android Platform.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So let's start to code and get our app ready.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nKwGTAtC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/360/1%2AjoplbbiO8N8X-L4Pfj0-jg.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nKwGTAtC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/360/1%2AjoplbbiO8N8X-L4Pfj0-jg.gif" alt="Code, code and code….!!" width="360" height="202"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Creating Ionic 5 Angular Project
&lt;/h3&gt;

&lt;p&gt;To create an Ionic 5 Angular app, we just have to run one command and that’s it (Assuming you already have Ionic CLI set up on your terminal, else read our &lt;a href="https://enappd.com/blog/how-to-create-an-ionic-app-for-beginners/144/"&gt;blogs&lt;/a&gt;). The rest of the things will be handled by the Ionic CLI. And in Ionic 5, we have got various options to choose various frameworks like (Angular, React, and Vue). In this tutorial, we will use Angular to build our apps. Run the below command to create the Ionic 5 Angular app.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ ionic start &amp;lt;appName&amp;gt; blank
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Replace &lt;strong&gt;appName&lt;/strong&gt; with the name you want for your project. If you are a beginner and want to know more about Ionic 5. You can go and visit this &lt;a href="https://enappd.com/blog/how-to-create-an-ionic-app-for-beginners/144/"&gt;BLOG&lt;/a&gt;. A new project will be created in your working directory with the name you used. Now the Ionic project is created, we can integrate the Cordova &lt;strong&gt;Contacts Plugin&lt;/strong&gt; into the App.&lt;/p&gt;
&lt;h3&gt;
  
  
  Step 2: Installing Contacts Plugin in Ionic 5 Application
&lt;/h3&gt;

&lt;p&gt;Before installing the plugin we have to add the native mobile platforms in the Ionic 5 application, to install the platform you can run the below command in Command Line/Terminal:-&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ ionic cordova platform add &amp;lt;Platform_name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;You have replaced the &lt;strong&gt;Platform_name&lt;/strong&gt; with the &lt;strong&gt;android&lt;/strong&gt; or &lt;strong&gt;ios&lt;/strong&gt; , whichever you want. In this case, we will add Android as the platform and continue to install the Contacts Plugin.&lt;/p&gt;

&lt;p&gt;To install the &lt;a href="https://ionicframework.com/docs/native/contacts/"&gt;Contacts Plugin&lt;/a&gt;, we just have to run few simple commands in Command Line/Terminal :&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ ionic cordova plugin add cordova-plugin-contacts
$ npm install @ionic-native/contacts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Now the plugin is installed, we are good to go to add the Logic in our Ionic 5 application. First, we will import and inject the Contacts Plugin in &lt;strong&gt;app.module.ts&lt;/strong&gt; &lt;em&gt;[Line 19 at app.module.ts] &lt;/em&gt;— Imported Contacts Plugin and at line 37 — Injected Contacts Plugin.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;After injecting the Contacts Plugin, we can use it in any of the Page or Components. First, we will implement the reading contact information feature.&lt;/p&gt;

&lt;h4&gt;
  
  
  1. Getting Contact From Native Contact List using Contacts Plugin:-
&lt;/h4&gt;

&lt;p&gt;To implement the Reading feature, we will use a few buttons which will take the contact from the Native contact list.&lt;/p&gt;

&lt;p&gt;To make this page, first, we will add the HTML code in the Ionic 5 application.&lt;/p&gt;

&lt;p&gt;We will use the &lt;strong&gt;add-contact&lt;/strong&gt; page to add the native contact to local storage, you can generate the page using the below command (in the Ionic root directory):-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ ionic generate page add-contact
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The above command will add the &lt;strong&gt;add-contact&lt;/strong&gt; page in your working project, now will add the HTML code to &lt;strong&gt;add-contact.page.html&lt;/strong&gt; :-&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;Above HTML will look like below Image:-&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ggJ87boo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/277/1%2AI9-4J_O3EKOIfauyt2DyJQ.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ggJ87boo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/277/1%2AI9-4J_O3EKOIfauyt2DyJQ.jpeg" alt="create contact page" width="277" height="491"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the above HTML code, we have simply added 2 buttons — &lt;strong&gt; +Pick from Contact List&lt;/strong&gt; &amp;amp; &lt;strong&gt;Create Contact&lt;/strong&gt; button and a form using which we can save contact directly in the Local Storage. Now we will look at the logic placed in add-contact.page.ts:-&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;In the above code, we have simply injected the Contacts Plugin and used to get the contact from the Native List using &lt;strong&gt;&lt;em&gt;contactList&lt;/em&gt;() function&lt;/strong&gt; [Line 36]. This function is attached to the &lt;strong&gt;+ Pick from Contact List&lt;/strong&gt; Button. In the &lt;strong&gt;&lt;em&gt;contactList&lt;/em&gt;&lt;/strong&gt; () function we have used the &lt;strong&gt;&lt;em&gt;pickContact&lt;/em&gt;()&lt;/strong&gt; method [Inside the contactList() method], which will pick the contact (this will ask for permission from the user on phone) from the Native Contact List.&lt;/p&gt;

&lt;p&gt;Once the Contact is selected, then the app will ask for the Confirmation using an Alert defined in &lt;strong&gt;showConfirmationAlertForContacts()&lt;/strong&gt; function [line 95]. Once you confirm it, the selected contact will be saved into the Local Storage. Most of the Local Storage contacts logic is defined under &lt;strong&gt;Contact Services&lt;/strong&gt; , to create contacts services you can run the below command:-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ ionic generate services contact
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The above command will create a contact service in the working directory of the Ionic 5 project. Below is the code for the Contact Service file:-&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;To add the contact in the Local storage, we will call the &lt;strong&gt;&lt;em&gt;saveContactToLocal&lt;/em&gt;&lt;/strong&gt; () function defined in &lt;strong&gt;contact.service.ts&lt;/strong&gt; file.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;The above command will add the selected contact in the Local Storage with the following (&lt;em&gt;id, contact_name, contact_email, contact_photo, contact_number&lt;/em&gt;) attributes.&lt;/p&gt;

&lt;h4&gt;
  
  
  2. Reading Saved Contact from Local Storage:-
&lt;/h4&gt;

&lt;p&gt;To show the contact that we have read from the local storage. You can add a new page called the &lt;em&gt;Contacts page&lt;/em&gt;, by running the below command in the Ionic 5 project:-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ ionic generate page contacts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The above command will add the contacts page in your working project, now will add the HTML code to &lt;strong&gt;contacts.page.html&lt;/strong&gt;  :-&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;In the above code, we have simply rendered the array of contacts [&lt;strong&gt;&lt;em&gt;Line 12 in contact.service.ts file&lt;/em&gt;&lt;/strong&gt;] defined under contact services. The HTML will look like the below image:-&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--p4l3SlRt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/278/1%2ALMARw7mF22ugAt5LQ_p6vQ.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--p4l3SlRt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/278/1%2ALMARw7mF22ugAt5LQ_p6vQ.jpeg" alt="Reading Contact" width="278" height="448"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we will look at the Logic used in the &lt;em&gt;Contacts page&lt;/em&gt; (i.e. contacts.page.ts), below is the code for the &lt;strong&gt;contact.page.ts&lt;/strong&gt; file.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;In the above code, we call the &lt;strong&gt;&lt;em&gt;getAllSavedContact&lt;/em&gt;()&lt;/strong&gt; &lt;em&gt;[Line 20 in contacts.page.ts]&lt;/em&gt; function as soon as the Contact Page gets loaded into the View. To do that we have Ionic lifecycle method &lt;strong&gt;&lt;em&gt;ionViewDidEnter&lt;/em&gt;()&lt;/strong&gt; &lt;em&gt;[Line 19 in contacts.page.ts]&lt;/em&gt;. This function takes all the Contacts from Local Storage and pushes them into the array.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Now we have implemented reading of contacts from Native Contact List and added the selecting contact list in Local Storage. In Addition, you can save the contact to the Native Contact List as well by using a simple function mentioned below:-&lt;/p&gt;

&lt;p&gt;For this, Import the Plugin using the below line:-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { Contacts } from '@ionic-native/contacts/ngx';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After Importing the plugin, we can inject it into the component using the below code:-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Constructor(private contacts: Contacts) {}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we can add the below code to create a new contact into the Phone Contact List.&lt;/p&gt;

&lt;p&gt;Constructor Params:-&lt;br&gt;&lt;br&gt;
1) new ContactName(nick_name, first_name, last_name)&lt;br&gt;&lt;br&gt;
2) new ContactField(‘mobile’, mobile_number)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let contact: Contact = this.contacts.create();
contact.name = new ContactName(null, 'Smith', 'John');
contact.phoneNumbers = [new ContactField('mobile', '6471234567')];
contact.save().then(
  () =&amp;gt; console.log('Contact saved!', contact),
  (error: any) =&amp;gt; console.error('Error saving contact.', error)
);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 3: Building the application on the Android Platform.
&lt;/h3&gt;

&lt;p&gt;To add and build the Android application, run the below commands :-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ ionic cordova platform add android
$ ionic cordova run android
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The below video is for a completed application, the same flow can be seen in your application also.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dQZbgucj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/480/1%2A992_yAid73aW08LmlJHogw.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dQZbgucj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/480/1%2A992_yAid73aW08LmlJHogw.gif" alt="" width="480" height="1046"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;In this tutorial, we have learned about implementing the Contacts Plugin in the Ionic 5 Angular application. Contacts Plugin can be used in any of the business logic applications like taxi app (calling the driver), Data Sharing app (sharing data to contacts), and many more. So now you can integrate this feature in your Ionic app and take it to another level. And if you want to add/learn more features you can visit &lt;a href="https://enappd.com/blog/"&gt;&lt;strong&gt;&lt;em&gt;Enappd Blog&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Next Steps
&lt;/h3&gt;

&lt;p&gt;If you liked this blog, you will also find the following Ionic blogs interesting and helpful. Feel free to ask any questions in the comment section&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ionic Payment Gateways — &lt;a href="https://enappd.com/blog/ionic-4-stripe-payment-integration-with-firebase-for-apps-and-pwa/17"&gt;Stripe&lt;/a&gt; | &lt;a href="https://enappd.com/blog/ionic-4-paypal-payment-integration-for-apps-and-pwa/16"&gt;PayPal&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-integrate-apple-pay-in-ionic-4-apps/21"&gt;Apple Pay&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-integrate-razorpay-in-ionic-4-apps-and-pwa/20"&gt;RazorPay&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Charts with — &lt;a href="https://enappd.com/blog/ionic-4-charts-using-google-charts/66"&gt;Google Charts&lt;/a&gt;| &lt;a href="https://enappd.com/blog/adding-charts-in-ionic-4-apps-and-pwa-part-3/60"&gt;HighCharts&lt;/a&gt; | &lt;a href="https://enappd.com/blog/adding-charts-in-ionic-4-apps-and-pwa-part-2/54"&gt;d3.js&lt;/a&gt; | &lt;a href="https://enappd.com/blog/charts-in-ionic-4-apps-and-pwa-part-1/52"&gt;Chart.js&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Social Logins — &lt;a href="https://enappd.com/blog/facebook-login-in-ionic-4-apps-using-firebase/25"&gt;Facebook&lt;/a&gt; | &lt;a href="https://enappd.com/blog/google-login-in-ionic-4-apps-using-firebase/39"&gt;Google&lt;/a&gt; | &lt;a href="https://enappd.com/blog/twitter-login-in-ionic-4-apps-using-firebase/24"&gt;Twitter&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Authentications — &lt;a href="https://enappd.com/blog/email-authentication-with-firebase-in-ionic-4/38"&gt;Via Email&lt;/a&gt; | &lt;a href="https://enappd.com/blog/firebase-anonymous-login-in-ionic-4/37"&gt;Anonymous&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Features — &lt;a href="https://enappd.com/blog/using-geolocation-geocoding-and-reverse-geocoding-in-ionic-4/45"&gt;Geolocation&lt;/a&gt; | &lt;a href="https://enappd.com/blog/qr-code-scanning-and-optical-character-recognition-ocr-in-ionic-4/9"&gt;QR Code reader&lt;/a&gt;| &lt;a href="https://enappd.com/blog/best-fitness-plugins-for-ionic-4-how-to-use-pedometer/15"&gt;Pedometer&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Media in Ionic — &lt;a href="https://enappd.com/blog/spotify-like-music-in-ionic-4-apps/48"&gt;Audio&lt;/a&gt; | &lt;a href="https://enappd.com/blog/adding-video-player-in-ionic-4-app/64"&gt;Video&lt;/a&gt; | &lt;a href="https://enappd.com/blog/image-picker-in-ionic-4-app/67"&gt;Image Picker&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-add-image-cropper-in-ionic-4-app/68"&gt;Image Cropper&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Essentials — &lt;a href="https://enappd.com/blog/ionic-4-save-and-retrieve-data-locally-on-device/59"&gt;Native Storage&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-translate-in-ionic-4-globalization-internationalization-and-localization/11"&gt;Translations&lt;/a&gt; | &lt;a href="https://enappd.com/blog/rtl-right-to-left-use-in-ionic-4/50"&gt;RTL&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic messaging — &lt;a href="https://enappd.com/blog/implement-ionic-4-firebase-push/34"&gt;Firebase Push&lt;/a&gt; | &lt;a href="https://enappd.com/blog/automatically-read-sms-in-ionic-4-apps/42"&gt;Reading SMS&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic with Firebase — &lt;a href="https://enappd.com/blog/how-to-integrate-firebase-in-ionic-4-apps/23"&gt;Basics&lt;/a&gt; | &lt;a href="https://enappd.com/blog/firebase-with-ionic-4-hosting-auth-and-db-connection/58"&gt;Hosting and DB&lt;/a&gt; | &lt;a href="https://enappd.com/blog/firebase-cloud-functions-in-ionic-4-complete-guide/32"&gt;Cloud functions&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Ionic React Full App with Capacitor
&lt;/h3&gt;

&lt;p&gt;If you need a base to start your next Ionic 5 React Capacitor app, you can make your next awesome app using &lt;a href="https://store.enappd.com/product/ionic-react-full-app-capacitor/"&gt;Ionic 5 React Full App in Capacitor&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VtnFDcof--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/760/1%2AG3yOFVX4oABx9MhUy-3kng.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VtnFDcof--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/760/1%2AG3yOFVX4oABx9MhUy-3kng.png" alt="Ionic 5 React Full App in Capacitor from Enappd" width="760" height="479"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Ionic Capacitor Full App (Angular)
&lt;/h3&gt;

&lt;p&gt;If you need a base to start your next Angular &lt;strong&gt;Capacitor app&lt;/strong&gt; , you can make your next awesome app using &lt;a href="https://store.enappd.com/product/capacitor-full-app-with-ionic-angular/"&gt;Capacitor Full App&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3CTfBLjg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/736/0%2AUwSHcofTMStMnzAX.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3CTfBLjg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/736/0%2AUwSHcofTMStMnzAX.png" alt="Capacitor Full App with huge number of layouts and features" width="736" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Ionic Full App (Angular and Cordova)
&lt;/h3&gt;

&lt;p&gt;If you need a base to start your next Ionic 5 app, you can make your next awesome app using &lt;a href="https://store.enappd.com/product/ionic-full-app"&gt;Ionic 5 Full App&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--g_hLq_eU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/700/0%2A1ArpKyhiDHZnevwB.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--g_hLq_eU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/700/0%2A1ArpKyhiDHZnevwB.jpeg" alt="Ionic Full App with huge number of layouts and features" width="700" height="442"&gt;&lt;/a&gt;&lt;/p&gt;




</description>
      <category>android</category>
      <category>angular</category>
      <category>cordovaplugin</category>
      <category>ionicframework</category>
    </item>
    <item>
      <title>Deploying Node server(JS) and Flask server(Python) to the Heroku</title>
      <dc:creator>Vaibhav Gehani</dc:creator>
      <pubDate>Wed, 16 Mar 2022 04:33:42 +0000</pubDate>
      <link>https://dev.to/enappd/deploying-node-serverjs-and-flask-serverpython-to-the-heroku-2098</link>
      <guid>https://dev.to/enappd/deploying-node-serverjs-and-flask-serverpython-to-the-heroku-2098</guid>
      <description>&lt;h3&gt;
  
  
  How to Deploy Node Server / Flask Server on Heroku
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ttyoYg_e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A_AXU7DvrAu7FrVQ71k1lxw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ttyoYg_e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A_AXU7DvrAu7FrVQ71k1lxw.png" alt="" width="880" height="293"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this tutorial, we will be covering 2 kinds of server deployment on the &lt;a href="https://heroku.com/"&gt;&lt;strong&gt;Heroku&lt;/strong&gt;&lt;/a&gt; Cloud platform :&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://nodejs.org/"&gt;Node JS&lt;/a&gt; Server&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://flask.palletsprojects.com/"&gt;Flask&lt;/a&gt; Server&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We will also show — how easy it is to write a server code from scratch, deploy it online for the first time and update the server after the first deployments. you can just use the simple git command to deploy the latest code.&lt;/p&gt;

&lt;p&gt;Both the &lt;strong&gt;Node Server&lt;/strong&gt; and &lt;strong&gt;Flask Server&lt;/strong&gt; have different steps to get deployed on Heroku. First, we will look at the Node Server and then the Flask server. Before going through the steps, we will take some basic knowledge about these technologies. And will also look at &lt;strong&gt;&lt;em&gt;what do we mean by deployment?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What is Deployment/Hosting?
&lt;/h3&gt;

&lt;p&gt;Any web-related app goes through several steps until it is available for the users. Generally, we work on our local system (mostly named as localhost) for coding the server. However, we need to send this code to a server that is associated with a publicly visible URL (not necessarily, it can be private also for some apps). From there we can access this Server’s applications like — webpage, API, or any webhook through a URL. This is called deploying the Server code. Traditionally this was done with the help of a Linux Server, which will run an HTTP Server. This Linux server is used to be associated with a public URL or IP address. All this setup used to take a lot of effort to prepare and manage my own server. But now mostly we will use Cloud Platforms to manage such deployments/hosting.&lt;/p&gt;

&lt;p&gt;There are several tools that can be used to deploy any kind of software or application or any site:-&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Bamboo.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Heroku.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;TeamCity.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;AWS CodeDeploy.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Octopus Deploy.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ElectricFlow.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;PDQ Deploy.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Ansible Tower.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Chef and more….&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now we know enough about the deployment, we will directly jump to deploying code of NodeJS. Before that, a small introduction about NodeJS, feel free to skip that section, if you already work on NodeJS.&lt;/p&gt;

&lt;h3&gt;
  
  
  About Node JS
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;Node.js is an open-source, cross-platform, back-end JavaScript runtime environment that runs on the V8 engine and executes JavaScript code outside a web browser.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;As an asynchronous event-driven JavaScript runtime, Node.js is designed to build scalable network applications. Node JS is easily deployable to the Heroku, we only need to run some of the Heroku commands to the terminal and we are good to go to operate the Live server.&lt;/p&gt;

&lt;p&gt;Once the server is deployed, we get the deployed URL (Hosted URL) which we can use in any of the Frontend applications to call the server and its APIs.&lt;/p&gt;

&lt;h3&gt;
  
  
  About Flask Server
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="http://flask.pocoo.org/"&gt;Flask&lt;/a&gt; is a web framework for Python, meaning that it provides functionality for building web applications, including managing HTTP requests and rendering templates.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Node is more capable as it is a complete JS runtime environment, Flask is just a simple Web Server. The functionality we will use is the same as the Node JS server, the only way of writing code change We will be developing some dummy APIs to check the status of the Server.&lt;/p&gt;

&lt;h3&gt;
  
  
  Create a Heroku Project
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;Heroku is a container-based cloud Platform as a Service (PaaS). Developers use Heroku to deploy, manage, and scale modern apps. Our platform is elegant, flexible, and easy to use, offering developers the simplest path to getting their apps to market.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;There are 2 parts to the Heroku Setup :&lt;/p&gt;

&lt;h4&gt;
  
  
  1. Settings through Heroku Cloud Dashboard
&lt;/h4&gt;

&lt;p&gt;So before setting up the server scripts, we need to create a new project in the Heroku platform. Go to &lt;a href="https://id.heroku.com/login"&gt;Heroku&lt;/a&gt; and then log in (if you already have an account) or signup (if you do not have the account). Once you logged in you will be taken to the Dashboard screen.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--eWC8wgD_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AWewk1375G12h0-z8dh8PMA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eWC8wgD_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AWewk1375G12h0-z8dh8PMA.png" alt="Heroku Dashboard" width="880" height="276"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;once you click on the new app, then it will ask you for the name of the app and to choose the region. (We will give &lt;strong&gt;dummyflaskserver&lt;/strong&gt; as the app name as it will be required later)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--quJGo5DG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/791/1%2AsYAeiGTJ0MmUZVc_Uw0Wmw.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--quJGo5DG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/791/1%2AsYAeiGTJ0MmUZVc_Uw0Wmw.jpeg" alt="Creating new app" width="791" height="483"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  2. Installing Heroku CLI on your local system
&lt;/h4&gt;

&lt;p&gt;Now after creating the app in the Heroku cloud, we just have to &lt;strong&gt;install the Heroku CLI (command-line interface)&lt;/strong&gt; in our system and run some commands to deploy our server. To download the Heroku-CLI just follow the steps mentioned in this &lt;a href="https://devcenter.heroku.com/articles/heroku-cli"&gt;Link&lt;/a&gt;. After installing you can login to the Heroku through your local system by running the below command (in terminal or CMD):-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ heroku login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The above command will prompt you to open the login window on the browser, then you can log in and it can automatically login into your system:-&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--M4_PLoJX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/719/1%2AZ-Sm7rbKXAkP5QALmGSmYQ.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--M4_PLoJX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/719/1%2AZ-Sm7rbKXAkP5QALmGSmYQ.jpeg" alt="heroku login command" width="719" height="59"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we are all set with the Heroku platform and we can start with the scripts for the node server and flask server. &lt;strong&gt;So tighten your seatbelts, we are good to go.!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5IqeTGdQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/480/1%2Am27v3rfp0_yKea6E3KxIJw.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5IqeTGdQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/480/1%2Am27v3rfp0_yKea6E3KxIJw.gif" alt="" width="480" height="480"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Setting up Node JS Server and Deploying to Heroku
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;This section will not teach much about NodeJS Server programming, but still, be easy for a beginner to pick up. You must have Node Enviroment already setup on your system — and command line should run “npm” &amp;amp; “node” without any issue.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To create a Node JS script, we will &lt;strong&gt;create an index.js file&lt;/strong&gt; and &lt;strong&gt;run npm init&lt;/strong&gt; in the working directory (this will create the package.json file in the project).&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ npm init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;the above command will create the &lt;strong&gt;&lt;em&gt;package.json&lt;/em&gt;&lt;/strong&gt; file in the working directory and then you can create the index.js file (All logic will be contained by index file). Once you have run the above command, the project structure will look like this:-&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mMIGBwN0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/291/1%2A1-_17l8nH7ybzjl8BD7RxA.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mMIGBwN0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/291/1%2A1-_17l8nH7ybzjl8BD7RxA.jpeg" alt="Project Structure" width="291" height="143"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Before implementing dummy APIs, we have to install some of the libraries that will help in implementing node script. To install the libraries run the below command:-&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ npm install _body-parser cors express_
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;To know more about &lt;a href="https://www.npmjs.com/package/body-parser"&gt;body-parser&lt;/a&gt;, &lt;a href="https://www.npmjs.com/package/cors"&gt;cors&lt;/a&gt;, and &lt;a href="https://www.npmjs.com/package/express"&gt;express&lt;/a&gt; you can follow the links. Now we have all the basic requirements to start our node script.&lt;/p&gt;

&lt;p&gt;Note — Check your project’s package.json file, it should contain the value stated below in the scripts section:-&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--l6vH7Oe0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/624/1%2AaueX2NUPIkFc-V1LCwNi7w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--l6vH7Oe0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/624/1%2AaueX2NUPIkFc-V1LCwNi7w.png" alt="package.json file" width="624" height="100"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we will write a dummy API that can be used to check whether the server is deployed properly or not? We will hit the API from the browser using the deployed URL and check its response.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;Now we have to initialize a GIT repository, and when we push code into repo it will automatically update the code in Heroku. &lt;strong&gt;Important Note:- Heroku creates its own repository parallel to the GIT repository and maintains the latest code into it.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the above code, we have simply added a &lt;strong&gt;/status&lt;/strong&gt; API that will be used to check the status of the server. If that API responds to the request, then our server is working.&lt;/p&gt;

&lt;p&gt;First, create a new Repository in Github, then run the below commands to push the code into the Git Repo.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ git init
$ git add .
$ git commit -m "message"
$ git remote add origin &amp;lt;repo_url&amp;gt;
$ git push origin master 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The above command will push the code in Github repository, now to deploy the code to Heroku run the below command under Heroku-CLI:-&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ heroku git: remote -a &amp;lt;app_name&amp;gt;
$ git push heroku master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;If you cannot find your app name (In our case it is &lt;strong&gt;dummyappserver&lt;/strong&gt; ) &lt;strong&gt; — &lt;/strong&gt; you can go to the &lt;strong&gt;deploy&lt;/strong&gt; section under the app, in Heroku Dashboard. The first command, &lt;strong&gt;heroku git: remote -a &lt;/strong&gt; will add a remote path using the app name. And the last command i.e. &lt;strong&gt;git push heroku master&lt;/strong&gt; will push the code to &lt;strong&gt;Heroku&lt;/strong&gt; remote. It will automatically start the build process, generate a node environment in the Heroku platform, and returns the deployed URL. Now we can check our server is working or not by hitting the API using /status endpoint:-&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OVYJ06ML--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/687/1%2AEcNevbvEsUZh-USE3EUAgA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OVYJ06ML--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/687/1%2AEcNevbvEsUZh-USE3EUAgA.png" alt="Testing Deployed URL" width="687" height="192"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Setting up Flask Server and deploying on Heroku
&lt;/h3&gt;

&lt;p&gt;Please switch to a different Project folder, before starting this section as it has no relation with the NodeJS code or Project.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This section will not teach much about Python Flask Server programming, but still, be easy for a beginner to pick up. You must have Python Enviroment already setup on your system — and command line should run “python” and “pip” or “pip3” command.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Before creating the script, we will create and configure another Heroku app, different from the NodeJS one. To create an app click on create the app&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PdCq3i0g--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/749/1%2Ad7tAopNRKzClZpz5QkKjvQ.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PdCq3i0g--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/749/1%2Ad7tAopNRKzClZpz5QkKjvQ.jpeg" alt="Creating new app" width="749" height="335"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once a new app is created (with &lt;strong&gt;dummyflaskserver&lt;/strong&gt; as app name), we have to configure i.e. to add the Python build packs in the Heroku platform. You can go to the setting tab to get the option:-&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rHeepgnE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/958/1%2AODSTrkf2cdGxwBDSvJwxVg.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rHeepgnE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/958/1%2AODSTrkf2cdGxwBDSvJwxVg.jpeg" alt="Settings Tab" width="880" height="221"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can find the adding the Buildpacks options in the settings and add the Python package to it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GpGMRBz4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AUa1-la9_8RxPIrOHF_PqYA.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GpGMRBz4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AUa1-la9_8RxPIrOHF_PqYA.jpeg" alt="Buildpacks option" width="880" height="150"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on Add Buildpack, and choose the Python as the option:-&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--aSmCvSQB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/616/1%2As2lNYlBEvQzmrMNhvd367g.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aSmCvSQB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/616/1%2As2lNYlBEvQzmrMNhvd367g.jpeg" alt="Adding Python to Buildpack" width="616" height="463"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We have configured the Heroku app, now we can start with setting up the flask server. First, we will create a file named &lt;strong&gt;app.py&lt;/strong&gt; that will be the file containing the APIs &lt;strong&gt;(Note — choose app.py as the name of the file).&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before continuing you have to keep note, you must have Python preinstalled on your PC. If you have already installed the Python then run the below command to install the flask packages ( &lt;strong&gt;pip3&lt;/strong&gt; can also be &lt;strong&gt;pip&lt;/strong&gt; in your system):-&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ pip3 install flask
$ pip3 install flask_cors
$ pip3 install gunicorn
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;once all the packages are installed, then create the &lt;strong&gt;app.py&lt;/strong&gt; in the working directory. Please take care of indentations, as this is Python.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;In the above python script, Firstly, A flask app had been initialized and after that CORS has been be enabled in the server. We have added &lt;strong&gt;index()&lt;/strong&gt; function that returns the String “Status OK”. This index function is called whenever someone hits the &lt;strong&gt;/status&lt;/strong&gt; endpoint. We have followed the function-based pattern for the flask script (You can follow a Class-based pattern if you like).&lt;/p&gt;

&lt;p&gt;Now to deploy the code to Heroku we have to configure some of the files in the Flask project like &lt;strong&gt;Procfile, requirements.txt, and runtime.txt&lt;/strong&gt;. These files will help Heroku to know more about the project.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Add Procfile to the Project:-&lt;/strong&gt; In this file, we have to add the below line that will configure the app and help to run the server instance.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;web: gunicorn app:app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;app: :- this app_name will be the server instance that we have defined in &lt;strong&gt;app.py.&lt;/strong&gt; Ex. &lt;strong&gt;‘web gunicorn dummyflaskserver:app’&lt;/strong&gt; ( &lt;strong&gt;&lt;em&gt;dummyflaskserver&lt;/em&gt;&lt;/strong&gt; is the app name used in our case).&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Add requirements.txt file to the Project:-&lt;/strong&gt; This file contains the requirements or the packages used by the Flask server. To generate this file use the below command:-
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip freeze &amp;gt; requirements.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Add the runtime.txt file to the Project:-&lt;/strong&gt; This file will let Heroku know which Python version to use in the environment. we have to add the below line to the file.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python-&amp;lt;version&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This version can be 3.7.6 (python-3.7.6)or anything installed in your system, you can check it using the below command (use &lt;strong&gt;python3&lt;/strong&gt; instead of &lt;strong&gt;python&lt;/strong&gt; command if you have also python 2):-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After we have added all these files to the Python project, the project structure will look like this:-&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3Gnq1rkB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/224/1%2A3VykdGO6zr9InyIZBye1cw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3Gnq1rkB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/224/1%2A3VykdGO6zr9InyIZBye1cw.png" alt="Project Structure" width="224" height="197"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we have to repeat the same steps to push this code to the Github repository. To push the code to Github, run the below command:-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ git init
$ git add .
$ git commit -m "message"
$ git remote add origin &amp;lt;repo_url&amp;gt;
$ git push origin master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And now we will push the code to the Heroku remote. By running the below command into the project directory 1) you will add a new remote named &lt;strong&gt;heroku&lt;/strong&gt; 2) push code to Heroku remote:- ( &lt;strong&gt;dummyflaskserver&lt;/strong&gt; is the name used while setting up the Heroku application in the dashboard)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ heroku git:remote -a dummyflaskserver
$ git push heroku master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Heroku push command will automatically trigger the build process of the cloud. In the end, will return the deployed URL, that can be used in any of the front-end applications or any other servers. We will hit the URL using browser:-&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OVYJ06ML--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/687/1%2AEcNevbvEsUZh-USE3EUAgA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OVYJ06ML--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/687/1%2AEcNevbvEsUZh-USE3EUAgA.png" alt="Hitting the URL" width="687" height="192"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;We have learned how to write simple NodeJS or Flask Server codes and deploy them to the Heroku platform. It is one of the important steps after the local development phase. If you want to know more about any of the features or any technology you can visit &lt;a href="https://enappd.com/blog/"&gt;Enappd Blogs&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Next Steps
&lt;/h3&gt;

&lt;p&gt;If you liked this blog, you will also find the following Ionic blogs interesting and helpful. Feel free to ask any questions in the comment section&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ionic Payment Gateways — &lt;a href="https://enappd.com/blog/ionic-4-stripe-payment-integration-with-firebase-for-apps-and-pwa/17"&gt;Stripe&lt;/a&gt; | &lt;a href="https://enappd.com/blog/ionic-4-paypal-payment-integration-for-apps-and-pwa/16"&gt;PayPal&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-integrate-apple-pay-in-ionic-4-apps/21"&gt;Apple Pay&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-integrate-razorpay-in-ionic-4-apps-and-pwa/20"&gt;RazorPay&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Charts with — &lt;a href="https://enappd.com/blog/ionic-4-charts-using-google-charts/66"&gt;Google Charts&lt;/a&gt;| &lt;a href="https://enappd.com/blog/adding-charts-in-ionic-4-apps-and-pwa-part-3/60"&gt;HighCharts&lt;/a&gt; | &lt;a href="https://enappd.com/blog/adding-charts-in-ionic-4-apps-and-pwa-part-2/54"&gt;d3.js&lt;/a&gt; | &lt;a href="https://enappd.com/blog/charts-in-ionic-4-apps-and-pwa-part-1/52"&gt;Chart.js&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Social Logins — &lt;a href="https://enappd.com/blog/facebook-login-in-ionic-4-apps-using-firebase/25"&gt;Facebook&lt;/a&gt; | &lt;a href="https://enappd.com/blog/google-login-in-ionic-4-apps-using-firebase/39"&gt;Google&lt;/a&gt; | &lt;a href="https://enappd.com/blog/twitter-login-in-ionic-4-apps-using-firebase/24"&gt;Twitter&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Authentications — &lt;a href="https://enappd.com/blog/email-authentication-with-firebase-in-ionic-4/38"&gt;Via Email&lt;/a&gt; | &lt;a href="https://enappd.com/blog/firebase-anonymous-login-in-ionic-4/37"&gt;Anonymous&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Features — &lt;a href="https://enappd.com/blog/using-geolocation-geocoding-and-reverse-geocoding-in-ionic-4/45"&gt;Geolocation&lt;/a&gt; | &lt;a href="https://enappd.com/blog/qr-code-scanning-and-optical-character-recognition-ocr-in-ionic-4/9"&gt;QR Code reader&lt;/a&gt;| &lt;a href="https://enappd.com/blog/best-fitness-plugins-for-ionic-4-how-to-use-pedometer/15"&gt;Pedometer&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Media in Ionic — &lt;a href="https://enappd.com/blog/spotify-like-music-in-ionic-4-apps/48"&gt;Audio&lt;/a&gt; | &lt;a href="https://enappd.com/blog/adding-video-player-in-ionic-4-app/64"&gt;Video&lt;/a&gt; | &lt;a href="https://enappd.com/blog/image-picker-in-ionic-4-app/67"&gt;Image Picker&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-add-image-cropper-in-ionic-4-app/68"&gt;Image Cropper&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Essentials — &lt;a href="https://enappd.com/blog/ionic-4-save-and-retrieve-data-locally-on-device/59"&gt;Native Storage&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-translate-in-ionic-4-globalization-internationalization-and-localization/11"&gt;Translations&lt;/a&gt; | &lt;a href="https://enappd.com/blog/rtl-right-to-left-use-in-ionic-4/50"&gt;RTL&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic messaging — &lt;a href="https://enappd.com/blog/implement-ionic-4-firebase-push/34"&gt;Firebase Push&lt;/a&gt; | &lt;a href="https://enappd.com/blog/automatically-read-sms-in-ionic-4-apps/42"&gt;Reading SMS&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic with Firebase — &lt;a href="https://enappd.com/blog/how-to-integrate-firebase-in-ionic-4-apps/23"&gt;Basics&lt;/a&gt; | &lt;a href="https://enappd.com/blog/firebase-with-ionic-4-hosting-auth-and-db-connection/58"&gt;Hosting and DB&lt;/a&gt; | &lt;a href="https://enappd.com/blog/firebase-cloud-functions-in-ionic-4-complete-guide/32"&gt;Cloud functions&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Ionic React Full App with Capacitor
&lt;/h3&gt;

&lt;p&gt;If you need a base to start your next Ionic 5 React Capacitor app, you can make your next awesome app using &lt;a href="https://store.enappd.com/product/ionic-react-full-app-capacitor/"&gt;Ionic 5 React Full App in Capacitor&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VtnFDcof--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/760/1%2AG3yOFVX4oABx9MhUy-3kng.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VtnFDcof--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/760/1%2AG3yOFVX4oABx9MhUy-3kng.png" alt="Ionic 5 React Full App in Capacitor from Enappd" width="760" height="479"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Ionic Capacitor Full App (Angular)
&lt;/h3&gt;

&lt;p&gt;If you need a base to start your next Angular &lt;strong&gt;Capacitor app&lt;/strong&gt; , you can make your next awesome app using &lt;a href="https://store.enappd.com/product/capacitor-full-app-with-ionic-angular/"&gt;Capacitor Full App&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3CTfBLjg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/736/0%2AUwSHcofTMStMnzAX.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3CTfBLjg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/736/0%2AUwSHcofTMStMnzAX.png" alt="Capacitor Full App with huge number of layouts and features" width="736" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Ionic Full App (Angular and Cordova)
&lt;/h3&gt;

&lt;p&gt;If you need a base to start your next Ionic 5 app, you can make your next awesome app using &lt;a href="https://store.enappd.com/product/ionic-full-app"&gt;Ionic 5 Full App&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--g_hLq_eU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/700/0%2A1ArpKyhiDHZnevwB.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--g_hLq_eU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/700/0%2A1ArpKyhiDHZnevwB.jpeg" alt="Ionic Full App with huge number of layouts and features" width="700" height="442"&gt;&lt;/a&gt;&lt;/p&gt;




</description>
      <category>pythonflask</category>
      <category>deployment</category>
      <category>node</category>
      <category>flask</category>
    </item>
    <item>
      <title>Firebase Admin SDK setup and functions using Node JS</title>
      <dc:creator>Vaibhav Gehani</dc:creator>
      <pubDate>Thu, 10 Mar 2022 08:31:09 +0000</pubDate>
      <link>https://dev.to/enappd/firebase-admin-sdk-setup-and-functions-using-node-js-10bo</link>
      <guid>https://dev.to/enappd/firebase-admin-sdk-setup-and-functions-using-node-js-10bo</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ay4iAvX6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A-hQqw-_hY3M5HfNgEdgGbg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ay4iAvX6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A-hQqw-_hY3M5HfNgEdgGbg.png" alt="" width="880" height="293"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this tutorial, we will be going through the Admin SDK of firebase. We will set up and use various functions in the Node JS script. Before going through any procedure or implementation, we briefly summarize what is Firebase, Firebase Admin SDK, and Node JS. Feel free to skip these sections, if you are already familiar with all of them.&lt;/p&gt;

&lt;h3&gt;
  
  
  Firebase 🔥
&lt;/h3&gt;

&lt;p&gt;If you already know what is firebase — SKIP this section.&lt;/p&gt;

&lt;p&gt;Firebase is a popular Backend-as-a-Service (BaaS) platform. It started as a &lt;a href="http://blog.ycombinator.com/firebase-yc-s11-raises-5-dollars-dot-6m-series-a-from-union-square-ventures-and-flybridge"&gt;YC11 startup&lt;/a&gt; and grew up into a next-generation app-development platform on Google Cloud Platform. It is getting popular by the day because of the ease of integration and the variety of functionalities available on it.&lt;/p&gt;

&lt;p&gt;A lot of quick integrations are available with Firebase. Some of these are listed below:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Real-time Database 🗄️&lt;/li&gt;
&lt;li&gt;FireStore Database 🗄️&lt;/li&gt;
&lt;li&gt;Email Authentication 📧&lt;/li&gt;
&lt;li&gt;Social logins📱&lt;/li&gt;
&lt;li&gt;In-app messages&lt;/li&gt;
&lt;li&gt;Push notifications&lt;/li&gt;
&lt;li&gt;Analytics 📊&lt;/li&gt;
&lt;li&gt;Crashlytics 💥&lt;/li&gt;
&lt;li&gt;Remote config&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Firebase is quickly growing to become the most popular mobile app back-end platform.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is Firebase Admin SDK?
&lt;/h3&gt;

&lt;p&gt;Firebase is one the most used platform for various services like Databases and other services. If we want to extend these services, especially control them over a backend server, we can do it using Admin SDK that provides various more extended functionalities. The Admin SDK is a set of server libraries that lets you interact with Firebase from privileged environments to perform actions like:-&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Read and write &lt;strong&gt;Realtime Database&lt;/strong&gt; data with full admin privileges.&lt;/li&gt;
&lt;li&gt;Programmatically send &lt;strong&gt;Firebase Cloud Messaging&lt;/strong&gt; messages using a simple, alternative approach to the Firebase Cloud Messaging server protocols.&lt;/li&gt;
&lt;li&gt;Generate and verify &lt;strong&gt;Firebase Auth&lt;/strong&gt;  tokens.&lt;/li&gt;
&lt;li&gt;Access Google Cloud resources like &lt;strong&gt;Cloud Storage buckets&lt;/strong&gt; and &lt;strong&gt;Cloud Firestore databases&lt;/strong&gt; associated with your Firebase projects.&lt;/li&gt;
&lt;li&gt;Create your own simplified Admin console to do things like look up user data or change a user’s email address for authentication.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But to implement the Firebase Admin SDK, you must have a Server Side code in one of the below language environments:-&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Admin Node.js SDK — JavaScript/Node.js 10.10.0+&lt;/li&gt;
&lt;li&gt;Admin Java SDK — Java 7+ (recommend Java 8+)
Java 7 support is deprecated.&lt;/li&gt;
&lt;li&gt;Admin Python SDK — Python 3.5+ (recommend Python 3.6+)&lt;/li&gt;
&lt;li&gt;Admin Go SDK — Go 1.11+&lt;/li&gt;
&lt;li&gt;Admin .NET SDK — .NET Framework 4.5+ or .Net Core 1.5+&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We will only discuss the NodeJS environment, but others are also similar in implementation.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is Node JS?
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;Node.js is an open-source, cross-platform, back-end JavaScript runtime environment that runs on the V8 engine and executes JavaScript code outside a web browser&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;As an asynchronous event-driven JavaScript runtime, Node.js is designed to build scalable network applications.&lt;/p&gt;

&lt;p&gt;In the context of this tutorial, we will use a simple script that will handle the Firebase Admin SDK functions. To integrate Firebase Admin SDK, we will be using &lt;a href="https://www.npmjs.com/package/firebase-admin"&gt;firebase-admin&lt;/a&gt; package that contains all the functions present in Admin SDK.&lt;/p&gt;

&lt;p&gt;We have talked about all the technologies involved and if you want to explore more about Firebase or Node JS you can go to &lt;a href="https://enappd.com/blog/"&gt;Enappd Blogs&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Firebase Admin SDK Setup — NodeJS
&lt;/h3&gt;

&lt;p&gt;We will now jump to some steps to be taken to implement Admin SDK.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Creating Firebase Project.&lt;/li&gt;
&lt;li&gt;Creating Service Account to communicate with Firebase.&lt;/li&gt;
&lt;li&gt;Creating Node JS script and implementing Admin SDK functions.&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;So lets start implementing firebase admin function handlers using Node JS.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0FFPXWqq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/400/1%2As3juBMW4ljHXTVKFd7YpkQ.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0FFPXWqq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/400/1%2As3juBMW4ljHXTVKFd7YpkQ.gif" alt="" width="400" height="333"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1:- Creating Firebase Project
&lt;/h3&gt;

&lt;p&gt;Go to &lt;a href="https://console.firebase.google.com/"&gt;Firebase&lt;/a&gt; and create your first project (or use an existing one). Your console should look like this&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---WFFMV5W--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2AQ1tzpM83Uq66TNZ9E28nYA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---WFFMV5W--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2AQ1tzpM83Uq66TNZ9E28nYA.png" alt="Your Firebase projects all in one place" width="800" height="357"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;  — It’s really easy to create a Firebase project, but if you still face any issues, follow steps 1–4 of &lt;a href="https://enappd.com/blog/how-to-integrate-firebase-in-ionic-4-apps/23/"&gt;this blog&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2:- Creating Service Account to communicate with Firebase
&lt;/h3&gt;

&lt;p&gt;Firebase uses &lt;strong&gt;service accounts&lt;/strong&gt; to operate and manage services without sharing user credentials. When you create a Firebase project, you might notice that a number of service accounts are already available in your project (check the below images). You might also notice that new service accounts are added to your project when you add services or perform certain actions (for example, linking a Firebase product to BigQuery). Some of these service accounts are added directly by Firebase; others are added via the Google Cloud project associated with your Firebase project.&lt;/p&gt;

&lt;p&gt;You can view all service accounts associated with your project in the &lt;a href="https://console.firebase.google.com/u/0/project/_/settings/serviceaccounts"&gt;&lt;strong&gt;Service accounts&lt;/strong&gt;&lt;/a&gt; tab of your &lt;strong&gt;settings &amp;gt; Project Settings&lt;/strong&gt; in the Firebase console.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Sq-TH-W_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/569/1%2AJSd2ldUB28v4bSILlypfXA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Sq-TH-W_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/569/1%2AJSd2ldUB28v4bSILlypfXA.png" alt="Project Settings" width="569" height="221"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After selecting &lt;strong&gt;Project Settings&lt;/strong&gt; you will see various options, you have to choose &lt;strong&gt;Service Accounts&lt;/strong&gt;  options.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--m0ViILL6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1006/1%2ADnA2gelvhAchJ2ywiOPWug.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--m0ViILL6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1006/1%2ADnA2gelvhAchJ2ywiOPWug.png" alt="Service Accounts" width="880" height="188"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yv0MKSNt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2APv9SqC1GqCQuOWG3WQZanQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yv0MKSNt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2APv9SqC1GqCQuOWG3WQZanQ.png" alt="Service Account File" width="880" height="473"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This will download the file named as -firebase-adminsdk-.json. The file will contain information about the created service account, will contain different attributes defined below:-&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;This service file will help Node JS to know about the firebase account using the above details. The file will be saved on the server-side (Node JS) and will be used to initialize the firebase-admin.&lt;/p&gt;

&lt;p&gt;Now, this step is completed and we have the service account JSON file which will be used in Node JS.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3:- Creating Node JS script and implementing Admin SDK functions
&lt;/h3&gt;

&lt;p&gt;In this step, we will be going through a few steps :&lt;/p&gt;

&lt;h4&gt;
  
  
  a) Creating Node JS script:-
&lt;/h4&gt;

&lt;p&gt;To create a Node JS script, we will &lt;strong&gt;c&lt;/strong&gt; reate an &lt;strong&gt;index.js file&lt;/strong&gt; and &lt;strong&gt;run npm init&lt;/strong&gt; in the working directory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ npm init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The above command will create the &lt;strong&gt;&lt;em&gt;package.json&lt;/em&gt;&lt;/strong&gt; file in the working directory. Now you can create the &lt;strong&gt;&lt;em&gt;index.js&lt;/em&gt;&lt;/strong&gt; file (All logic will be contained by the index file). Once you have run the above command, the project structure will look like this:-&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mMIGBwN0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/291/1%2A1-_17l8nH7ybzjl8BD7RxA.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mMIGBwN0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/291/1%2A1-_17l8nH7ybzjl8BD7RxA.jpeg" alt="Project Structure" width="291" height="143"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Before implementing firebase-admin, we have to install some of the libraries that will help in implementing node script. To install the libraries run the below command:-&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ npm install _body-parser cors express firebase-admin_
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;To know more about &lt;a href="https://www.npmjs.com/package/body-parser"&gt;body-parser&lt;/a&gt;, &lt;a href="https://www.npmjs.com/package/cors"&gt;cors&lt;/a&gt;, &lt;a href="https://www.npmjs.com/package/express"&gt;express&lt;/a&gt; and &lt;a href="https://www.npmjs.com/package/firebase-admin"&gt;firebase-admin&lt;/a&gt; you can follow the links.&lt;/p&gt;

&lt;p&gt;Note — Check your project’s &lt;strong&gt;&lt;em&gt;package.json&lt;/em&gt;&lt;/strong&gt; file, it should contain the value stated below in the scripts section, else you can add it:-&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--l6vH7Oe0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/624/1%2AaueX2NUPIkFc-V1LCwNi7w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--l6vH7Oe0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/624/1%2AaueX2NUPIkFc-V1LCwNi7w.png" alt="package.json file" width="624" height="100"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  b) Implementing Firebase Admin SDK functions
&lt;/h4&gt;

&lt;p&gt;To implement firebase Admin SDK functions, we need to add that JSON file (Service account JSON file) that we got from Firebase Console. Simply add the file to the project folder. Once you add the file, the folder structure will look like:-&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9mfEFkix--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/291/1%2AcqlB-oVdslWnBwduaUv5Fg.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9mfEFkix--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/291/1%2AcqlB-oVdslWnBwduaUv5Fg.jpeg" alt="" width="291" height="210"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we will initialize several packages and further use them in node script, below is the script that uses &lt;strong&gt;&lt;em&gt;generateSignInWithEmailLink()&lt;/em&gt;&lt;/strong&gt; function of the firebase-admin SDK.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;In the above code, we have only implemented the &lt;strong&gt;&lt;em&gt;Email SignIn verification function&lt;/em&gt;&lt;/strong&gt; , firebase-admin has various more functionalities like:-&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Password reset email link&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const userEmail = 'user@example.com';

admin.auth()
  .generatePasswordResetLink(userEmail, actionCodeSettings)
  .then((link) =&amp;gt; {
    // Construct password reset email template, embed the link and send
    // using custom SMTP server.
    // TODO
    return sendCustomPasswordResetEmail(email, displayName, link);
 })
  .catch((error) =&amp;gt; {
    // Some error occurred.
 });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. Email Verification Link&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const useremail = 'user@example.com';
admin.auth()
  .generateEmailVerificationLink(useremail, actionCodeSettings)
  .then((link) =&amp;gt; {
    // Construct email verification template, embed the link and send
    // using custom SMTP server.
    // TODO
    return sendCustomVerificationEmail(useremail, displayName, link);
 })
  .catch((error) =&amp;gt; {
    // Some error occurred.
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  c) Using the Server Locally:-
&lt;/h4&gt;

&lt;p&gt;Now our Node script is ready, so we can now call the Endpoint defined in the script using the below URL (Line 26 in Script above).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[http://localhost:3000/](http://localhost:3000/)VerificationLink
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above URL can be hit to send the Email SignIn Email to the desired user, If you are using an Angular App then you can simply add the below code in the button click or in any action listener:-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const sendEmail = await this.http.post('[http://localhost:3000/](http://localhost:3000/)VerificationLink', userData).toPromise();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You have to pass in the userData as the Body data, in our case userData is defined as:-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const userData = { 
  name: 'myName', 
  email: 'myName@app.com'
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These are some basic functions that can be used in firebase-admin SDK, you can explore more on official firebase site and add more and more functionality to your app.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Now you have learned about Firebase admin SDK, you can explore more features for your app. It makes your app or database more customized from backend server. Specially when you desire some control of data from Admin side. If you want to explore any other feature, then you can visit &lt;a href="https://enappd.com/blog/"&gt;Enappd Blogs&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Next Steps
&lt;/h3&gt;

&lt;p&gt;If you liked this blog, you will also find the following Ionic blogs interesting and helpful. Feel free to ask any questions in the comment section&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ionic Payment Gateways — &lt;a href="https://enappd.com/blog/ionic-4-stripe-payment-integration-with-firebase-for-apps-and-pwa/17"&gt;Stripe&lt;/a&gt; | &lt;a href="https://enappd.com/blog/ionic-4-paypal-payment-integration-for-apps-and-pwa/16"&gt;PayPal&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-integrate-apple-pay-in-ionic-4-apps/21"&gt;Apple Pay&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-integrate-razorpay-in-ionic-4-apps-and-pwa/20"&gt;RazorPay&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Charts with — &lt;a href="https://enappd.com/blog/ionic-4-charts-using-google-charts/66"&gt;Google Charts&lt;/a&gt;| &lt;a href="https://enappd.com/blog/adding-charts-in-ionic-4-apps-and-pwa-part-3/60"&gt;HighCharts&lt;/a&gt; | &lt;a href="https://enappd.com/blog/adding-charts-in-ionic-4-apps-and-pwa-part-2/54"&gt;d3.js&lt;/a&gt; | &lt;a href="https://enappd.com/blog/charts-in-ionic-4-apps-and-pwa-part-1/52"&gt;Chart.js&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Social Logins — &lt;a href="https://enappd.com/blog/facebook-login-in-ionic-4-apps-using-firebase/25"&gt;Facebook&lt;/a&gt; | &lt;a href="https://enappd.com/blog/google-login-in-ionic-4-apps-using-firebase/39"&gt;Google&lt;/a&gt; | &lt;a href="https://enappd.com/blog/twitter-login-in-ionic-4-apps-using-firebase/24"&gt;Twitter&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Authentications — &lt;a href="https://enappd.com/blog/email-authentication-with-firebase-in-ionic-4/38"&gt;Via Email&lt;/a&gt; | &lt;a href="https://enappd.com/blog/firebase-anonymous-login-in-ionic-4/37"&gt;Anonymous&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Features — &lt;a href="https://enappd.com/blog/using-geolocation-geocoding-and-reverse-geocoding-in-ionic-4/45"&gt;Geolocation&lt;/a&gt; | &lt;a href="https://enappd.com/blog/qr-code-scanning-and-optical-character-recognition-ocr-in-ionic-4/9"&gt;QR Code reader&lt;/a&gt;| &lt;a href="https://enappd.com/blog/best-fitness-plugins-for-ionic-4-how-to-use-pedometer/15"&gt;Pedometer&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Media in Ionic — &lt;a href="https://enappd.com/blog/spotify-like-music-in-ionic-4-apps/48"&gt;Audio&lt;/a&gt; | &lt;a href="https://enappd.com/blog/adding-video-player-in-ionic-4-app/64"&gt;Video&lt;/a&gt; | &lt;a href="https://enappd.com/blog/image-picker-in-ionic-4-app/67"&gt;Image Picker&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-add-image-cropper-in-ionic-4-app/68"&gt;Image Cropper&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic Essentials — &lt;a href="https://enappd.com/blog/ionic-4-save-and-retrieve-data-locally-on-device/59"&gt;Native Storage&lt;/a&gt; | &lt;a href="https://enappd.com/blog/how-to-translate-in-ionic-4-globalization-internationalization-and-localization/11"&gt;Translations&lt;/a&gt; | &lt;a href="https://enappd.com/blog/rtl-right-to-left-use-in-ionic-4/50"&gt;RTL&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic messaging — &lt;a href="https://enappd.com/blog/implement-ionic-4-firebase-push/34"&gt;Firebase Push&lt;/a&gt; | &lt;a href="https://enappd.com/blog/automatically-read-sms-in-ionic-4-apps/42"&gt;Reading SMS&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ionic with Firebase — &lt;a href="https://enappd.com/blog/how-to-integrate-firebase-in-ionic-4-apps/23"&gt;Basics&lt;/a&gt; | &lt;a href="https://enappd.com/blog/firebase-with-ionic-4-hosting-auth-and-db-connection/58"&gt;Hosting and DB&lt;/a&gt; | &lt;a href="https://enappd.com/blog/firebase-cloud-functions-in-ionic-4-complete-guide/32"&gt;Cloud functions&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Ionic React Full App with Capacitor
&lt;/h3&gt;

&lt;p&gt;If you need a base to start your next Ionic 5 React Capacitor app, you can make your next awesome app using &lt;a href="https://store.enappd.com/product/ionic-react-full-app-capacitor/"&gt;Ionic 5 React Full App in Capacitor&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VtnFDcof--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/760/1%2AG3yOFVX4oABx9MhUy-3kng.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VtnFDcof--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/760/1%2AG3yOFVX4oABx9MhUy-3kng.png" alt="Ionic 5 React Full App in Capacitor from Enappd" width="760" height="479"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Ionic Capacitor Full App (Angular)
&lt;/h3&gt;

&lt;p&gt;If you need a base to start your next Angular &lt;strong&gt;Capacitor app&lt;/strong&gt; , you can make your next awesome app using &lt;a href="https://store.enappd.com/product/capacitor-full-app-with-ionic-angular/"&gt;Capacitor Full App&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3CTfBLjg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/736/0%2AUwSHcofTMStMnzAX.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3CTfBLjg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/736/0%2AUwSHcofTMStMnzAX.png" alt="Capacitor Full App with huge number of layouts and features" width="736" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Ionic Full App (Angular and Cordova)
&lt;/h3&gt;

&lt;p&gt;If you need a base to start your next Ionic 5 app, you can make your next awesome app using &lt;a href="https://store.enappd.com/product/ionic-full-app"&gt;Ionic 5 Full App&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--g_hLq_eU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/700/0%2A1ArpKyhiDHZnevwB.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--g_hLq_eU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/700/0%2A1ArpKyhiDHZnevwB.jpeg" alt="Ionic Full App with huge number of layouts and features" width="700" height="442"&gt;&lt;/a&gt;&lt;/p&gt;




</description>
      <category>heroku</category>
      <category>serverless</category>
      <category>node</category>
      <category>firebase</category>
    </item>
  </channel>
</rss>
