Project Configuration (project.json)

Project.json includes your application and workspace configuration, which is located under the config folder of your project.

Info

Info section allows you to change the meta information of your application.

JSON
JSON
"info": {
"name": "Smartface Demo",
"company": "Smartface User",
"webSite": "http://www.smartface.io",
"version": "1.0.0",
"runtimeVersion": "1059",
"description": ""
}

Config

You can set project configuration for Cache Size, Orientation and Debug Logging

JSON
JSON
"config": {
"cache": {
"size": 50
},
"debug": {
"logs": false
},
"orientation": {
"portrait": true,
"upsideDown": false,
"landScapeLeft": false,
"landScapeRight": false
}
}

API

You can set API keys for Facebook, Twitter, and Google services.

JSON
JSON
"api": {
"facebook": {
"appUID": "",
"appSecret": ""
},
"twitter": {
"consumerKey": "",
"consumerSecret": ""
},
"googleMaps": {
"androidKey": "01u81e3cP5lidl1HRJ55hoBH0N5_Kmlvku4EIYg",
"iosKey": ""
},
"adMob": {
"publisherId": ""
},
"googleCloudMessaging": {
"senderID": ""
},
"googlePlayServices": {
"inAppPurchaseProductKey": ""
}
}

Build

In this section, you can set project paths for scripts, images, and assets. Also you can enable/disable plugins and set output file directories for local binaries.

Please note: Only plugins developed by Smartface will be delivered in the on-device emulators. Custom plugins will not work during the testing with the on-device emulator. They will only work only in published apps or you can contact the Smartface Team for custom emulators.

JSON
JSON
"build": {
"input": {
"ios": {
"scripts": "scripts",
"images": "images/iOS",
"assets": "assets",
"infoPlist": "config/iOS/Info.plist",
"urlIdentifier": "",
"urlSchemes": "",
"plugins": {
"facebookios": {
"url": "https://smartfacecdn.blob.core.windows.net/smartface-bin/plugins/Facebook/iOS/1.0.0/FacebookiOS.zip",
"path": "plugins/iOS/FacebookiOS.zip",
"active": false
},
"googleanalyticsplugin-ios": {
"url": "https://smartfacecdn.blob.core.windows.net/smartface-bin/plugins/GoogleAnalytics/iOS/1.0.0/GoogleAnalyticsiOS.zip",
"path": "plugins/iOS/GoogleAnalyticsiOS.zip",
"active": false
},
"admob-ios": {
"url": "https://smartfacecdn.blob.core.windows.net/smartface-bin/plugins/AdMob/iOS/1.0.0/AdmobiOS.zip",
"path": "plugins/iOS/AdmobiOS.zip",
"active": true
},
"codereaderios": {
"url": "https://smartfacecdn.blob.core.windows.net/smartface-bin/plugins/CodeReader/iOS/1.0.0/CodeReaderiOS.zip",
"path": "plugins/iOS/CodeReaderiOS.zip",
"active": false
}
}
},
"android": {
"scripts": "scripts",
"images": "images/Android",
"assets": "assets",
"manifest": "config/Android/AndroidManifest.xml",
"packageProfiles": "config/Android/PackageProfiles.xml",
"sign": {
"keystoreFile": "config/Android/smfdefault.keystore",
"keystorePass": "smartface",
"aliasName": "smartface",
"keyPass": "smartface"
},
"plugins": {
"facebook": {
"url": "https://smartfacecdn.blob.core.windows.net/smartface-bin/plugins/Facebook/Android/1.0.0/FacebookAndroid.zip",
"path": "plugins/Android/FacebookAndroid.zip",
"active": false
},
"googleanalytics": {
"url": "https://smartfacecdn.blob.core.windows.net/smartface-bin/plugins/GoogleAnalytics/Android/1.0.0/GoogleAnalyticsAndroid.zip",
"path": "plugins/Android/GoogleAnalyticsAndroid.zip",
"active": false
},
"smfimagecode": {
"url": "https://smartfacecdn.blob.core.windows.net/smartface-bin/plugins/CodeReader/Android/1.0.0/CodeReaderAndroid.zip",
"path": "plugins/Android/CodeReaderAndroid.zip",
"active": false
},
"smfparse": {
"url": "https://smartfacecdn.blob.core.windows.net/smartface-bin/plugins/Parse/Android/1.0.0/ParseAndroid.zip",
"path": "plugins/Android/ParseAndroid.zip",
"active": false
}
}
},
"keys": {
"project3DesKey": "",
"projectEncryptedKey": ""
}
},
"output": {
"ios": {
"outputFolder": "output/iOS",
"bundleIdentifier": "io.smartface.demo"
},
"android": {
"outputFolder": "output/Android",
"packageName": "io.smartface.demo"
}
},
"tempFolder": "output/.tmp"
}

playerPath

In the configuration file, you will see the ' "playerPath" : null ' expression both for iOS and Android. When doing remote app update, you might need to make sure that you have a specific version of the framework to prevent any possible incompatibility problems. If you assign it to 'null', it means that the latest player is assigned to your project.

For specifying a custom player, you can follow the steps below:

  1. Open your workspace and create a new folder called "players" under config folder.

  2. Write the commands below into the console.

cd /home/ubuntu/.nvm/versions/node/v4.4.7/lib/node_modules/smartface/bin/
cp iOS_Player.zip ~/workspace/config/players/
cp SmartfacePlayer.zip  ~/workspace/config/players/

3.Then you will see the ".zip" files being copied to your players folder.

4.Now, you have your custom player path. You can add those paths as "config/players/iOS_Player.zip" and "config/players/SmartfacePlayer.zip" in the project.json file.

Getting Players via the CLI

There is an option that Smartface CLI tool automatically selects the right player by checking the following items in order:

  • Set null playerPath field in config/project.json

  • Player defined with the use command in CLI (see example below)

  • Default player of the CLI Open Terminal enter the following command to the terminal

smartface use latest

For detailed usage, please run the following command:

smartface use --help