This article will guide you to build your iOS app with Premium Mobile Code.
The article contains the following parts:
The Premium Mobile Code is only available on phpFox ULTIMATE license. In case you are holding other license types, please upgrade to phpFox ULTIMATE license first. In this article, we assume that you already got the following knowledge:
|
Now, let's start.
|
Following tools / softwares need to be installed on your MacOS machine:
Visit https://developer.apple.com/download/ and download stable XCode.
If you are using Mobile code version 1.4 or newer, you no longer need to install Homebrew. This step can be bypassed. |
Open Terminal and run the following commands:
# Checking brew is already which brew # if not, run this command to install /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" |
Open Terminal and run the following commands:
# Checking Cocoapods is already which pod #if not installed, run below command to install sudo gem install cocoapods |
If you are using Mobile code version 1.4 or newer, you no longer need to install Nodejs & Dependencies. This step can be bypassed. |
# support eslint npm install -g @babel/core@^7 @babel/cli@^7 eslint eslint-plugin-jest babel-eslint eslint-config-airbnb eslint-config-google eslint-plugin-flow-vars \ eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-node eslint-plugin-promise eslint-plugin-react \ eslint-plugin-standard eslint-plugin-mocha eslint-plugin-jasmine babel-plugin-react-intl babel-plugin-transform-remove-console \ yarn react-native-cli create-react-native-app |
#install dependencies. For the mobile code version 1.3 only. cd MobileProject/ yarn install |
# install dependencies cd MobileProject/ios/ pod install |
Default file configuration.json will be as below:
{ "appName": "YourAppName", "bundleId": "com.yourcompany.phpfoxmobile", "serverUrl": "https://yourphpfoxwebsite.com", "clientId": "CLIENT_ID", "clientSecret": "CLIENT_SECRET", "facebookAppId": "FACEBOOK_APP_ID", "googlePlacesClientId": "GOOGLE_PLACES_CLIENT_ID", "googleAdMobAppId": "GOOGLE_ADMOB_APP_ID", "developmentTeam": "YOUR_DEVELOPMENT_TEAM", "firebaseEnabledAnalytic": true, "codeSignStyle": "Automatic", "versionName": "1.x.x", "versionBuildNumber": 2, "theme": { "primaryColor": "#COLOR", "splashScreenBackgroundColor": "#COLOR", "grayBaseColor": "#111" } } |
Here is our detailed explanation for items in this file
appName
The app name displays on iPhone under app logo, etc: phpFox
bundleId
bundle id you registered in Apple developer site, like com.yourcompany.phpfoxmobile
serverUrl
Point to your phpFox website, etc: https://mobileapi.phpfox.com
clientId and ClientSecret
Visit your phpFox AdminCP, get these two values in your RestFul app. ( /admincp/app/?id=phpFox_RESTful_API )
facebookAppId
Visit your phpFox AdminCP, get value in facebook settings ( /admincp/setting/edit/?module-id=PHPfox_Facebook )
googlePlacesClientId
Follow the instruction at https://developers.google.com/places/ios-sdk/start to get key for ios.
googleAdMobAppId
Follow the instruction at https://developers.google.com/admob/android/quick-start to get key for ios.
firebaseEnabledAnalytic
true OR false. If true, enable Firebase analytic. For further information take a look at Google Analytics for Firebase
versionName and versionBuildNumber
These two values control the versioning of your app in the Apple Store.
developmentTeam
Visit https://developer.apple.com/account, access to your development Team and get Team ID value from the address bar.
primaryColor
The primary color (in Hex color code, Ex: #2681D5) of your app. This color is applied to links, like button, navigation title, etc.
grayBaseColor
This color code is used for generating appropriate text color.
If you are using Mobile code version 1.4 or newer, you no longer need to run Nodejs. This step can be bypassed. |
node ./server.js |