SDK Installation
Package Installation
plugin add
Cordova: cordova plugin add airbridge-cordova-sdk
Ionic: ionic cordova plugin add airbridge-cordova-sdk
PhoneGap: phonegap plugin add airbridge-cordova-sdk
For Ionic projects, please add the following code to the .ts files that will be using the Airbridge SDK.
Project Setup (Android)
MainApplication.java
Initialize the Airbridge SDK in the Android Application class.- Create an Application class. Add the
platforms/android/app/src/main/java/[PACKAGE NAME]/MainApplication.javafile.
- Set the created Application in the
AndroidManifest.xml.
AndroidManifest.xml
- Add the following initialization code to the Application class.
Project Setup (iOS)
AppDelegate.m
Add the following code to the import section of the file ios/[Project Name]/AppDelegate.m.
application:idFinishLaunchingWithOptions: function within the ios/[Project Name]/AppDelegate.m file.
APP_NAME can be found on the dashboard at Settings → Tokens → App Name.
APP_TOKEN can be found on the dashboard at Settings → Tokens → App SDK Token.
Common Settings
airbridge.json
- Add an
airbridge.jsonfile to the project folder. - Configure settings in JSON format.
Attention
trackingAuthorizeTimeoutSeconds in the above code is the default value (0). Please adjust accordingly depending on your user experience and ATT prompt settings. Refer to ]Tracking Authorize Timeout Settings for more details.Testing the SDK
Check if install events are sent when the application is installed and opened.Check in the Airbridge Dashboard
Events from the Airbridge SDK are shown at the “Airbridge Dashboard → Raw Data → App Real-time Logs”.- Go to
Airbridge Dashboard → Raw Data → App Real-time Logs. - Search for the device’s ADID (IDFA, IDFV, GAID).
Deep Link Setup
Dashboard Setup
Please refer to the following guides for setting up deep links in the Airbridge dashboard.Project Setup (Android)
setDeeplinkListener
Register a function that will be called whenever a “deep link” or a “deferred deep link” opens the application.
DeeplinkCallback
Of those deep links, “Airbridge deep links” will be sent using the URI Scheme (YOUR_SCHEME://...) that was set in the Airbridge dashboard.
AndroidManifest.xml
In theMainActivity section of the android/app/src/main/AndroidManifest.xml file, add intent-filter parameters as below.
APP_NAME.
Enter your scheme value set in the Airbridge dashboard at YOUR_SCHEME.
MainActivity.java
Insert the following code in theandroid/app/src/main/java/.../MainActivity.java file.
Project Setup (iOS)
Scheme
- Go to “Xcode → Project file → Info → URL Types”.
- From the Airbridge dashboard, copy “iOS URI Scheme” to Xcode’s “URL Schemes”. (Do not include
://)
Universal Link
- Go to “Xcode → Project file → Signing & Capabilities”.
- Click ”+ Capability” and add “Associated Domains”.
- Add
applinks:YOUR_APP_NAME.airbridge.ioto “Associated Domains”. - Add
applinks:YOUR_APP_NAME.deeplink.pageto “Associated Domains”.
YOUR_APP_NAME can be found at the “Airbridge dashboard → Settings → Tokens → App Name”.
Please refer to Troubleshooting → Webcredentials if you want to use the autofill feature.
Send deeplink information to SDK
- Open
ios/[Project name]/AppDelegate. - Send deeplink information to the SDK when the application is opened through schemes by calling the
handleURLSchemeDeeplinkmethod at the beginning of the following function.
- When targeting iOS 8.x or earlier, also call the
handleURLSchemeDeeplinkmethod at the beginning of the following function.
- Send deeplink information to the SDK when the application is opened through an universal link by calling the
handleUserActivitymethod at the beginning of the following function.
Custom Domain Setup (Optional)
Please refer to the below guides to setup your custom domain with Airbridge.Test Deep Link
Click on your URI scheme to test if your deep link has been properly set up in the Airbridge SDK.YOUR_APP_URI_SCHEME://
User Setup
User Identifier Setup
Once a user identifier information is sent to the SDK, all events thereafter will contain the corresponding user identifier information.Example
- User = { ID: ‘personID1’, email: ‘persondoe1@airbridge.io’ }
- User = { ID: ‘personID1’, email: ‘persondoe1@airbridge.io’, phone: ‘1(123)123-1234’ }
- User = { ID: ‘personID3’, email: ‘persondoe2@airbridge.io’, phone: ‘1(123)123-1234)’ }
Testing
Make sure that your user information settings are being properly sent through the SDK.- Configure user identifier information.
- Send an event using the SDK.
- Click the event at “Airbridge dashboard → Raw Data → App Real-time Logs”
- Check if the user information is correctly sent under the
userblock.
Device Setup
Setup Device Alias
Setup a device alias through the Airbridge SDK. The alias will be sustained even after the app closes, unless otherwise deleted.jEvent Setup
When important user actions occur, in-app events can be sent to measure performance by channel. All event parameters are optional. However, more information about the event will help provide a more accurate analysis.
action, label, value, customAttributes and semanticAttributes can be used for event options.
User Events
Send standard user events with the SDK.action, label, value, customAttributes and semanticAttributes can be used for user events.
Sign Up
User identifiers are set withsetUser and then sent with AirbridgeCategory.SIGN_UP for user sign ups.
Sign In
User identifiers are set withsetUser and then sent with AirbridgeCategory.SIGN_IN for user logins.
Sign Out
Send the sign out event withAirbridgeCategory.SIGN_OUT, and then reset the user identifiers with Airbridge.state.setUser({}).
E-commerce Events
Send e-commerce events with the SDK.
action, label, value, customAttributes and semanticAttributes can be used for e-commerce events.
It is possible to include product information using semanticAttributes. Custom key values can be used along with the pre-defined values.
View Home Screen
View Product Detail
View Product List
View Search Result
Add to Cart
Purchase
Verify Event Transmission
Make sure that the events are being properly sent through the SDK.- Send an event with the SDK.
- Check if the event shows up at “Airbridge dashboard → Raw Data → App Real-time Logs”.
Advanced Setup
Please refer to the below guides for advanced settings.
SDK Signature Setup
Protection against SDK spoofing is possible once you set your SDK Signature. This feature is available for the Airbridge Cordova SDK v2.2.0 and above.- Add the following lines in the airbridge.json file.
Please ask your CSM for the “SDK Signature Secret ID” and “SDK Signature Secret” values.
Braze Integration
Use the SDK to SDK method to automatically send Airbridge attribution information to Braze. Please refer to the Braze integration guide for more details.iOS
Modifyios/[Project name]/AppDelegate.m as below.
Android
Modifyandroid/app/src/main/java/.../MainApplication.java as below.
Braze init.
Uninstall Tracking
This feature is available only for Codova Ionic PhoneGap SDK v2.1.0+.
- Airbridge Android SDK v2.6.0+
- Airbridge iOS SDK v1.28.2+
Send Push Token
registerPushToken method.
Make sure the notification is not shown on the device if the remote message value is airbridge-uninstall-tracking.
Troubleshooting
Update 1.X.X → 2.X.X
The event API has been replaced to the below.Bitcode Compile Error
An error like below may occur when creating iOS builds with Cordova Ionic PhoneGap SDK v2.0.1+.Update 1.1.X → 1.2.X
Uninstall the old version of the Airbridge SDK. Cordova:cordova plugin remove airbridge-cordova-sdk
Ionic: ionic cordova plugin remove airbridge-cordova-sdk
PhoneGap: phonegap plugin remove airbridge-cordova-sdk
Install the new version of the Airbridge SDK.
Cordova: cordova plugin add airbridge-cordova-sdk
Ionic: ionic cordova plugin add airbridge-cordova-sdk
PhoneGap: phonegap plugin add airbridge-cordova-sdk
Android
Modifyandroid/app/src/main/java/.../MainActivity as below.
iOS
Modifyios/[Project Name]/AppDelegate as below.
Settings
- Add an
airbridge.jsonfile to the project folder. - Add the parameters shown in the example below in JSON format.
Example
Description
Update 1.0.X → 1.1.X
Install
Uninstall the old version of the Airbridge SDK. Cordova:cordova plugin remove airbridge-cordova-sdk
Ionic: ionic cordova plugin remove airbridge-cordova-sdk
PhoneGap: phonegap plugin remove airbridge-cordova-sdk
Install the new version of the Airbridge SDK.
Cordova: cordova plugin add airbridge-cordova-sdk
Ionic: ionic cordova plugin add airbridge-cordova-sdk
PhoneGap: phonegap plugin add airbridge-cordova-sdk
setDeeplinkListener
Remove the getInitialDeeplink function and use the setDeeplinkListener function only.
Android
AndroidManifest.xml
In the MainActivity section of the android/app/src/main/AndroidManifest.xml file, add intent-filter parameters as below.
MainActivity.java
Modify android/app/src/main/java/.../MainActivity.java as below.
iOS
Universal Link
- Go to “Xcode → Project file → Signing & Capabilities”.
- Click ”+ Capability” and add “Associated Domains”.
- Add
applinks:YOUR_APP_NAME.deeplink.pageto “Associated Domains”.
YOUR_APP_NAME can be found at the “Airbridge dashboard → Settings → Tokens → App Name”. AppDelegate.m
Modify ios/.../AppDelegate.m as below.