Installation
This chapter covers Source Code Setup, Plugin Installation, Facebook Login, Facebook Integration, One Signal Notification and OneSignal Integration.
Source Code Setup#
Now we have set up the Ionic-React environment.
For install Ionic-React environment use this link
You should have to install node modules in application first. For this purpose, apply following command
npm install
After node modules installation, if you find following error

Apply following command for successful compilation
npm rebuild node-sass
For configuration of your application#
We need to connect our app with woocommerce website. Open the folder name **(App Source Code)**inside the downloaded packages.
Inside the folder, you will find all the Ionic-React application code.
Now open project folder/src/providers/WooComAPI/woo-com-api.ts file and change the following.
- https://your-site.com (it will be the URL of your domain)
- consumer key
- consumer secret
It will load woocommerce products data into your application.

For application configurations:
- Color schemes You can change the application colours here.

- Theme mode(light/dark) By default you can get light theme mode. If you want to change application theme mode to dark, you can replace light with dark.

- Language(en/ar)
The app has english language as default.the app has 2 languages(English, Arabic) preinstalled. You can switch the language to arabic.
To change the default language of the app. Please open the file app/src/providers/WooComAPI/woo-comp-api.js at the top of the page you can find below code.

localStorage.languageCode =”en”
This is your language two letter code change it to arabic we have to put the arabic country code here. which is “ar“.
localStorage.languageDirection = “ltr”
Every language has its own direction. So if you change the application language then you also has to define its direction(ltr, rtl). For left to right use “ltr” and for right to left use “rtl”. In case of arabic we have to change this to =”rtl”.

Now we have to remove the cache of the browser to see the changes we have made.
Add new language#
App has only two languages. But you can add more languages.to add new language. Please open the app/src/provider/i18n/GlobalLanguageJson.js. This folder has one file GlobolLanguageJson.js. This file contains all the app labels.

For example we want to add french language we copy the “a2” object from GolabLanguageJson.js file and add a new object a3{}
Then we open the file in editor and replace the translation of all the labels on right side of the labels. like
we have Close: “Close” in english, we replace it with french like this. Close: “Fermer”
After translating all the labels save the file and then change the language code and direction. To make it default.
// For Example
//a3:{
//}

- Currency(USD/EUR)
Default currency is "USD". You can replace this with "EUR" to change currency.

The default currency symbol and format are set at the top of app/src/providers/WooComAPI/woo-com-api.ts:
localStorage.currency = "$"is the currency symbol, as its decimal character code. Find yours at html-css-js.com/html/character-codes/currency.localStorage.currencyCode = "USD"is the currency's ISO code, from the same page.localStorage.currencyPos = "left"puts the symbol left of the price. Change it to"right"to put it on the right.localStorage.decimals = 2is the number of decimals: with 2 a price shows as 6.00$, with 3 as 6.000$.
Clear the browser cache to see the change, or uninstall and rebuild the app if you're testing on a device.
- Navigation(Tabs/Side Menu)
Default navigation is "side". You can replace this with "tabs" to change applicaiton navigation.
For tabs, you have to replace false with true for tabs Navigation

You can need following file folder/src/providers/WooComAPI/woo-com-api.ts

Plugin Installation#
We have added JSON API and Ionic-React eCommerce plugins. These plugins can be installed in two ways.
You will find the JSON API and Ionic-React eCommerce plugins in a zipped folder in the pack.
Method 1#
- Upload the folder “JSON-API” to your WordPress Plugin folder (/wp-content/plugins)
- Now activate the plugin through the “plugins” menu in WordPress or by using the link provided by the plugin installer.
- Activate the controller through the JSON API menu found in the WordPress Admin Center (Settings->JSON API)
Method 2#
Go straight to the admin panel>Plugin>Add New.

The above-given page will show up. From here, click on the “upload plugin” option, make sure that the plugin that you have is in .zip format. Click on the “Browse” option, upload the plugin folder and once the folder is chosen, click on the “Install Now” option”
Once the plugin is installed, you can activate or deactivate the plugin through settings according to your usage.
After WordPress plugins installation and setup, please follow the below-mentioned instructions to set up your mobile application.
After Intallation of plugin need to activate the controllers from Settings >> Json APi

Ionic-React Woocommerce app works with woocommerce rest api, please follow the link below to enable woocommerce rest api on your server.
After enable rest api, please make sure your site woocommerce rest api working correctly. You can follow that simple tutorial link to check whether rest api works correctly on your sever or not.
Now you have all set at your wordpress site end. Please proceed with ionic source code setup.
Enable REST API & Generate API keys#
To enable the REST API with in WooCommerce, go to WooCommerce> Settings> Advanced and tick the Enable Legacy API link
The WooCommerce REST API works on a key system to control access. These keys are linked to WordPress users on your website.
To create or manage keys for specific WordPress user:
Go to: WooCommerce> Settings> Advanced> REST API
- Select Add Key
- Select the user you would like to generate a key for, in the user file and add a description.
- Choose the desired level of access for this API key , which can be Read access, Write access or Read/Write access.
- Select the Generate API key button and WooCommwrce will generate API keys for that certain user.Once the keys have been generated, you will see two new keys, a QRCode and a Revoke API Key button. These two keys are your Consumer Key and Consumer Secret.
- Place your site link, consumer key and consumer secret in the mobile application config file that uses the WooCommerce API.
Facebook Login#

This allows you to log in through your Facebook credentials. Here is the official link with the detailed demonstration of Facebook integration
Facebook App Id for application
File path for your facebook app id for application is
folder/android/app/src/main/res/values/string.xml

Facebook Integration#
You have to enable facebook from CMS.
For more details please visit
One Signal Notification#

To avail of this feature, you need to create OneSignal account and obtain both needed keys that are App ID and App key. Place them here and make this feature functional. You can offer various discount coupons to your distinguished customers that would appear in their app like this
Here is the official link that would guide you throughout the process of OneSignal account creation
OneSignal Integration#
Android#
Generate a Google Server API Key
Your Google Server API Key and Google Project Number are used to send push notifications to ANDROID devices.
To begin, we’ll obtain a Google Server API Key and Google Project Number. These keys allow OneSignal to use Google’s web push services for your notifications.
Create A Firebase Project
- Visit the Firebase Console and sign in with your Google account.

- Press “CREATE NEW PROJECT” or select an existing one below

Enter a project name and press “CREATE PROJECT”.

Firebase Cloud Messaging Token and Sender Id
Getting your Firebase Cloud Messaging token and Sender ID
- Click the Gear icon in the top left and select “Project settings”.
- Select the “CLOUD MESSAGING” tab.
- Save the two values listed:
- You’ll need your Server key, also known as the Google Server API key.
- You’ll need your Sender ID, also known as the Google Project Number, later as well

OneSignal App Android Setting
Configure your OneSignal app’s Android platform settings
- Go to Settings and press the Configure button to the right of Google Android.

Paste your Google Server API Key and Google Project Number in here and press Save.

After saving this server API Key and Sender ID from the firebase project, you can get the one signal app Id from the setting

and your sender id from the firebase project

Place the OneSignal app ID and the sender ID in src/providers/Redux/Reducers/state.ts and save the file. The Google Maps API key goes in the same file.

IOS#
Generate an IOS Push Certificate
Required for all IOS apps.
Required For Setup
- A OneSignal Account, if you do not already have one.
- Your OneSignal App Auth Key, available in Keys & IDs.
- A Mac with Xcode 8+. If you are using Xcode 7, PhoneGap Build, or Capacitor, follow this guide instead.
ProvisioningOption A: Create Certificate Request Manually
We recently released a tool to automate this process!
Make sure your role for the team is Admin inside your Apple Developer account > Membership section. Otherwise you will not be able to use this tool.
Simply follow the directions on OneSignal’s Provisionator Tool then continue to Step 4.
OROption B: Create Certificate Request Manually
- Open Keychain Access on your Mac OS X system. It may be located in “Applications” > “Utilities” > “Keychain Access“
- Select “Keychain Access” > “Certificate Assistant” > “Request a Certificate From a Certificate Authority…“.

Select the “Save to disk” option and enter your information in the required fields. This creates a certification request file that will be used

Enable Push Notification
To enable Push Notifications and apply the Certification Request to generate Certificate.
- Select your app from the Apple’s Developer site and press “Edit“.

- Scroll down to the bottom and enable Push Notifications. Press Done, but do not configure either Production or Development certificate.
- Instead, go to Add iOS Certificate and select “Apple Push Notification service SSL (Sandbox & Production)” and click Continue.
- This certificate will be applicable to both Sandbox and Production environments, so you do not need a separate key for each.

- Choose an App ID from the App ID pop-up menu.
- Press “Continue”.
- Press “Choose File…” select the “certSigningRequest” file you saved in step 1, press “open“, and then press “Generate“.

Press “Download” to save your certificate.

Creating A Private Key
- Open the .cer file you downloaded in the last step by double clicking on it in Finder.

After a few seconds the “Keychain Access” program should pop up. Select Login > My Certificates, then right click on your key in the list and select “Export“.

- Give the file a unique name using the .p12 extension, and press save. You will have an option to protect the file with a password. If you add a password, you need to enter this same password on OneSignal.
Upload Your Push
Upload Your Push Certificate to OneSignal.
If you haven’t already, you should set up your OneSignal account.
- Select your app from the All Apps page in OneSignal, then go to “App Settings” and press “Configure” to the right of the Apple iOS Settings.

Select the .p12 you exported along with a password that you added, and press Save.
