Initial SDK Setup
Installing the Braze SDK will provide you with analytics functionality, as well as push and in-app messages.
Step 1: Get the SDK
Download the SDK from Github and run the following from the root your project:
1
cordova plugin add path_to_repo/appboy-cordova-sdk/
Alternatively, if you are running Cordova 6 or later, you could install directly from Github:
1
cordova plugin add https://github.com/appboy/appboy-cordova-sdk#master
Configure the plugin
In your config.xml, add a preference
element under the iOS platform
element that contains your Braze API key with the name com.appboy.api_key
:
1
2
3
<platform name="ios">
<preference name="com.appboy.api_key" value="YOUR_API_KEY" />
</platform>
Set up your applications to have the appropriate certificates for push, via the iOS push documentation.
Removing Automatic Push Setup
If you want to turn off iOS automatic push registration, set the following configuration preferences:
1
2
3
4
<platform name="ios">
<preference name="com.appboy.ios_disable_automatic_push_registration" value="YES" />
...
</platform>
Optional IDFA Collection
To enable the automatic collection of the iOS IDFA, set the following configuration preferences:
1
2
3
<platform name="ios">
<preference name="com.appboy.ios_enable_idfa_automatic_collection" value="YES" />
</platform>
Please see the iOS IDFA documentation for more information.
Location Collection and Geofences
To enable location collection and Braze Geofences, use the geofence-branch
instead of the default master
branch. By default, the Braze SDK disables location collection and Braze Geofences. Additionally, use the following preferences configuration:
1
2
3
4
<platform name="ios">
<preference name="com.appboy.enable_location_collection" value="true" />
<preference name="com.appboy.geofences_enabled" value="true" />
</platform>
The geofence-branch can be added to your Cordova project with the following:
1
cordova plugin add https://github.com/appboy/appboy-cordova-sdk#geofence-branch
Please also visit the iOS Geofences documentation for more information.
Initial Setup Complete
Once the initial setup is complete, you can access the AppboyPlugin
JavaScript interface in your app.