gikApp – React Native Full App Docs

1.Introduction

All the features you will love

  • WordPress Integration via REST API
  • OneSignal Notification
  • RTL
  • Multi Languages
  • Offline Mode Reading
  • Shopify Full Integration
  • The Beatuy Store UI
  • Sidebar with multi-level Menu
  • Your page template
  • Infinite Lazy load
  • Social Shareing feature
  • Contact page
  • Clean code, no bullshit!
  • Best UI/UX Practices

Website & Video:

Click here to know more: https://codecanyon.net/item/gikapp-react-native-full-application/19465924?s_rank=1

Supporting websitehttps://support.reactaz.com/gikapp-react-native-full-app-docs/

Installing video: https://www.youtube.com/embed/-eK1mQN766E

gikApp – Full App Demo

gikApp – Shopify Full Integration Demo

2.Set Up

2.1.How to install a new source

In order to setup for React Native (RN) template you should connect to the internet and install dependencies library. If you have not chanced to set it up with React Native, please take a look to the document here: https://facebook.github.io/react-native/docs/getting-started.html

Step 1:  Installing

  • Unzip the downloaded code from Code Canyon.
  • Using the terminal, issue the following command.

npm install
This will install all the required modules for your app.

Step 2: Linking Libraries

Link your native dependencies:

$ react-native link

Done! All libraries with a native dependencies should be successfully linked to your iOS/Android project.

Step 3: Starting the server.

By using these command line:

npm start

  • To simulate for iOS
    • Method One:
      • Open the project in XCode from ios/[yourProject].xcodeproj
      • Hit button to simulate.
    • Method Two: 
      • In your terminal, type:
        react-native run-ios
  • To simulate for Android
    • Make sure you have an Android emulator installed and running.
    • In your terminal, type:
      react-native run-android

 

2.2.Video Tutorial

Let’s see quick installing guide in the following video:

3.Project structure

The gikApp project files/folders inside this main-folder …\src\*:

  • app.js: Everything is started from here.
    • components\install\start.android.js – Android-stuff is started from here.
    • components\install\start.ios.js – iOS-stuff is started from here.
  • settings\global.js: Include all settings for gikApp, used at home-page, contact-page, menu, etc…
  • components\core\sidemenu.js: LOCs for rendering menu.
  • components\wordpress: Any screens used for rendering WordPress contents (page, post list, post detail). Also include widgets for showing up content on home-page: image_swiper_widget.js (show banner), image_single_widget.js (show image), article_list_widget.js (show latest-articles).
  • components\shopify: Any screens used for rendering Shopify contents (Collection, Product detail, Search Page,…). Also include widgets for showing up content on home-page.
  • services\wordpress.service.js: A service for fetching data from WordPress.
  • services\shopify.service.js: A service for fetching data from Shopify.
  • services\helper.service.js: A helping-service, it includes any helpful-functions such as: isEmail (validate email), displayDateWordpress (show date by predefined-date-format from a complicated-date-string), LaunchURL (open an url refer to app),…

4.Wordpress integration via Rest API

Video Tutorial

4.2.Config Wordpress "domain"

Step 1: Go to: …src\settings\global.js
Step 2: Find out key “domain” Global>INTEGRATE>wordpress>domain, change yours, Ex: dev.gikapp.com (follow gikApp)

4.3.Config "Menu"

Step 1: Go to your theme: …\src\themes\[your_theme]\index.js
Step 2: Find out key “WordPressService.startWordpressApp“, change param to yours, Ex: 17 (follow gikApp)

4.4.Config "Front-page"

Step 1: Go to your theme: …src\themes\[your_theme]\common\config.js
Step 2: Find out key Global>HOMEPAGES_CONFIG>widgets, need to update widgets data by changing category-id / post-id at keys linkValue/sourceValue.

5.Shopify Full Integration

5.1.Config Shopify "Domain"

Step 1: Go to: …src\configs\setting_data.js
Step 2: Find out key “domain_public” , change yours, Ex: https://ega-beauty.myshopify.com

5.2.Create alternate templates Shopify

Step 1: Create an alternate  of collection and search template.

To create alternate templates, take a look to the document here: https://help.shopify.com/themes/customization/store/create-alternate-templates

Important! You must name them as follows: “gikApp.json”

Step 2: Copy and paste the code provided in your package purchase into your alternate template that you created.

Let’s see quick configuration guide in the following video:

5.3.Config Homepage

Step 1: Go to your theme: …src\themes\[your_theme]\common\config.js
Step 2: Find out key Global>HOMEPAGES_SHOPIFY>widgets, need to update widgets data by changing:

  • width: Set the Width of the image
  • height: Set the Height of the image
  • imgUrlPaste your image URL (use for the collection_image type)
  • linkText: Add a display title
  • linkValue: Add a  collection handle (If you do not know how to get handle, follow this guide: https://help.shopify.com/themes/liquid/basics/handle)
  • type: Choose which style you want to use. (ex: ‘collection_image‘;  ‘collection_scroll_horizontal‘)

6.How to use

6.1.Configurate Push Notification

  1. You need to setup OneSignal account to support pushnotification (https://onesignal.com)
  2. Install WordPress plugin to support push notification after publish a post: https://wordpress.org/plugins/onesignal-free-web-push-notifications/

  3. The download package has already configure all the setting for you, but you need to replace the APP_ID to integrate with your OneSignal account. You can also refer detail document here for setting up – https://github.com/geektimecoil/react-native-onesignal

6.2.Multi Languages & RTL

You can add your own language to the app from src/i18n/locate/[your location].js

In src/i18n/i18n.js, export configuration (for translations):

For more info about I18n.js methods (localize, pluralize, etc) and settings see its documentation.

The language to Right to Left support:
Go to */src/settings/global.js, change the config RTL=true like the screenshot.

6.4.Convert menu from Wordpress

The menu used in the app are defined according to the standard architecture are as follows:

[code]SECTIONS_MENU_TEMPLATE: [
{
createdAt: 1474082517245,
createdByUserId: ‘SAdggEubiJhekDpHFP7BBb5gvSn2_wp’,
icon: ‘http://www.healthflashmarketing.com/images/Content-Icon-(White).png’,
name: ‘[WP]News.’,
source: ‘wordpress’,
title: ‘News’,
type: ‘news’,
value: ‘work’,
id: ‘-KRq9Y4xHc6uW9H3abNs_wp’,
children: []
}][/code]

Convert_menu

In particular, it can get any child elements of the menu by recursive method. That means that you can build a function convert_menu()  to convert the menu from any platform on the structure of this menu format to use for your app.

Example: I converted menu from WordPress to the gikApp as bellow function which is a part of  ...\src\services\wordpress.service.js

6.5.Config Side Menu

You can choose between two options:

  • Using a custom menu from your WordPress website
  • Using default menu which is defined in \src\settings\global.js  file
1. Configure the WordPress Side Menu

Step 1: Go to ...\src\services\wordpress.service.js

Step 2: Find out key “this.getMenuHierachy“, change first param to yours, Ex: 16 (follow gikApp)

Let see the quick configuration guide via video here:

2. Configure the Default Side Menu

Step 1: Go to: ...\src\settings\global.js

Step 2: Create / Edit the relevant information.

Let see the quick configuration guide via video here:

6.6.Switch gikApp Theme

Step 1: You need to go to …\src\themes\screens.js where you will see a list of all currently themes on your app. Copy the theme name and paste it into ...\src\components\install\start.android.js

and

...\src\components\install\start.ios.js

Step 2: Go to …\src\components\core\sidemenu.js , copy the Menu name and paste it into this.state{}

Step 3: Change the Menu Style which was defined in …\src\settings\global.js file.

Step 4: Custom your tabs 

Step 5: Change the Theme Style which was defined in …\src\settings\global.js file.

Let’s see quick configuration guide in the following video:


6.7.Setup images slider

Go to ./src/themes/spa/index.js, and change image URL in imgList[]

6.8.Creating and Using a Custom Icon Font for Android

This method has the advantage of fonts being copied from this module at build time so that the fonts and JS are always in sync, making upgrades painless.

Edit android/app/build.gradle ( NOT android/build.gradle ) and add the following:

apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
To customize the files being copied, add the following instead:

[js]project.ext.vectoricons = [
iconFontNames: [ ‘MaterialIcons.ttf’, ‘EvilIcons.ttf’ ] // Name of the font files you want to copy
][/js]

apply from: “../../node_modules/react-native-vector-icons/fonts.gradle”

Option: Manually

Copy the contents in the Fonts folder to android/app/src/main/assets/fonts (note lowercase font folder).
Integrating library for getImageSource and ToolbarAndroid support

These steps are optional and only needed if you want to use the Icon.getImageSource function or using custom icons in the Icon.ToolbarAndroid component.

Edit android/settings.gradle to look like this (without the +):

[js]rootProject.name = ‘MyApp’
include ‘:app’
+ include ‘:react-native-vector-icons’
+ project(‘:react-native-vector-icons’).projectDir = new File(rootProject.projectDir, ‘../node_modules/react-native-vector-icons/android’)
[/js]

Edit android/app/build.gradle (note: app folder) to look like this (without the +):

[js]
apply plugin: ‘com.android.application’
android {

}
dependencies {
compile fileTree(dir: ‘libs’, include: [‘*.jar’])
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+" // From node_modules
+ compile project(‘:react-native-vector-icons’)
}
[/js]

Edit your MainApplication.java (deep in android/app/src/main/java/...) to look like this (note two places to edit )(without the +):

[js]
package com.myapp;
+ import com.oblador.vectoricons.VectorIconsPackage;
….
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage()
+ , new VectorIconsPackage()
);
}
}
[/js]

Note: If you’re using React Native (Android) <= 0.17, follow this instructions

Option: With rnpm

$ react-native link

Note: Some users are having trouble using this method, try one of the others if you are too.

To config for IOS, see more: https://support.reactaz.com/knowledge-base/creating-and-using-a-custom-icon-font/

Source: https://github.com/oblador/react-native-vector-icons

6.9.Creating and Using a Custom Icon Font for IOS

Option: Manually

If you want to use any of the bundled icons, you need to add the icon fonts to your Xcode project. Just follow these steps:

Browse to node_modules/react-native-vector-icons and drag the folder Fonts (or just the ones you want) to your project in Xcode. Make sure your app is checked under “Add to targets” and that “Create groups” is checked if you add the whole folder.

Edit Info.plist and add a property called Fonts provided by application (or UIAppFonts if Xcode won’t autocomplete/not using Xcode) and type in the files you just added. It will look something like this:
XCode screenshot

Note: you need to recompile your project after adding new fonts, also ensure that they also appear under Copy Bundle Resources in Build Phases.

If you want to use the TabBar/NavigatorIOS integration or use getImageSource, then you need to add RNVectorIcons.xcodeproj to Libraries and add libRNVectorIcons.a to Link Binary With Libraries under Build Phases. More info and screenshots about how to do this is available in the React Native documentation.

Option: With CocoaPods

Add the following to your Podfile and run pod update:

pod 'RNVectorIcons', :path => 'node_modules/react-native-vector-icons'

Edit Info.plist as described above.

Option: With rnpm

$ react-native link

Note: Some users are having trouble using this method, try one of the others if you are too.

To configure for Android, see more: https://support.reactaz.com/knowledge-base/creating-and-using-a-custom-icon-font-for-android/

Suggest Edit