Android SDK

SDK Installation


DownloadDownload

Package Installation

Setup with Gradle

Please add the following repository under allproject/repositores block in your project/build.gradle file

allprojects{
    ...
    repositories {
        ...
        maven { url "https://dl.bintray.com/ab180/airbridge" }
        ...
    }
    ...
}

Please add the following dependency under dependencies block in your app/build.gradle file

dependencies {
    ...
    implementation "io.airbridge:sdk-android:2.+"
    ...
}

Setup with AAR file

The Airbridge SDK uses JetBrains Kotlin and Coroutines libraries for better stability and productivity. Please add following dependency libraries in your project.

Library

Link

Airbridge SDK

Download

JetBrains Java Annotations

Download

Kotlin Standard Library

Download

Kotlinx Coroutines Core

Download

Kotlinx Coroutines Android

Download

Project Setup

Permissions Setup

Please add the following permissions in your AndroidManifest.xml file

<manifest ...>
  ...
  <uses-permission android:name="android.permission.INTERNET" />
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  ...
</manifest>

Initialization

Please add the following codes under onCreate method of your Application class

@Override
public void onCreate() {
    super.onCreate();
    AirbridgeConfig config = new AirbridgeConfig.Builder("YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN")
        .build();
    Airbridge.init(this, config);
}
override fun onCreate() {
    super.onCreate()
    val config = AirbridgeConfig.Builder("YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN")
        .build()
    Airbridge.init(this, config)
}

🚧

For proper operation, please make sure that the init method can be called at the time of onCreate of the Application class

You can find YOUR_APP_NAME and YOUR_APP_SDK_TOKEN in the Airbridge Dashboard β†’ Settings β†’ Tokens tab

Testing

After the basic installation and configuration of the Airbridge SDK is completed, you can check whether it has been correctly setup through the following ways

  • Check in Dashboard
  1. Install the app on the device that you want to test and run it
  2. Go to Airbridge dashboard β†’ Raw Data β†’ App Real-time Logs
  3. Enter Google Advertising ID of the device in the search box

πŸ“˜

Please re-check the guideline again when you do not see any install event with Google Advertising ID

πŸ“˜

You can find Google Advertising ID of the device in the Settings β†’ Google β†’ Ads β†’ Your advertising ID section on the Android Device

  • Check in LogCat

If you want to check LogCat for more detailed log information of the app, you can check it through the following method

🚧

The method may possible to expose user's information. Please make sure the method works only Build.DEBUG case.

// Default log level = Log.INFO
AirbridgeConfig config = new AirbridgeConfig.Builder("YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN")
    .setLogLevel(Log.DEBUG)
    .build();
Airbridge.init(this, config);
// Default log level = Log.INFO
val config = AirbridgeConfig.Builder("YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN")
    .setLogLevel(Log.DEBUG)
    .build()
Airbridge.init(this, config)

Deep Link Setup


Dashboard Setup

Airbridge dashboard requires two types of information

  • URI Scheme
  • sha256_cert_fingerprints

Scheme Setup

Please enter URL scheme that you want to use including :// inside Android URL Scheme area as shown in the picture above

YOUR_APP_URI_SCHEME://

Register Fingerprint

For obtaining sha256_cert_fingerprints is as follows

  1. Prepare the keystore that you used to register your app with the Google Play Store
  2. Execute the following command in Terminal
keytool -list -v -keystore my-release-key.keystore
  1. Copy the SHA256 value of the Certificate Fingerprints area as shown below and enter it inside the Android sha256_cert_fingerprints area as shown in the picture above
Certificate fingerprints:
    MD5:  4C:65:04:52:F0:3F:F8:65:08:D3:71:86:FC:EF:C3:49
    SHA1: C8:BF:B7:B8:94:EA:5D:9D:38:59:FE:99:63:ED:47:B2:D9:5A:4E:CC
    SHA256: B5:EF:4D:F9:DC:95:E6:9B:F3:9A:5E:E9:D6:E0:D8:F6:7B:AB:79:C8:78:67:34:D9:A7:01:AB:6A:86:01:0E:99

Project Setup

Intent Filter Setup

Follow these steps to setup the Intent Filter

  1. Open AndroidManifest.xml
  2. Add Intent Filter to target Activity that you want to handle the deep link as follows
<activity ...>
    ...
    <intent-filter android:autoVerify="true">
        <action android:name="android.intent.action.VIEW" />

        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />

        <data android:scheme="http" android:host="YOUR_APP_NAME.deeplink.page" />
        <data android:scheme="https" android:host="YOUR_APP_NAME.deeplink.page" />
    </intent-filter>
    <intent-filter android:autoVerify="true">
        <action android:name="android.intent.action.VIEW" />

        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />

        <data android:scheme="http" android:host="YOUR_APP_NAME.airbridge.io" />
        <data android:scheme="https" android:host="YOUR_APP_NAME.airbridge.io" />
    </intent-filter>
    <intent-filter>
        <action android:name="android.intent.action.VIEW" />

        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />

        <data android:scheme="YOUR_APP_URI_SCHEME" />
    </intent-filter>
    ...
</activity>
  • YOUR_APP_NAME.deeplink.page : Airbridge App Links Version 2
  • YOUR_APP_NAME.airbridge.io : Airbridge App Links Version 1
  • YOUR_APP_URI_SCHEME : URI Scheme type of deep link like abc://

Custom Domain Setup

When you create a tracking link from the Airbridge dashboard, deeplink.page or abr.ge type of link is available but customized URLs such as go.my_company.com/abcd can be used as tracking link in order to improve the branding and click rate(CTR) of the tracking link as follows.

  1. Please set the custom domain you want to use as following guide

  2. Create res/values/airbridge.xml file and add it as follows

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
    <string-array name="co_ab180_airbridge_custom_domains">
        <item>YOUR_CUSTOM_DOMAIN</item>
    </string-array>
</resources>
  1. Add Intent Filter of Activity to process deep link like Intent Filter set earlier
<activity ...>
    ...
    <intent-filter android:autoVerify="true">
        <action android:name="android.intent.action.VIEW" />

        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />

        <data android:scheme="http" android:host="YOUR_CUSTOM_DOMAIN" />
        <data android:scheme="https" android:host="YOUR_CUSTOM_DOMAIN" />
    </intent-filter>
    ...
</activity>

❗️

The YOUR_CUSTOM_DOMAIN added at the top should match the information written in the Airbridge dashboard

Deep Link Callback Setup

To process the deep link of Intent Filter added from previous Activity, the following is required

@Override
protected void onResume() {
    super.onResume();
    Airbridge.getDeeplink(getIntent(), new AirbridgeCallback<Uri>() {
        @Override
        public void onSuccess(Uri uri) {
            // Process deeplink data
        }

        @Override
        public void onFailure(Throwable throwable) {
            // Error
        }

        @Override
        public void onComplete() {
            // After process deeplink data
        }
    });
}

// The code below is required for proper deeplink processing
@Override
protected void onNewIntent(Intent intent) {
    super.onNewIntent(intent);
    setIntent(intent);
}
override fun onResume() {
    super.onResume()
    Airbridge.getDeeplink(intent, object : AirbridgeCallback<Uri> {
        override fun onSuccess(uri: Uri) {
            // Process deeplink data
        }

        override fun onFailure(throwable: Throwable) {
            // Error
        }

        override fun onComplete() {
            // After process deeplink data
        }
    })
}

// The code below is required for proper deeplink processing
override fun onNewIntent(intent: Intent?) {
    super.onNewIntent(intent)
    setIntent(intent)
}

Deferred Deep Link Callback Setup

In the general case of deferred deep link in Airbridge SDK, the Activity is automatically called according to the Intent Filter and can be processed in the same way as deep link callback

πŸ“˜

When the corresponding Activity is called through the Airbridge deferred deep link, the query parameter of deferred=true is included and delivered

If you do not want Activity to be called automatically through the deferred deep link or want to process special work using information that obtained through the deferred deep link, you can set it up by the following method

AirbridgeConfig config = new AirbridgeConfig.Builder("YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN")
    .setOnDeferredDeeplinkReceiveListener(new OnDeferredDeeplinkReceiveListener() {
        @Override
        public boolean shouldLaunchReceivedDeferredDeeplink(Uri uri) {
            // If you want to open the target activity, please return true otherwise false
            // Default returning value = true
            return true;
        }
    })
    .build();
Airbridge.init(this, config);
val config = AirbridgeConfig.Builder("YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN")
    .setOnDeferredDeeplinkReceiveListener(object : OnDeferredDeeplinkReceiveListener {
        override fun shouldLaunchReceivedDeferredDeeplink(uri: Uri): Boolean {
            // If you want to open the target activity, please return true otherwise false
            // Default returning value = true
            return true
        }
    })
    .build()
Airbridge.init(this, config)

Testing

After the deep link configuration of the Airbridge SDK is completed, you can check whether it has been correctly setup through the following links

  • YOUR_APP_URI_SCHEME://

After deep link configuration and verification is completed, you can check on the Airbridge dashboard β†’ Row Data β†’ App Real-time Log tab

User Setup


User Identifier Setup

To measure the contribution of fragmented users between Web and App, Airbridge collects the following user identifier information

  • User Email : Email address
  • User Phone : Phone number
  • User ID : Unique User ID (The Web and App must match 1:1 with the user's specific ID values)
  • User Alias : Identifiers that can represent users(e.g. loyalty program ID, affiliate integrated ID, etc)

πŸ“˜

The user's email and phone numbers are automatically HASH(SHA256)

In the Airbridge SDK, you can set the user identifier in the following ways

// Automatically hashed on client side using SHA256
// Can turn off hashing feature with special flag
Airbridge.getCurrentUser().setEmail("[email protected]");
Airbridge.getCurrentUser().setPhone("821012341234");

// Does not hash 
Airbridge.getCurrentUser().setId("testID");
Airbridge.getCurrentUser().setAlias("key", "value");
// Automatically hashed on client side using SHA256
// Can turn off hashing feature with special flag
Airbridge.getCurrentUser().setEmail("[email protected]")
Airbridge.getCurrentUser().setPhone("821012341234")

// Does not hash 
Airbridge.getCurrentUser().setId("testID")
Airbridge.getCurrentUser().setAlias("key", "value")
  • User Alias maximum number is up to 10
  • User Alias key must be String type and length is up to 128
  • User Alias key should satisfy ^[a-z_][a-z0-9_]*$ regular expression
  • User Alias value must be String type and length is up to 1024

Once you setup user identifier, all events will be forward with that identity information

🚧

The user identifier set can be reset or overwritten through user events

User Attribute Setup

Additional user attribute data can be improve accuracy of Multi-Touch Attribute(MTA) analysis, internal data analysis and linking thrd-party solutions

Airbridge.getCurrentUser().setAttribute("key", "value");
Airbridge.getCurrentUser().setAttribute("key", "value")
  • User Attribute maximum number is up to 100
  • User Attribute key must be String type and up to 128
  • User Attribute key should satisfy ^[a-z_][a-z0-9_]*$ regular expression
  • User Attribute value must be Primitive type or String type and up to 1024 for String

🚧

The user attribute set can be reset or overwritten through user events

Testing

User information set in Airbridge SDK can be checked on the Airbridge Dashboard β†’ Row Data β†’ App Real-time Log tab

Event Setup


All the events that calls by Airbridge SDK has following fields can be contains

  • Event Category : Name of event Required (String)
  • Event Action : Event attribute 1 (String)
  • Event Label : Event attribute 2 (String)
  • Event Value : Event attribute 3 (Float)
  • Event Custom Attributes : Additional fields that can represent the event (Map<String, Object>)
  • Event Semantic Attributes : Additional semantic fields that can represent the event (Semantic Attributes Class)

❗️

The restrictions of Event Custom Attributes existing in Airbridge SDK v2.0.0 ~ 2.4.0 will disappear from v2.5.0

Deprecated by Airbridge Android SDK v2.5.0

  • Event Attribute key must be String type and up to 128
  • Event Attribute value must be Primitive Type, String type and 1-dimension of Array or List supported (Unexpected types will ignored)

User Events

For convenience, the Airbridge SDK provides the following user events

  • Sign Up
Map<String, String> alias = new HashMap<String, String>()
// userAttributes : User Attribute (NOT Event Attribute)
Map<String, Object> userAttributes = new HashMap<String, Object>()
SignUpEvent event = new SignUpEvent("id", "email", "phone", alias, userAttributes)
Airbridge.trackEvent(event);
val alias = mutableMapOf<String, String>()
// userAttributes : User Attribute (NOT Event Attribute)
val userAttributes = mutableMapOf<String, Any>()
val event = SignUpEvent("id", "email", "phone", alias, userAttributes)
Airbridge.trackEvent(event)

🚧

User identifier and property values passed at sign up will be automatically recorded

  • Sign In
Map<String, String> alias = new HashMap<String, String>()
// userAttributes : User Attribute (NOT Event Attribute)
Map<String, Object> userAttributes = new HashMap<String, Object>()
SignUpEvent event = new SignInEvent("id", "email", "phone", alias, userAttributes)
Airbridge.trackEvent(event);
val alias = mutableMapOf<String, String>()
// userAttributes : User Attribute (NOT Event Attribute)
val userAttributes = mutableMapOf<String, Any>()
val event = SignInEvent("id", "email", "phone", alias, userAttributes)
Airbridge.trackEvent(event)

🚧

User identifier and property values passed at sign in will be automatically recorded

  • Sign Out
SignOutEvent event = new SignOutEvent();
Airbridge.trackEvent(event);
val event = SignOutEvent()
Airbridge.trackEvent(event)

🚧

All user identifier and property values will disappear after sign out called

E-Commerce Events

For convenience, Airbridge SDK provides e-commerce events with the following product classes

Product product = new Product(
    "Tomato_1", // Product ID
    "Red tomato", // Product name
    "Usd", // Currency
    5.99f, // Price
    1, // Quantity
    0 // Index
);
val product = Product(
    "Tomato_1", // μƒν’ˆ ID
    "Red tomato", // μƒν’ˆλͺ…
    "Usd", // 톡화 (Currency)
    5.99f, // 가격
    1, // μˆ˜λŸ‰
    0 // Index
)
  • Home Screen View
HomeViewEvent event = new HomeViewEvent();
Airbridge.trackEvent(event);
val event = HomeViewEvent()
Airbridge.trackEvent(event)
  • Search Results View
List<Product> products = new ArrayList<Product>();
SearchResultViewEvent event = new SearchResultViewEvent("query", products);
Airbridge.trackEvent(event);
val products = arrayListOf<Product>()
val event = SearchResultViewEvent("query", products);
Airbridge.trackEvent(event)
  • Product List View
List<Product> products = new ArrayList<Product>();
ProductListViewEvent event = new ProductListViewEvent("list_id", products);
Airbridge.trackEvent(event);
val products = arrayListOf<Product>()
val event = ProductListViewEvent("list_id", products);
Airbridge.trackEvent(event)
  • Product Details View
List<Product> products = new ArrayList<Product>();
ProductDetailsViewEvent event = new ProductDetailsViewEvent(products);
Airbridge.trackEvent(event);
val products = arrayListOf<Product>()
val event = ProductDetailsViewEvent(products);
Airbridge.trackEvent(event)
  • Add To Cart
List<Product> products = new ArrayList<Product>();
String currency = "usd";
float totalValue = 19.99f;
AddToCartEvent event = new AddToCartEvent("cart_id", products, currency, totalValue);
Airbridge.trackEvent(event);
val products = arrayListOf<Product>()
val currency = "usd"
val totalValue = 19.99f
val event = AddToCartEvent("cart_id", products, currency, totalValue);
Airbridge.trackEvent(event)
  • Order Complete
List<Product> products = new ArrayList<Product>();
boolean inAppPurchased = true;
String currency = "usd";
float totalValue = 19.99f;
OrderCompletedEvent event = new OrderCompletedEvent("transaction_id", products, currency, totalValue, inAppPurchased);
Airbridge.trackEvent(event);
val products = arrayListOf<Product>()
val inAppPurchased = true
val currency = "usd"
val totalValue = 19.99f
val event = OrderCompletedEvent("transaction_id", products, currency, totalValue, inAppPurchased);
Airbridge.trackEvent(event)

Customized Events

You can send an customized event in the following way from the Airbridge SDK

float eventValue = 10f;
Map<String, String> eventAttributes = new HashMap<String, String>();
SemanticAttributes semanticAttributes = new SemanticAttributes();
Airbridge.trackEvent("event_category", "event_action", "event_label", eventValue, eventAttributes, semanticAttributes);
val eventValue = 10f
val eventAttributes = mutableMapOf<String, String>()
val semanticAttributes = SemanticAttributes()
Airbridge.trackEvent("event_category", "event_action", "event_label", eventValue, eventAttributes, semanticAttributes)

πŸ“˜

From Airbridge SDK v2.7.0 and later, 'Semantic Attributes' can be configured directly as 'Map'. For more information, please check this guide.

Alternatively, you can inherit the Event class from Airbridge and use them predefined for each app as follows

class MyAppEvent extends Event {
    public MyAppEvent() {
        super("my_custom_category");
    }
}
...
Airbridge.trackEvent(new MyAppEvent());
...

Testing

Event information sent from the Airbridge SDK can be checked on the Airbridge dashboard β†’ Row Data β†’ App Real-time Log tab

Advanced Setup


User Identifier Hash Setup

If you want to send identity information without HASH(SHA256) for internal data analysis, you can stop automatic HASH(SHA256) through the following method

❗️

The option required separate security measures must be taken internally because provides sensitive personal information such as User Email and User Phone

// Default User Info Hash Enabled = true
AirbridgeConfig config = new AirbridgeConfig.Builder("YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN")
    .setUserInfoHashEnabled(false)
    .build();
Airbridge.init(this, config);
// Default User Info Hash Enabled = true
val config = AirbridgeConfig.Builder("YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN")
    .setUserInfoHashEnabled(false)
    .build()
Airbridge.init(this, config)

Session Timeout Setup

Airbridge SDK does not send app open event again if the user relaunch the app within the set session time but will transfer app open event when the user reopen the app after that time

// Default Session Timeout = 5 minutes
AirbridgeConfig config = new AirbridgeConfig.Builder("YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN")
    .setSessionTimeoutSeconds(15)
    .build();
Airbridge.init(this, config);
// Default Session Timeout = 5 minutes
val config = AirbridgeConfig.Builder("YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN")
    .setSessionTimeoutSeconds(15)
    .build()
Airbridge.init(this, config)

Personal Information Protection

This function is useful when collecting and transferring data with consent form customers for personal information protection, such as GDPR or CCPA

You can explicitly start collecting and transferring data in the following ways

// Default Auto Start Tracking Enabled = true
AirbridgeConfig config = new AirbridgeConfig.Builder("YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN")
    .setAutoStartTrackingEnabled(false)
    .build();
Airbridge.init(this, config);

...

// Set a variable like below
if (properties.isGDPRAccepted) {
    Airbridge.startTracking();
}
// Default Auto Start Tracking Enabled = true
val config = AirbridgeConfig.Builder("YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN")
    .setAutoStartTrackingEnabled(false)
    .build()
Airbridge.init(this, config)

...

// Set a variable like below
if (properties.isGDPRAccepted) {
    Airbridge.startTracking()
}

🚧

If Airbridge.startTracking is called after onCreate of Application class, Install or Open event can be ignored. For proper operation, please call the method inside onCreate of Application after agreeing to collect personal protection.

Track Airbridge Link Only

If it is difficult to see the performance of re-engagement through Airbridge at a glance due to too many deep link actions within the advertiser's app, the following ways can be used to filter only the results received through Airbridge deep link

If the setting is activated, the result of the deep link is measured only when the app is opened through a deep link that matches the conditions below

  • The app is opened through a airbridge.io link
  • The app is opened through a deeplink.page link
  • The app is opened through a Custom Domain Setup that registered on a dashboard
  • The app is opened through airbridge_referrer query contains link
// Default Airbridge Link Only = false
AirbridgeConfig config = new AirbridgeConfig.Builder("YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN")
    .setTrackAirbridgeLinkOnly(true)
    .build();
Airbridge.init(this, config);
// Default Airbridge Link Only = false
val config = AirbridgeConfig.Builder("YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN")
    .setTrackAirbridgeLinkOnly(true)
    .build()
Airbridge.init(this, config)

Location Collection

Airbridge SDK can collect user location information in the following ways

❗️

Location information must be collected through legitimate purposes and ways

// Choose one
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
...
// Default Location Collection Enabled = false
AirbridgeConfig config = new AirbridgeConfig.Builder("YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN")
    .setLocationCollectionEnabled(true)
    .build();
Airbridge.init(this, config);
// Default Location Collection Enabled = false
val config = AirbridgeConfig.Builder("YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN")
    .setLocationCollectionEnabled(true)
    .build()
Airbridge.init(this, config)

🚧

Airbridge SDK collects LastKnownLocation information. If the GPS information is not obtained, the value could not exist even if the corresponding permission and settings are completed

Multi Store Inflow Measurement

If advertisers need to analyze their application inflow performance each market(Google Play Store, One Store, Huawei Store ...), you can identify the apps to listed on the Airbridge dashboard in the following ways

Setup via AndroidManifest.xml

...
<application android:label="@string/app_name" ...> 
    ...
    <meta-data android:name="co.ab180.airbridge.app_market_identifier" android:value="playStore"/>
    ...
</application>
...

Setup via AirbridgeConfig

AirbridgeConfig config = new AirbridgeConfig.Builder("YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN")
    .setAppMarketIdentifier("playStore") // oneStore, huaweiStore ...
    .build();
Airbridge.init(this, config);
val config = AirbridgeConfig.Builder("YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN")
    .setAppMarketIdentifier("playStore") // oneStore, huaweiStore ...
    .build()
Airbridge.init(this, config)

Facebook Deferred App Links

You can easily receive Facebook Deferred App Links through Airbridge SDK

Reference - https://developers.facebook.com/docs/app-events/getting-started-app-events-android
Reference - https://developers.facebook.com/docs/app-ads/deep-linking

In your top-level project project/build.gradle, add the following as repositores under allprojects/repositories

allprojects{
    ...
    repositories {
        ...
        mavenCentral()
        ...
    }
    ...
}

Add the following dependencies in your app-level app/build.gradle

dependencies {
    ...
    implementation 'com.facebook.android:facebook-android-sdk:[5,6)'
    ...
}

Add the following string in your app/res/values/string.xml

...
<string name="facebook_app_id">FACEBOOK_APP_ID</string>
...

Add the following <meta-data> in your <application> element inside AndroidManifest.xml

...
<application android:label="@string/app_name" ...> 
    ...
    <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>
    ...
</application>
...

Please set the option to 'true' as shown below

// Default Facebook Deferred App Link Enabled = false
AirbridgeConfig config = new AirbridgeConfig.Builder("YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN")
    .setFacebookDeferredAppLinkEnabled(true)
    .build();
Airbridge.init(this, config);
// Default Facebook Deferred App Link Enabled = false
val config = AirbridgeConfig.Builder("YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN")
    .setFacebookDeferredAppLinkEnabled(true)
    .build()
Airbridge.init(this, config)

Uninstall Tracking

πŸ“˜

Uninstall tracking through Firebase Messaging is available from Airbridge SDK v2.6.0 or later

Please refer to the page for details

Hybrid App Setup


Airbridge Web SDK cannot track in-app events such as install, open and deep link open events. In this case, Airbridge Native SDK needed.

Airbridge makes it easy to call In-App events from hybrid apps as following way.

❗️

Please make sure installation of the corresponding Airbridge Mobile SDK should be completed

Deliver an in-app event through the native mobile SDK using Javascript Interface

Reference - Building web apps in WebView

Reference - Understanding Android webview javascript interface

Please call Airbridge::setJavascriptInterface method in target web view as following method

public class MainActivity extends Activity {
    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initWebView();
    }
    
    void initWebView(DeviceInfo deviceInfo) {
        webView = findViewById(R.id.webView);
        webView.getSettings().setJavaScriptEnabled(true);
        webView.getSettings().setDomStorageEnabled(true);

        Airbridge.setJavascriptInterface(webView, "YOUR_WEB_SDK_TOKEN");    
    
        webView.setWebChromeClient(new WebChromeClient());
        webView.setWebViewClient(new WebViewClient());
        webView.loadUrl("http://dev.blog.airbridge.io/websdk-web-app/");
    }
}
class MainActivity : Activity() {
    
    override fun onCreate(savedInstanceState: Bundle) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        initWebView()
    }
    
    void initWebView(DeviceInfo deviceInfo) {
        webView.getSettings().setJavaScriptEnabled(true)
        webView.getSettings().setDomStorageEnabled(true)
        
        Airbridge.setJavascriptInterface(webView, "YOUR_WEB_TOKEN")

        webView.setWebChromeClient(new WebChromeClient())
        webView.setWebViewClient(new WebViewClient())
        webView.loadUrl("http://my_company.com/main")
    }
}

You can find YOUR_WEB_TOKEN in the Airbridge dashboard β†’ Settings β†’ Tokens tab

Please call the following Web SDK inside web page to be used

(function(a_,i_,r_,_b,_r,_i,_d,_g,_e){if(!a_[_b]||!a_[_b].queue){_g=i_.getElementsByTagName(r_)[0];a_[_b]={queue:[]};_d={};for(_i=0;_i<_r.length;_d={$jscomp$loop$prop$m$2:_d.$jscomp$loop$prop$m$2},_i++)_d.$jscomp$loop$prop$m$2=_r[_i],~_d.$jscomp$loop$prop$m$2.indexOf(".")&&(_e=_d.$jscomp$loop$prop$m$2.split(".")[0],a_[_b][_e]=a_[_b][_e]||{},a_[_b][_e][_d.$jscomp$loop$prop$m$2.split(".")[1]]=function(_d){return function(){a_[_b].queue.push([_d.$jscomp$loop$prop$m$2,arguments])}}(_d)),a_[_b][_d.$jscomp$loop$prop$m$2]=function(_d){return function(){a_[_b].queue.push([_d.$jscomp$loop$prop$m$2,arguments])}}(_d);_d=i_.createElement(r_);_d.async=1;_d.src="//static.airbridge.io/sdk/latest/airbridge.min.js";_g.parentNode.insertBefore(_d,_g)}})(window,document,"script","airbridge","init setBanner setDownload setDeeplinks sendSMS sendWeb setUserAgent setUserAlias addUserAlias setMobileAppData setUserId setUserEmail setUserPhone setUserAttributes setDeviceIFV setDeviceIFA setDeviceGAID events.send events.signIn events.signUp events.signOut events.purchased events.addedToCart events.productDetailsViewEvent events.homeViewEvent events.productListViewEvent events.searchResultViewEvent".split(" "));

airbridge.init({
    app: 'YOUR_APP_NAME',
    webToken: 'YOUR_WEB_SDK_TOKEN'
});

Troubleshooting


Auto Backup

Reference - https://developer.android.com/guide/topics/data/autobackup

Airbridge SDK defines airbridge_auto_backup_rules.xml in AndroidManifest.xml in order to prevent automatic replication of internal data. If you need Auto Backup in your Android app, you have to merge with airbridge_auto_backup_rules.xml file yourself

When Manifest merger failed : Attribute [email protected] value=(true) happened, please add following rules in your backup_rules.xml file and add tools:replace="android:fullBackupContent" inside <application> element

The Auto Backup Rules defined in the Airbridge SDK are as follows

<?xml version="1.0" encoding="utf-8"?>
<full-backup-content>
    <exclude domain="sharedpref" path="airbridge-internal" />
    <exclude domain="sharedpref" path="airbridge-install" />
    <exclude domain="sharedpref" path="airbridge-user-info" />
    <exclude domain="sharedpref" path="airbridge-user-alias" />
    <exclude domain="sharedpref" path="airbridge-user-attributes" />
    <exclude domain="sharedpref" path="airbridge-device-alias" />
    <exclude domain="database" path="airbridge.db" />
</full-backup-content>

Updated 5 days ago

Android SDK


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.