{"id":34993,"date":"2022-12-06T07:17:39","date_gmt":"2022-12-06T07:17:39","guid":{"rendered":"https:\/\/www.emizentech.com\/blog\/?p=34993"},"modified":"2022-12-06T07:17:44","modified_gmt":"2022-12-06T07:17:44","slug":"shopify-mobile-app-using-react-native","status":"publish","type":"post","link":"https:\/\/multisitelocal.ezxdemo.com\/blog\/shopify-mobile-app-using-react-native.html","title":{"rendered":"How To Build Shopify Mobile App Using React Native: Shopify Store Into Mobile App"},"content":{"rendered":"\n<p class=\"has-drop-cap\">Today, it&#8217;s damn easy to convert your Shopify Store into a native app. Kudos to React Native Shopify template.&nbsp;<\/p>\n\n\n\n<p>In this post, we will describe every step in detail to help you integrate the app template with your Shopify online storefront.&nbsp;<\/p>\n\n\n\n<p>The best part is the below steps don&#8217;t demand any prior coding experience. Even non-coders can transform their Shopify store into a mobile app with no additional hassle.&nbsp;<\/p>\n\n\n\n<p><strong>Things You Need to Make Your App Publish-Ready on App Stores &#8211; Quick Recap<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Change two API keys to link your Shopify online store to the downloaded app template.<\/li><li>Pick a Checkout Method<\/li><li>Optional &#8211; Create your Stripe account (used for mobile payments) and link it if you choose to follow the native checkout mode.<\/li><li>Run the app on Android<\/li><li>Run the app on iOS<\/li><\/ul>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_81 counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #007db2;color:#007db2\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #007db2;color:#007db2\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/multisitelocal.ezxdemo.com\/blog\/shopify-mobile-app-using-react-native.html#Steps_to_Turn_Your_Shopify_Store_Into_a_Mobile_App\" >Steps to Turn Your Shopify Store Into a Mobile App<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/multisitelocal.ezxdemo.com\/blog\/shopify-mobile-app-using-react-native.html#Are_You_Looking_for_An_Ecommerce_Development_Company\" >Are You Looking for An Ecommerce Development Company?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/multisitelocal.ezxdemo.com\/blog\/shopify-mobile-app-using-react-native.html#Convert_Sell_UPTO_5X_More_On_Mobile\" >Convert &amp; Sell UPTO 5X More On Mobile<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/multisitelocal.ezxdemo.com\/blog\/shopify-mobile-app-using-react-native.html#Shopify_Mobile_App_Implementation_From_Scratch\" >Shopify Mobile App Implementation From Scratch<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/multisitelocal.ezxdemo.com\/blog\/shopify-mobile-app-using-react-native.html#Do_You_Want_to_Turn_Your_Shopify_Store_Into_a_Mobile_App\" >Do You Want to Turn Your Shopify Store Into a Mobile App?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/multisitelocal.ezxdemo.com\/blog\/shopify-mobile-app-using-react-native.html#Wrapping_Lines\" >Wrapping Lines<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Steps_to_Turn_Your_Shopify_Store_Into_a_Mobile_App\"><\/span><strong>Steps to Turn Your Shopify Store Into a Mobile App<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 1: Link Your Shopify Storefront<\/strong><\/h3>\n\n\n\n<p>The first and foremost step is to set up your mobile app to transform your Shopify Store into a native eCommerce mobile app.&nbsp;<\/p>\n\n\n\n<p>Here, you need to link your Shopify site to the React Native template. This will help you to categorize your products and display them within the app.&nbsp;<\/p>\n\n\n\n<div style=\"background-color:#8ed1fc;text-align:center\" class=\"wp-block-genesis-blocks-gb-cta gb-block-cta gb-font-size-16\"><div class=\"gb-cta-content\"><h2 class=\"gb-cta-title gb-font-size-32\" style=\"color:#000000\"><span class=\"ez-toc-section\" id=\"Are_You_Looking_for_An_Ecommerce_Development_Company\"><\/span>Are You Looking for An Ecommerce Development Company?<span class=\"ez-toc-section-end\"><\/span><\/h2><div class=\"gb-cta-text gb-font-size-32\" style=\"color:#000000\"><p><strong>Make Your Online Business Stand out With Our Custom Shopify Development Service<\/strong><\/p><\/div><\/div><div class=\"gb-cta-button\"><a href=\"https:\/\/multisitelocal.ezxdemo.com\/enqiry.html?utm_source=blog&amp;utm_medium=gb&amp;utm_campaign=shopifynativeappdevelopment\" target=\"_self\" rel=\"noopener noreferrer\" class=\"gb-button gb-button-shape-rounded gb-button-size-medium\" style=\"color:#ffffff;background-color:#000000\">Get In Touch!<\/a><\/div><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 2.1: Generate an Access Token to Access Your Shopify Storefront<\/strong><\/h3>\n\n\n\n<p>To access your Shopify store from your new mobile app, you will need an access token. You can generate it following the simple steps below:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Login to the Shopify admin dashboard of the store to which you want to connect.<\/li><li>In Shopify, create an App to act as a middleware by filling a simple, short form.<\/li><li>After you create an App, copy the storefront access token (you generated).&nbsp;<\/li><\/ul>\n\n\n\n<p><strong>Let&#8217;s Describe These Steps in Detail to Get It Clear.&nbsp;<\/strong><\/p>\n\n\n\n<p><strong>a)<\/strong> On your Shopify admin dashboard, on the left menu list, click &#8220;<strong>Apps<\/strong>.&#8221;&nbsp;<\/p>\n\n\n\n<p><strong>b)<\/strong> Near the bottom of the page, click &#8220;<strong>Manage private apps<\/strong>.&#8221;&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"579\" src=\"https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/12\/Manage-private-apps.png\" alt=\"Manage private apps\" class=\"wp-image-35035\" srcset=\"https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/12\/Manage-private-apps.png 1024w, https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/12\/Manage-private-apps-300x170.png 300w, https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/12\/Manage-private-apps-768x434.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>c)<\/strong> Click &#8220;<strong>Create a new private app<\/strong>.&#8221;&nbsp;<\/p>\n\n\n\n<p><strong>d)<\/strong> In the &#8220;<strong>App Details<\/strong>&#8221; section, type a name for your private app along with an email address (for your connection).<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-style-default is-layout-flow wp-block-quote-is-layout-flow\"><p><strong><em>Note:<\/em><\/strong><em> Shopify Uses This Email Address to Connect with The Developer if Caught up With an Issue with The Private App).<\/em><\/p><\/blockquote>\n\n\n\n<p><strong>e)<\/strong> In the &#8220;<strong>Admin API<\/strong>&#8221; section, select the store areas that you want your app to access.&nbsp;<\/p>\n\n\n\n<p><strong>f)<\/strong> Be sure you tick the <strong>checkbox<\/strong> to *<strong>Allow<\/strong>* app to access your Shopify Store data.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1024\" height=\"579\" src=\"https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/12\/access-your-Shopify-Store-data.png\" alt=\"access your Shopify Store data\" class=\"wp-image-35036\" srcset=\"https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/12\/access-your-Shopify-Store-data.png 1024w, https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/12\/access-your-Shopify-Store-data-300x170.png 300w, https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/12\/access-your-Shopify-Store-data-768x434.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>g)<\/strong> In the &#8220;<strong>Storefront API permissions<\/strong>&#8221; section, choose which data type you want to show to the app.&nbsp;<\/p>\n\n\n\n<p><strong>h)<\/strong> Click &#8220;<strong>Save<\/strong>,&#8221; and an access token of your store will be created.&nbsp;<\/p>\n\n\n\n<p>After the creation of your access token, you will be directed to a page including different sections as below:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>App Details.<\/li><li>Admin API.<\/li><li>Storefront API.<\/li><\/ul>\n\n\n\n<p>Now, scroll down to the bottom of the page to see and copy the newly crafted Storefront access token to your clipboard.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1023\" height=\"462\" src=\"https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/12\/newly-crafted-Storefront.png\" alt=\"newly crafted Storefront\" class=\"wp-image-35037\" srcset=\"https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/12\/newly-crafted-Storefront.png 1023w, https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/12\/newly-crafted-Storefront-300x135.png 300w, https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/12\/newly-crafted-Storefront-768x347.png 768w\" sizes=\"(max-width: 1023px) 100vw, 1023px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 2.2:&nbsp;<\/strong><\/h3>\n\n\n\n<p>Update the Shopify Store URL and Storefront Token in the React Native Code<\/p>\n\n\n\n<p>Now, after you have a storefront token, you need to add it to the app.&nbsp;<\/p>\n\n\n\n<p>Just open the <strong>src\/ShopertinoConfig.js<\/strong> file and override the Shopify configuration with your storefront data.&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>shopifyConfig: {\n  domain: 'your_store.myshopify.com',\n  storefrontAccessToken: 'accessTokencb72e4222c9b90332662fa39e93f',\n  apiKey: 'apiKey123121',\n  password: 'your_password',\n},<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 3: Select Your Checkout Method<\/strong><\/h3>\n\n\n\n<p>Shopify app supports two types of checkout:<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">a) <strong>Shopify Webview&nbsp;<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\"><li>This is the case when the customer looks to place an order &#8211; The app opens your Shopify checkout web page in a web view. After that, they pay and place their order (similar to what they do in your store). Ahead, the payment falls straight into your Shopify storefront, similarly as it does for your website checkouts.&nbsp;<\/li><li>This method is not for the one who uses Android Pay and Apple Pay, as the payment is completed through a webview, not natively.&nbsp;<\/li><\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">b) <strong>Stripe Payments<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\"><li>This uses Stripe for payment processing and is natively done directly in React Native (no webview).<\/li><li>This supports just one-click orders with Android Pay and Apple Pay, as everything is done completely natively.&nbsp;<\/li><li>The money falls into your Stripe account, and the orders start being showcased in your Shopify dashboard.&nbsp;<\/li><\/ul>\n\n\n\n<p>To choose the right checkout method, just open src\/ShopertinoConfig.js and set the &#8220;isStripeCheckoutEnabled&#8221; flag value to:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>True<\/strong>, which allows native Stripe Payments. (Stripe Setup Required)<\/li><li><strong>False<\/strong>, Which allows Shopify Webview put off payment processing to your site.&nbsp;<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 4: Running on iOS<\/strong><\/h3>\n\n\n\n<p>First, be sure you installed the npm packages (&#8220;npm install&#8221;).&nbsp;<\/p>\n\n\n\n<p>Various React Native templates choose advanced npm packages, like Facebook SDKs or Firebase, that need to be linked.&nbsp;<\/p>\n\n\n\n<p>The app doesn&#8217;t work with Expo and can&#8217;t just run by executing&nbsp; \u201creact-native run-ios,&#8221; either.<\/p>\n\n\n\n<p>So, to run your app on iOS, a MacOS computer is needed. Windows users are unlucky here, as they will have to get either an Apple computer or install a virtual machine on their laptop.&nbsp;<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-style-default is-layout-flow wp-block-quote-is-layout-flow\"><p><strong><em>Note:<\/em><\/strong><em> To develop an eCommerce app for iOS from Shopify&#8217;s premium app template, first, you need to install Xcode and Cocoapods.&nbsp;<\/em><\/p><\/blockquote>\n\n\n\n<p>In your project&#8217;s directory, open your Terminal, and switch to the &#8220;ios&#8221; subfolder, to install the pods by executing:<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Input:<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code><strong><em>cd ios &amp;&amp; pod install<\/em><\/strong><\/code><\/pre>\n\n\n\n<p>This will install every dependency on which your iOS mobile app template depends.&nbsp;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Output:&nbsp;<\/strong><\/h4>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"754\" height=\"301\" src=\"https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/12\/cd-ios-pod-install-output.png\" alt=\"cd ios and pod install output\" class=\"wp-image-35038\" srcset=\"https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/12\/cd-ios-pod-install-output.png 754w, https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/12\/cd-ios-pod-install-output-300x120.png 300w\" sizes=\"(max-width: 754px) 100vw, 754px\" \/><figcaption><a href=\"https:\/\/instamobile.io\/turn-shopify-store-into-app\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Source<\/a><\/figcaption><\/figure>\n\n\n\n<p>Next, below the <strong>&#8220;ios&#8221;<\/strong> folder, you will find a file, <strong>&#8220;Shopertino.xcworkspace&#8221;<\/strong>. You need to open it in Xcode, and then, first, by choosing which simulator or device you want, run the app.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"533\" src=\"https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/12\/shopify-store-into-app.png\" alt=\"shopify store into app\" class=\"wp-image-35039\" srcset=\"https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/12\/shopify-store-into-app.png 1024w, https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/12\/shopify-store-into-app-300x156.png 300w, https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/12\/shopify-store-into-app-768x400.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption><a href=\"https:\/\/instamobile.io\/turn-shopify-store-into-app\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Source<\/a><\/figcaption><\/figure>\n\n\n\n<p>This will automatically open up a metro bundler instance.&nbsp;<\/p>\n\n\n\n<p>If it fails to start, just run &#8220;npm start\u201d in the Terminal to open it. And after that, only run the app in Xcode again.&nbsp;<\/p>\n\n\n\n<p>If you are facing any other issues, you can connect with our Shopify experts.&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 5: Running on Android<\/strong><\/h3>\n\n\n\n<p>To run your Shopify app template on Android, just open an Android emulator (or just plug in a device) and run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong><em>npm install &amp;&amp; react-native run-android<\/em><\/strong><\/code><\/pre>\n\n\n\n<p>This step will include dev environment setup also if you are doing this first time.\u00a0\u00a0<\/p>\n\n\n\n<div style=\"background-color:#8ed1fc;text-align:center\" class=\"wp-block-genesis-blocks-gb-cta gb-block-cta\"><div class=\"gb-cta-content\"><h2 class=\"gb-cta-title gb-font-size-32\" style=\"color:#000000\"><span class=\"ez-toc-section\" id=\"Convert_Sell_UPTO_5X_More_On_Mobile\"><\/span>Convert &amp; Sell UPTO 5X More On Mobile<span class=\"ez-toc-section-end\"><\/span><\/h2><div class=\"gb-cta-text gb-font-size-32\" style=\"color:#000000\"><p><strong>Convert Your Shopify Store Into Mobile App<\/strong><\/p><\/div><\/div><div class=\"gb-cta-button\"><a href=\"https:\/\/multisitelocal.ezxdemo.com\/enqiry.html?utm_source=blog&amp;utm_medium=gb&amp;utm_campaign=shopifynativeappdevelopment\" target=\"_self\" rel=\"noopener noreferrer\" class=\"gb-button gb-button-shape-rounded gb-button-size-medium\" style=\"color:#ffffff;background-color:#000000\">Get In Touch!<\/a><\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Shopify_Mobile_App_Implementation_From_Scratch\"><\/span><strong>Shopify Mobile App Implementation From Scratch<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. <strong>Installation<\/strong><\/h3>\n\n\n\n<ol class=\"wp-block-list\"><li>We will use <a href=\"https:\/\/github.com\/Shopify\/js-buy-sdk#installation\" target=\"_blank\" rel=\"noreferrer noopener nofollow\"><strong>shopify-buy <\/strong>SDK<\/a>.&nbsp;<\/li><\/ol>\n\n\n\n<ol class=\"wp-block-list\" start=\"2\"><li>In the terminal, run the following command-<\/li><\/ol>\n\n\n\n<p>With Yarn:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong><em>yarn add shopify-buy<\/em><\/strong><\/code><\/pre>\n\n\n\n<p><strong><em><\/em><\/strong><strong><em> <\/em><\/strong><strong><em>OR<\/em><\/strong><\/p>\n\n\n\n<p>With NPM:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong><em>npm install shopify-buy<\/em><\/strong><\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"330\" src=\"https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/12\/npm-install-shopify-buy-1024x330.png\" alt=\"\u00a0npm install shopify-buy\" class=\"wp-image-35040\" srcset=\"https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/12\/npm-install-shopify-buy-1024x330.png 1024w, https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/12\/npm-install-shopify-buy-300x97.png 300w, https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/12\/npm-install-shopify-buy-768x247.png 768w, https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/12\/npm-install-shopify-buy.png 1068w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>How to Use the Plugin<\/strong>:<\/h4>\n\n\n\n<p><strong>Note- <\/strong>We will create a separate file for Shopify functions, and&nbsp;<\/p>\n\n\n\n<p>We have named it <strong>shopifyServices.js.<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"330\" src=\"https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/12\/We-have-named-it-shopifyServices.js_.-1024x330.png\" alt=\"We have named it shopifyServices.js.\" class=\"wp-image-35041\" srcset=\"https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/12\/We-have-named-it-shopifyServices.js_.-1024x330.png 1024w, https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/12\/We-have-named-it-shopifyServices.js_.-300x97.png 300w, https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/12\/We-have-named-it-shopifyServices.js_.-768x247.png 768w, https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/12\/We-have-named-it-shopifyServices.js_..png 1068w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">2. <strong>Initializing the Client<\/strong>:<\/h3>\n\n\n\n<p>If your Shopify store supports various languages, Storefront API can return the translated resource types and fields.&nbsp;<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><strong>Import Library in Your App Code-<\/strong><\/li><\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>import Client from 'shopify-buy';\n<\/code><\/pre>\n\n\n\n<ol class=\"wp-block-list\" start=\"2\"><li><strong>Initializing the Client<\/strong><\/li><\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ Initializing a client to return content in the store's \nprimary language\nconst client = Client.buildClient({\n  domain: 'your-shop-name.myshopify.com',\n  storefrontAccessToken: 'your-storefront-access-token'\n});\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"330\" src=\"https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/12\/Initializing-the-Client-1024x330.png\" alt=\"Initializing the Client\" class=\"wp-image-35042\" srcset=\"https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/12\/Initializing-the-Client-1024x330.png 1024w, https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/12\/Initializing-the-Client-300x97.png 300w, https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/12\/Initializing-the-Client-768x247.png 768w, https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/12\/Initializing-the-Client.png 1068w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<blockquote class=\"wp-block-quote is-style-default is-layout-flow wp-block-quote-is-layout-flow\"><p><strong>&nbsp;&nbsp;Note- domain:<\/strong> will be your Shopify domain<\/p><\/blockquote>\n\n\n\n<p><strong>storefrontAccessToken:<\/strong> This will be the Storefront access token<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. <strong>Fetching Products<\/strong><\/h3>\n\n\n\n<ol class=\"wp-block-list\"><li><strong>Fetch All Products in Your Shop<\/strong><\/li><\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ Fetch all products in your shop\n \nexport async function fetchAllProducts() {\n \n   return client.collection.fetchAll();\n}\n<\/code><\/pre>\n\n\n\n<p>You can fetch all the products by accessing this function,<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>var products = await fetchAllProducts(); \n<\/code><\/pre>\n\n\n\n<ol class=\"wp-block-list\" start=\"2\"><li><strong>Fetch Single Product by Id<\/strong><\/li><\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ Fetch a single product by ID\n \nconst productId = 'gid:\/\/shopify\/Product\/7857989384';\n \nexport async function fetchSingleProduct() {\n \n   return client.product.fetch(productId);\n}\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">4. <strong>Fetching Collections<\/strong>:<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ Fetch all collections, including their products\nexport async function fetchCollections() {\n \n   return client.product.fetchAllWithProducts();\n}\n<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Fetch Single Collection by ID<\/strong><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ Fetch a single collection by ID, including its products\nexport async function fetchCollectionById() {\n   \/\/collectId which do you want to fetch\n   const collectionId = 'gid:\/\/shopify\/Collection\/369312584';\n \n   return client.product.fetchWithProducts(collectionId);\n}\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">5. <strong>Creating Empty Checkout<\/strong>:<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ Create an empty checkout\nexport async function createCheckout() {\n \n   return  client.checkout.create();;\n}\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">6. <strong>Updating Checkout Attributes<\/strong>:<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ Updating checkout attributes\nexport async function updateAttributes() {\n   const checkoutId = 'gid:\/\/shopify\/Checkout\/e3bd71f7248c806f33725a53e33931ef?key=47092e448529068d1be52e5051603af8';\n   const input = {customAttributes: &#091;{key: \"MyKey\", value: \"MyValue\"}]};\n   return  client.checkout.updateAttributes(checkoutId, input);\n}\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">7. <strong>Adding Line Items:<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ Adding Line Items\nexport async function addLineItems() {\n   const checkoutId = 'gid:\/\/shopify\/Checkout\/e3bd71f7248c806f33725a53e33931ef?key=47092e448529068d1be52e5051603af8'; \/\/ ID of an existing checkout\n   const lineItemsToAdd = &#091;\n     {\n       variantId: 'gid:\/\/shopify\/ProductVariant\/29106064584',\n       quantity: 5,\n       customAttributes: &#091;{key: \"MyKey\", value: \"MyValue\"}]\n     }\n   ];\n   return  client.checkout.addLineItems(checkoutId, lineItemsToAdd);\n}\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">8. <strong>Updating Line Items<\/strong>: <\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ Updating Line Items\nexport async function updateLineItems() {\n   const checkoutId = 'gid:\/\/shopify\/Checkout\/e3bd71f7248c806f33725a53e33931ef?key=47092e448529068d1be52e5051603af8'; \/\/ ID of an existing checkout\n   const lineItemsToUpdate = &#091;\n       {\n           id: 'gid:\/\/shopify\/CheckoutLineItem\/194677729198640?checkout=e3bd71f7248c806f33725a53e33931ef',\n           quantity: 2\n       }\n   ];\n \n   return client.checkout.updateLineItems(checkoutId, lineItemsToUpdate);\n}\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">9. <strong>Removing Line Items<\/strong>: <\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ Removing Line Items\n \nexport async function removeLineItems() {\n   const checkoutId = 'gid:\/\/shopify\/Checkout\/e3bd71f7248c806f33725a53e33931ef?key=47092e448529068d1be52e5051603af8'; \/\/ ID of an existing checkout\n   const lineItemIdsToRemove = &#091;\n     'gid:\/\/shopify\/CheckoutLineItem\/194677729198640?checkout=e3bd71f7248c806f33725a53e33931ef',\n     'gid:\/\/shopify\/CheckoutLineItem\/194688829198640?checkout=e3bd71f7248c806f33725a53e3345gtd'\n   ];\n   return client.checkout.removeLineItems(checkoutId, lineItemIdsToRemove);\n}\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">10. <strong>Fetching Checkout: <\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ Fetching a Checkout\n \nexport async function fetchCheckout() {\n   const checkoutId = 'gid:\/\/shopify\/Checkout\/e3bd71f7248c806f33725a53e33931ef?key=47092e448529068d1be52e5051603af8'; \/\/ ID of an existing checkout\n \n   return client.checkout.fetch(checkoutId);\n}\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">11. <strong>Adding a Discount<\/strong>: <\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ Adding a Discount\n \nexport async function addDiscount() {\n   const checkoutId = 'gid:\/\/shopify\/Checkout\/e3bd71f7248c806f33725a53e33931ef?key=47092e448529068d1be52e5051603af8'; \/\/ ID of an existing checkout\n   const discountCode = 'best-discount-ever';\n   return client.checkout.addDiscount(checkoutId, discountCode);\n}\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>12. Removing a Discount<\/strong>:<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ Removing a Discount\nexport async function removeDiscount() {\n   const checkoutId = 'gid:\/\/shopify\/Checkout\/e3bd71f7248c806f33725a53e33931ef?key=47092e448529068d1be52e5051603af8'; \/\/ ID of an existing checkout\n \n   return client.checkout.removeDiscount(checkoutId);\n}\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">13. <strong>Updating a Shipping Address<\/strong>:<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ Updating a Shipping Address\nexport async function updateShippingAddress() {\n   const checkoutId = 'gid:\/\/shopify\/Checkout\/e3bd71f7248c806f33725a53e33931ef?key=47092e448529068d1be52e5051603af8'; \/\/ ID of an existing checkout\n \nconst shippingAddress = {\n  address1: 'Chestnut Street 92',\n  address2: 'Apartment 2',\n  city: 'Louisville',\n  company: null,\n  country: 'United States',\n  firstName: 'Bob',\n  lastName: 'Norman',\n  phone: '555-625-1199',\n  province: 'Kentucky',\n  zip: '40202'\n};\n \n   return client.checkout.updateShippingAddress(checkoutId, shippingAddress);\n}\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">14. <strong>Completing a Checkout<\/strong>:<\/h3>\n\n\n\n<p>You can complete a checkout easily by using the weburl property that&#8217;s returned after checkout is created. Also, this URL redirects the customer to the online checkout of Shopify to complete the order.&nbsp;<\/p>\n\n\n\n<p>After you create a checkout, you will get the checkout webhook URL.&nbsp;<\/p>\n\n\n\n<p>The web checkout URL will be showcased using the app webview.&nbsp;<\/p>\n\n\n\n<p><strong><em><a href=\"https:\/\/www.npmjs.com\/package\/react-native-webview\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Install react-native-webview<\/a><\/em><\/strong><\/p>\n\n\n\n<p>Let&#8217;s take an example:<\/p>\n\n\n\n<p><strong>Code Example-<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;WebView source={{ uri: 'https:\/\/reactnative.dev\/' }} \/&gt;\n<\/code><\/pre>\n\n\n\n<p>Replace uri<strong> &#8216;https:\/\/reactnative.dev\/&#8217; <\/strong>with the checkout webhook url.<\/p>\n\n\n\n<div style=\"background-color:#8ed1fc;text-align:center\" class=\"wp-block-genesis-blocks-gb-cta gb-block-cta\"><div class=\"gb-cta-content\"><h2 class=\"gb-cta-title gb-font-size-32\" style=\"color:#000000\"><span class=\"ez-toc-section\" id=\"Do_You_Want_to_Turn_Your_Shopify_Store_Into_a_Mobile_App\"><\/span>Do You Want to Turn Your Shopify Store Into a Mobile App?<span class=\"ez-toc-section-end\"><\/span><\/h2><div class=\"gb-cta-text gb-font-size-32\" style=\"color:#000000\"><p><strong>If So, We Are Available to Assist You.<\/strong><\/p><\/div><\/div><div class=\"gb-cta-button\"><a href=\"https:\/\/multisitelocal.ezxdemo.com\/enqiry.html?utm_source=blog&amp;utm_medium=gb&amp;utm_campaign=shopifynativeappdevelopment\" target=\"_self\" rel=\"noopener noreferrer\" class=\"gb-button gb-button-shape-rounded gb-button-size-medium\" style=\"color:#ffffff;background-color:#000000\">Get In Touch!<\/a><\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Wrapping_Lines\"><\/span><strong>Wrapping Lines<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>We hope we have stated both ways of <a href=\"https:\/\/multisitelocal.ezxdemo.com\/blog\/how-to-convert-shopify-store-into-app.html\">developing the Shopify mobile app<\/a> using React Native Shopify Template and from scratch.\u00a0<\/p>\n\n\n\n<p>While wrapping up, we hope you find it easy to develop a Shopify app using <a href=\"https:\/\/multisitelocal.ezxdemo.com\/hire-react-native-developers.html\">React Native<\/a>. Still, if you have any confusion, you can hire a <a href=\"https:\/\/multisitelocal.ezxdemo.com\/shopify-mobile-app-development.html\">Shopify mobile app development<\/a> company with a team of experts who can meet your business needs seamlessly.\u00a0<\/p>\n\n\n\n<div class=\"wp-block-genesis-blocks-gb-accordion gb-block-accordion gb-font-size-21\"><details open><summary class=\"gb-accordion-title\"><strong>What Should I Read Next?<\/strong><\/summary><div class=\"gb-accordion-text\">\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/multisitelocal.ezxdemo.com\/blog\/shopify-review.html\" target=\"_blank\" rel=\"noreferrer noopener\">Shopify Review: Features, Pricing To Build an eCommerce Store<\/a><\/li><li><a href=\"https:\/\/multisitelocal.ezxdemo.com\/blog\/checklist-to-follow-before-your-shopify-site-launch.html\" target=\"_blank\" rel=\"noreferrer noopener\">Checklist To Follow Before Your Shopify Site Launch<\/a><\/li><li><a href=\"https:\/\/multisitelocal.ezxdemo.com\/blog\/why-choose-shopify-for-dropshipping-ecommerce.html\" target=\"_blank\" rel=\"noreferrer noopener\">Why Choose Shopify for Dropshipping Ecommerce?<\/a><\/li><li><a href=\"https:\/\/multisitelocal.ezxdemo.com\/blog\/what-is-shopify.html\" target=\"_blank\" rel=\"noreferrer noopener\">What Is Shopify? Know All About It<\/a><\/li><li><a href=\"https:\/\/multisitelocal.ezxdemo.com\/blog\/shopify-vs-wix.html\" target=\"_blank\" rel=\"noreferrer noopener\">Shopify VS Wix \u2013 A Comparison To Choose The Best<\/a><\/li><li><a href=\"https:\/\/multisitelocal.ezxdemo.com\/blog\/shopify-app-for-wholesale.html\" target=\"_blank\" rel=\"noreferrer noopener\">Best Shopify App for Wholesale<\/a><\/li><\/ul>\n<\/div><\/details><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Today, it&#8217;s damn easy to convert your Shopify Store into a native app. Kudos to React Native Shopify template.&nbsp; In this post, we will describe every step in detail to help you integrate the app template with your Shopify online storefront.&nbsp; The best part is the below steps don&#8217;t demand any prior coding experience. Even<\/p>\n","protected":false},"author":42,"featured_media":35046,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"MSN_Categories":"Uncategorized","MSN_Publish_Option":false,"MSN_Is_Local_News":false,"MSN_Is_AIAC_Included":"Empty","MSN_Location":"[]","MSN_Add_Feature_Img_On_Top_Of_Post":false,"MSN_Has_Custom_Author":false,"MSN_Custom_Author":"","MSN_Has_Custom_Canonical_Url":false,"MSN_Custom_Canonical_Url":"","_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[80],"tags":[],"class_list":{"0":"post-34993","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-shopify"},"modified_by":"Marketing EmizenTech","featured_image_src":"https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/12\/How-To-Build-Shopify-Mobile-App-Using-React-Native-600x400.jpg","featured_image_src_square":"https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/12\/How-To-Build-Shopify-Mobile-App-Using-React-Native-600x408.jpg","author_info":{"display_name":"Ajit Jain","author_link":"https:\/\/multisitelocal.ezxdemo.com\/blog\/author\/ajitjain11"},"_links":{"self":[{"href":"https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-json\/wp\/v2\/posts\/34993","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-json\/wp\/v2\/users\/42"}],"replies":[{"embeddable":true,"href":"https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-json\/wp\/v2\/comments?post=34993"}],"version-history":[{"count":0,"href":"https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-json\/wp\/v2\/posts\/34993\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-json\/wp\/v2\/media\/35046"}],"wp:attachment":[{"href":"https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-json\/wp\/v2\/media?parent=34993"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-json\/wp\/v2\/categories?post=34993"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/multisitelocal.ezxdemo.com\/blog\/wp-json\/wp\/v2\/tags?post=34993"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}