Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

This article will guide you to build iOS app with Premium Mobile Code

Note: the Premium Mobile Code is only available on phpFox ULTIMATE license

Prerequisite

Developers must have an Apple iOS developer https://developer.apple.com/account

XCode 10+
Homebrew https://brew.sh/

CocoaPods https://cocoapods.org/

Nodejs


Install XCode
Visit https://developer.apple.com/download/ and download stable XCode.

Install Homebrew

# Checking brew is already
which brew

# or install
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install Cocoapods
# Checking Cocoapods is already
which pod

# or install
sudo gem install cocoapods

Install nodejs & dependencies
Download and install latest nodejs version from https://nodejs.org/
# 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 reactron
brew update && brew cask install react-native-debugger && brew cask install reactotron

Setup source code
Download and extract MobileProject.zip to MobileProject
Download and extract Configuration.zip to Configuration, overwrite it's contents into MobileProject
#install dependencies

cd MobileProject/
yarn install

# install dependencies
cd ios/
pod install


GoogleService-Info.plist
Visit https://console.firebase.google.com/, create a project and download GoogleService-Info.plist and overwrite to ios/GoogleService-Info.plist
Start playground in debug mode by cmd+R, You will see your app on simulator.

iOS configuration
Add a new file ios/configuration.json with content
{
"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"
}
}

Developers must rebuild your app to affect new configuration values.
appName
A short name display on iPhone under app logo, etc: phpFox
bundleId
bundle id you registered in Apple developer site, like com.yourcompany.phpfoxmobile, etc: com.phpfox.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 instruction at https://developers.google.com/places/ios-sdk/start to get key for ios.
googleAdMobAppId
Follow instruction at https://developers.google.com/admob/android/quick-start to get key for ios.
firebaseEnabledAnalytic
Should enabled firebase analytic, for further information take a look at https://firebase.google
.com/docs/analytics/
versionName and versionBuildNumber
These two values control versioning of your app in apple store.
versionName should follow format "MAJOR.MINOR.PATCH" for further information https://semver.org/
versionBuildNumber must be an integer number.
developmentTeam
Visit https://developer.apple.com/account, access to your development Team and get teamId value from address bar.
primaryColor
Primary color of your app, it's value is applied to links, like button, navigation title, etc.
grayBaseColor
This value is used to calculate color of text.

RUNNING
Enter ./MobileProject start server
node ./server.js
Open ios/Mobile.xcworkspace, then start running with Cmd+R

  • No labels