Sign in to your Airbridge account.
Click Add a new app.
Add your app to Airbridge. Once you're done, go to [Tracking Links]>[Deep Links] and submit the deep link information to Airbridge.
Android URI Scheme
Input the URI scheme of the deep links you will use. The deep links you use to create tracking links for user redirection must use this URI Scheme.
Android Package Name
Input the app's package name. Example: com.example.application
sha256_cert_fingerprints
Input the SHA256 hash value of the KeyStore
file used to sign the app. To find the hash values, refer to the information below.
# Command
keytool -list -v -keystore YOUR_KEYSTORE.keystore
# Result
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
iOS URI Scheme
Input the URI scheme of the deep links you will use. The deep links you use to create tracking links for user redirection must use this URI Scheme.
iOS App ID
Go to the Apple Developer, find the App ID Prefix and the Bundle ID, and input them in the format of App ID Prefix
+ . + Bundle ID
.
Install the Airbridge SDK in your app and complete the essential setup.
Install the Airbridge Android SDK. Declare the SDK repository in the build.gradle
or settings.gradle
file of your project that contains the repositories block. Then, add the SDK package to your application's build.gradle
file.
Click the link below to find the latest version and replace $HERE_LATEST_VERSION
accordingly.
Project build.gradle
or settings.gradle
file
allprojects {
repositories {
maven { url "https://sdk-download.airbridge.io/maven" }
}
}
allprojects {
repositories {
maven("https://sdk-download.airbridge.io/maven")
}
}
dependencyResolutionManagement {
repositories {
maven { url "https://sdk-download.airbridge.io/maven" }
}
}
dependencyResolutionManagement {
repositories {
maven("https://sdk-download.airbridge.io/maven")
}
}
Application build.gradle
file
dependencies {
// Replace $HERE_LATEST_VERSION with latest version
// - Versions: https://sdk-download.airbridge.io/maven
// - Example: implementation "io.airbridge:sdk-android:0.0.0"
implementation "io.airbridge:sdk-android:$HERE_LATEST_VERSION"
}
dependencies {
// Replace $HERE_LATEST_VERSION with latest version
// - Versions: https://sdk-download.airbridge.io/maven
// - Example: implementation "io.airbridge:sdk-android:0.0.0"
implementation("io.airbridge:sdk-android:$HERE_LATEST_VERSION")
}
Create the MainApplication
class and add it to the AndroidManifest.xml
. Then, initialize the SDK in the onCreate
function within the class.
The YOUR_APP_NAME and YOUR_APP_SDK_TOKEN can be found on the [Settings]>[Tokens] page in the Airbridge dashboard.
<application
android:name=".MainApplication"
...>
import android.app.Application
import co.ab180.airbridge.Airbridge
class MainApplication: Application() {
override fun onCreate() {
super.onCreate()
// YOUR_APP_NAME: Input your app name
// YOUR_APP_SDK_TOKEN: Input your app token
val option = AirbridgeOptionBuilder("YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN")
.build()
Airbridge.initializeSDK(this, option)
}
}
import android.app.Application;
import co.ab180.airbridge.Airbridge;
public class MainApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
// YOUR_APP_NAME: Input your app name
// YOUR_APP_SDK_TOKEN: Input your app token
AirbridgeOption option = new AirbridgeOptionBuilder("YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN")
.build();
Airbridge.initializeSDK(this, option);
}
}
Set backup rules optionally based on the information of each tag in the AndroidManifest.xml
file.
Add content to the xmlns:tools
attribute in the <manifest>
tag.
If the <application>
tag contains android:allowBackup
, add a value to tools:replace
.
If the <application>
tag contains android:dataExtractionRules
, add a value to tools:replace
and include the following rules in the file.
If the <application>
tag contains android:fullBackupContent
, add a value to tools:replace
and include the following rules in the file.
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
...>
<application
android:allowBackup="..."
android:dataExtractionRules="..."
android:fullBackupContent="..."
tools:replace="android:allowBackup,android:dataExtractionRules,android:fullBackupContent"
...>
<?xml version="1.0" encoding="utf-8"?>
<data-extraction-rules>
<cloud-backup>
<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" />
</cloud-backup>
<device-transfer>
<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" />
</device-transfer>
</data-extraction-rules>
<?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>
Follow the instructions below and complete the setup for all the items below.
Create an Activity class to handle deep links and add it to the AndroidManifest.xml
. Then, add the 3 types of Airbridge Deep Links to the intent filter. When a tracking link is triggered, Airbridge will launch the app with the most appropriate type of Airbridge Deep Link depending on the browser and whether the app is installed on the user's device.
<application ...>
...
<activity android:name=".DeeplinkActivity" ...>
...
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- YOUR_SCHEME: Input your Android URI Scheme -->
<data android:scheme="YOUR_SCHEME" />
</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" />
<!-- YOUR_APP_NAME: Input your App Name -->
<data android:scheme="http" android:host="YOUR_APP_NAME.abr.ge" />
<data android:scheme="https" android:host="YOUR_APP_NAME.abr.ge" />
</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" />
<!-- YOUR_APP_NAME: Input your App Name -->
<data android:scheme="http" android:host="YOUR_APP_NAME.airbridge.io" />
<data android:scheme="https" android:host="YOUR_APP_NAME.airbridge.io" />
</intent-filter>
...
</activity>
...
</application>
YOUR_SCHEME
should be the URI scheme you submitted to the [Tracking Links]>[Deep Links] page in the Airbridge dashboard, without the ://
.
The YOUR_APP_NAME and YOUR_APP_SDK_TOKEN can be found on the [Settings]>[Tokens] page in the Airbridge dashboard.
In the onResume
function of the deep link handling Activity class, call the handleDeeplink
function to convert the Airbridge Deep Link into the deep link set in the tracking link. Also, make sure the user is redirected to the intended in-app location using the converted scheme deep link.
If the app is launched via an Airbridge Deep Link, isAirbridgeDeeplink
returns true
, and the configured deep link will be passed to the URI
of the callback function.
If the app is launched by a deep link that is not from Airbridge, isAirbridgeDeeplink
returns false
, and the callback function will not be called.
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import co.ab180.airbridge.Airbridge
class DeeplinkActivity: AppCompatActivity() {
override fun onResume() {
super.onResume()
val isAirbridgeDeeplink = Airbridge.handleDeeplink(intent) { uri ->
// when app is opened with airbridge deeplink
// show proper content using url (YOUR_SCHEME://...)
}
if (isAirbridgeDeeplink) return
// when app is opened with other deeplink
// use existing logic as it is
}
override fun onNewIntent(intent: Intent) {
super.onNewIntent(intent)
setIntent(intent)
}
}
import android.content.Intent;
import androidx.appcompat.app.AppCompatActivity;
import co.ab180.airbridge.Airbridge;
public class DeeplinkActivity extends AppCompatActivity {
@Override
protected void onResume() {
super.onResume();
boolean isAirbridgeDeeplink = Airbridge.handleDeeplink(getIntent(), uri -> {
// when app is opened with airbridge deeplink
// show proper content using url (YOUR_SCHEME://...)
});
if (isAirbridgeDeeplink) return;
// when app is opened with other deeplink
// use existing logic as it is
}
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
setIntent(intent);
}
}
When a user who hasn't installed the app clicks on a tracking link with a deep link set as the user destination, they can be redirected to the app store to prompt app install. After the user installs and launches the app, you can call the handleDeferredDeeplink
function at the appropriate moment to obtain the deep link set in the tracking link. Ensure the user is redirected to the intended in-app location using the obtained deep link.
The first time handleDeferredDeeplink
is called after app installation, it returns true
, and the deep link from the tracking link is passed as a parameter to the callback function.
If handleDeferredDeeplink
is called again after the initial call, it returns false
, and the callback function will not be invoked.
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import co.ab180.airbridge.Airbridge
class MainActivity: AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val isFirstCalled = Airbridge.handleDeferredDeeplink { uri ->
// when handleDeferredDeeplink is called firstly after install
if (uri != null) {
// show proper content using uri (YOUR_SCHEME://...)
}
}
if (isFirstCalled) return
// when handleDeferredDeeplink is called secondly or later after install
// use existing logic as it is
}
}
import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import co.ab180.airbridge.Airbridge;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
boolean isFirstCalled = Airbridge.handleDeferredDeeplink(uri -> {
// when app is opened with airbridge deeplink
if (uri != null) {
// show proper content using uri (YOUR_SCHEME://...)
}
});
if (isFirstCalled) return;
// when app is opened with other deeplink
// use existing logic as it is
}
}
Install the Airbridge iOS SDK.
1. 在 Xcode 中导航至 [File]>[Add Packages...]。
2. 在搜索栏中输入以下地址,并点击 [Add Package]。
3. 再次点击 [Add Package]。
4. 在 Xcode 的 [Package Dependencies] 中确认 Airbridge iOS SDK 已成功添加。
5. 将 SDK 依赖的 Framework 添加到 Project 中。导航至 [Xcode]>[Project File]>[General]>[Frameworks, Libraries, and Embedded Content],并点击 “+”。
6. 添加所有以下 Framework,并将已添加 Framework 的 Embed(嵌入)设置为 Do Not Embed(不嵌入)。导航至 [Xcode]>[Project File]>[Build Phase]>[Link Binary With Libraries],将 Status(状态)设置为 “Optional(可选)”。
Framework | 说明 |
---|---|
AdSupport.framework | 用于收集 IDFA |
CoreTelephony.framework | 用于收集移动通信运营商信息 |
StoreKit.framework | 用于收集 SKAN 信息 |
AppTrackingTransparency.framework | 用于收集 ATT 同意状态信息 |
AdServices.framework | 用于收集 Apple Ads 归因信息(iOS 14.3+) |
注意
在安装 iOS SDK 之前,请导航至 [Xcode]>[YOUR_PROJECT]>[Build Settings],并确保将 User Script Sandboxing 设置为 “No”。更多信息请参阅 CocoaPods 文档。
1. 使用 brew install cocoapods
安装 CocoaPods。
2. 使用 pod init
创建 Podfile。
3. 使用以下代码将 SDK 添加为 Podfile 的依赖项。
target '[Project Name]' do
...
# Replace $HERE_LATEST_VERSION with latest version
# - Versions: https://help.airbridge.io/developers/release-note-ios-sdk
# - Example: pod 'airbridge-ios-sdk', '4.X.X'
pod 'airbridge-ios-sdk', '$HERE_LATEST_VERSION'
...
end
4. 在输入 pod install --repo-update
时,安装将开始。
5. 运行 YOUR_PROJECT.xcworkspace
以确认 Airbridge iOS SDK 成功安装。
注意
您无法使用 Tuist 的 External Dependencies 安装 Airbridge iOS SDK。请确保按照以下步骤安装。
1. 运行 tuist edit
命令。
2. 将 remote
添加到 project.packages
。将 package
添加到 project.targets[...].target.dependencies
中。参见以下代码:
import ProjectDescription
let project = Project(
packages: [
.remote(
url: "https://github.com/ab180/airbridge-ios-sdk-deployment",
// Replace $HERE_LATEST_VERSION with latest version
// - Versions: https://help.airbridge.io/developers/release-note-ios-sdk
// - Example: requirement: .exact(from: "4.X.X")
requirement: .exact(from: "$HERE_LATEST_VERSION")
),
...
],
targets: [
.target(
dependencies: [
.package(product: "Airbridge", type: .runtime),
.sdk(name: "AdSupport", type: .framework, status: .optional),
.sdk(name: "AdServices", type: .framework, status: .optional),
.sdk(name: "CoreTelephony", type: .framework, status: .optional),
.sdk(name: "StoreKit", type: .framework, status: .optional),
.sdk(name: "AppTrackingTransparency", type: .framework, status: .optional),
.sdk(name: "WebKit", type: .framework, status: .optional),
...
]
),
...
],
...
)
3. 运行 tuist generate
命令。
4. Airbridge 将添加至 Xcode 的 Package Dependencies 中。
1. 从以下链接下载 Airbridge iOS SDK:
2. 将 Airbridge.xcframework 添加到 Project 中。导航至 [Xcode]>[Project File]>[General]>[Frameworks, Libraries, and Embedded Content],并点击 “+”。
3. 在 [Add Other...] 下点击 “Add Files...”,并选择 Airbridge.xcframework。
4. 将 Airbridge.xcframework 中的 Embed(嵌入)设置为 Embed & Sign(嵌入并签名)。
5. 将 SDK 依赖的 Framework 添加到 Project 中。导航至 [Xcode]>[Project File]>[General]>[Frameworks, Libraries, and Embedded Content],并点击 “+”。
6. 添加所有以下 Framework,并将已添加 Framework 的 Embed(嵌入)设置为 Do Not Embed(不嵌入)。导航至 [Xcode]>[Project File]>[Build Phase]>[Link Binary With Libraries],将 Status(状态)设置为 “Optional(可选)”。
Framework | 说明 |
---|---|
AdSupport.framework | 用于收集 IDFA |
CoreTelephony.framework | 用于收集移动通信运营商信息 |
StoreKit.framework | 用于收集 SKAN 信息 |
AppTrackingTransparency.framework | 用于收集 ATT 同意状态信息 |
AdServices.framework | 用于收集 Apple Ads 归因信息(iOS 14.3+) |
Initialize the SDK by referring to the code below.
import UIKit
import Airbridge
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
let option = AirbridgeOptionBuilder(name: "YOUR_APP_NAME", token: "YOUR_APP_SDK_TOKEN")
.build()
Airbridge.initializeSDK(option: option)
return true
}
}
import UIKit
import Airbridge
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
let option = AirbridgeOptionBuilder(name: "YOUR_APP_NAME", token: "YOUR_APP_SDK_TOKEN")
.build()
Airbridge.initializeSDK(option: option)
return true
}
}
import SwiftUI
import Airbridge
@main
struct ExampleApp: App {
init() {
let option = AirbridgeOptionBuilder(name: "YOUR_APP_NAME", token: "YOUR_APP_SDK_TOKEN")
.build()
Airbridge.initializeSDK(option: option)
}
}
#import "AppDelegate.h"
#import <Airbridge/Airbridge.h>
@interface AppDelegate ()
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
AirbridgeOptionBuilder* optionBuilder = [[AirbridgeOptionBuilder alloc] initWithName:@"YOUR_APP_NAME"
token:@"YOUR_APP_SDK_TOKEN"];
AirbridgeOption* option = [optionBuilder build];
[Airbridge initializeSDKWithOption:option];
return YES;
}
@end
#import "AppDelegate.h"
#import <Airbridge/Airbridge.h>
@interface AppDelegate ()
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
AirbridgeOptionBuilder* optionBuilder = [[AirbridgeOptionBuilder alloc] initWithName:@"YOUR_APP_NAME"
token:@"YOUR_APP_SDK_TOKEN"];
AirbridgeOption* option = [optionBuilder build];
[Airbridge initializeSDKWithOption:option];
return YES;
}
@end
The YOUR_APP_NAME and YOUR_APP_SDK_TOKEN can be found on the [Settings]>[Tokens] page in the Airbridge dashboard.
The SDK does not collect install events or trigger deferred deep linking until the user has responded to the ATT prompt.
You can configure a timeout for the user response on the ATT prompt using the setAutoDetermineTrackingAuthorizationTimeout
function. If the user does not respond within the specified timeout period, the install event will be collected, and deferred deep linking will be enabled regardless of the ATT prompt response. The default timeout value is 30 seconds.
The Airbridge DeepLink Plan does not support attribution using identifiers. Therefore, to ensure that users who haven't installed the app are directed to the intended destination through deferred deep linking without delay, set the setAutoDetermineTrackingAuthorizationTimeout
value to 0 seconds.
import Airbridge
...
let option = AirbridgeOptionBuilder(name: "YOUR_APP_NAME",
token: "YOUR_APP_SDK_TOKEN")
.setAutoDetermineTrackingAuthorizationTimeout(second: 0)
.build()
Airbridge.initializeSDK(option: option)
#import <Airbridge/Airbridge.h>
...
AirbridgeOptionBuilder* optionBuilder = [[AirbridgeOptionBuilder alloc] initWithName:@"YOUR_APP_NAME"
token:@"YOUR_APP_SDK_TOKEN"];
[optionBuilder setAutoDetermineTrackingAuthorizationTimeoutWithSecond:0];
AirbridgeOption* option = [optionBuilder build];
[Airbridge initializeSDKWithOption:option];
Follow the instructions below and complete the setup for all the items below.
Complete the scheme deep link app setup and universal link app setup by referring to the code below.
When a tracking link is triggered, Airbridge will launch the app with the most appropriate type of Airbridge Deep Link depending on the browser and whether the app is installed on the user's device.
YOUR_SCHEME
should be the URI scheme you submitted to the [Tracking Links]>[Deep Links] page in the Airbridge dashboard, without ://
.
The YOUR_APP_NAME and YOUR_APP_SDK_TOKEN can be found on the [Settings]>[Tokens] page in the Airbridge dashboard.
When the app opens with a deep link, call the trackDeeplink
function to collect the Deeplink Open event. Then call the handleDeeplink
function to retrieve the deep link set in the tracking link. Also, make sure the user is redirected to the intended in-app location using the converted scheme deep link.
If the app is launched via an Airbridge Deep Link, handleDeeplink
returns true
, and the configured deep link will be passed to the URI
of the callback function.
If the app is launched by a deep link that is not from Airbridge, handleDeeplink
returns false
, and the callback function will not be called.
import UIKit
import Airbridge
@main
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
// when app is opened with airbridge deeplink
func handleAirbridgeDeeplink(url: URL) {
// show proper content using url (YOUR_SCHEME://...)
}
// when terminated app is opened with scheme deeplink or universal links
func scene(
_ scene: UIScene,
willConnectTo session: UISceneSession,
options connectionOptions: UIScene.ConnectionOptions
) {
// when app is opened with scheme deeplink
if let url = connectionOptions.urlContexts.first?.url {
// track deeplink
Airbridge.trackDeeplink(url: url)
// handle deeplink
var isAirbridgeDeeplink = Airbridge.handleDeeplink(url: url) { url in
// when app is opened with airbridge deeplink
// show proper content using url (YOUR_SCHEME://...)
handleAirbridgeDeeplink(url: url)
}
if isAirbridgeDeeplink { return }
// when app is opened with other deeplink
// use existing logic as it is
}
// when app is opened with universal links
else if let userActivity = connectionOptions.userActivities.first {
// track deeplink
Airbridge.trackDeeplink(userActivity: userActivity)
// handle deeplink
var isAirbridgeDeeplink = Airbridge.handleDeeplink(userActivity: userActivity) { url in
// when app is opened with airbridge deeplink
// show proper content using url (YOUR_SCHEME://...)
handleAirbridgeDeeplink(url: url)
}
if isAirbridgeDeeplink { return }
// when app is opened with other deeplink
// use existing logic as it is
}
}
// when backgrounded app is opened with scheme deeplink
func scene(
_ scene: UIScene,
openURLContexts URLContexts: Set<UIOpenURLContext>
) {
guard let url = URLContexts.first?.url else { return }
// track deeplink
Airbridge.trackDeeplink(url: url)
// handle deeplink
var isAirbridgeDeeplink = Airbridge.handleDeeplink(url: url) { url in
// when app is opened with airbridge deeplink
// show proper content using url (YOUR_SCHEME://...)
handleAirbridgeDeeplink(url: url)
}
if isAirbridgeDeeplink { return }
// when app is opened with other deeplink
// use existing logic as it is
}
// when backgrounded app is opened with universal links
func scene(
_ scene: UIScene,
continue userActivity: NSUserActivity
) {
// track deeplink
Airbridge.trackDeeplink(userActivity: userActivity)
// handle deeplink
var isAirbridgeDeeplink = Airbridge.handleDeeplink(userActivity: userActivity) { url in
// when app is opened with airbridge deeplink
// show proper content using url (YOUR_SCHEME://...)
handleAirbridgeDeeplink(url: url)
}
if isAirbridgeDeeplink { return }
// when app is opened with other deeplink
// use existing logic as it is
}
}
import UIKit
import Airbridge
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
// when app is opened with airbridge deeplink
func handleAirbridgeDeeplink(url: URL) {
// show proper content using url (YOUR_SCHEME://...)
}
// when app is opened with scheme deeplink
func application(
_ app: UIApplication,
open url: URL,
options: [UIApplication.OpenURLOptionsKey : Any] = [:]
) -> Bool {
// track deeplink
Airbridge.trackDeeplink(url: url)
// handle deeplink
var isAirbridgeDeeplink = Airbridge.handleDeeplink(url: url) { url in
// when app is opened with airbridge deeplink
// show proper content using url (YOUR_SCHEME://...)
handleAirbridgeDeeplink(url: url)
}
if isAirbridgeDeeplink { return }
// when app is opened with other deeplink
// use existing logic as it is
return isAirbridgeDeeplink
}
// when app is opened with universal links
func application(
_ application: UIApplication,
continue userActivity: NSUserActivity,
restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void
) -> Bool {
// track deeplink
Airbridge.trackDeeplink(userActivity: userActivity)
// handle deeplink
var isAirbridgeDeeplink = Airbridge.handleDeeplink(userActivity: userActivity) { url in
// when app is opened with airbridge deeplink
// show proper content using url (YOUR_SCHEME://...)
handleAirbridgeDeeplink(url: url)
}
if isAirbridgeDeeplink { return }
// when app is opened with other deeplink
// use existing logic as it is
return isAirbridgeDeeplink
}
}
import SwiftUI
import Airbridge
@main
struct ActualApp: App {
var body: some Scene {
WindowGroup {
ContentView()
// when app is opened with scheme deeplink or universal links
.onOpenURL { url in
// track deeplink
Airbridge.trackDeeplink(url: url)
// handle deeplink
var isAirbridgeDeeplink = Airbridge.handleDeeplink(url: url) { url in
// when app is opened with airbridge deeplink
// show proper content using url (YOUR_SCHEME://...)
}
if isAirbridgeDeeplink { return }
// when app is opened with other deeplink
// use existing logic as it is
}
}
}
}
#import "AppDelegate.h"
#import <Airbridge/Airbridge.h>
@interface SceneDelegate ()
@end
@implementation SceneDelegate
// when app is opened with airbridge deeplink
- (void)handleAirbridgeDeeplink:(NSURL *)url {
// show proper content using url (YOUR_SCHEME://...)
}
// when terminated app is opened with scheme deeplink or universal links
- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions {
// when app is opened with scheme deeplink
NSURL* url = connectionOptions.URLContexts.allObjects.firstObject.URL;
NSUserActivity* userActivity = connectionOptions.userActivities.allObjects.firstObject;
if (url != nil) {
// track deeplink
[Airbridge trackDeeplinkWithUrl:url];
// handle deeplink
BOOL isAirbridgeDeeplink = [Airbridge handleDeeplinkWithUrl:url onSuccess:^(NSURL* url) {
// when app is opened with airbridge deeplink
// show proper content using url (YOUR_SCHEME://...)
[self handleAirbridgeDeeplink:url];
}];
if (isAirbridgeDeeplink) { return; }
// when app is opened with other deeplink
// use existing logic as it is
}
else if (userActivity != nil) {
// track deeplink
[Airbridge trackDeeplinkWithUserActivity:userActivity];
// handle deeplink
BOOL isAirbridgeDeeplink = [Airbridge handleDeeplinkWithUserActivity:userActivity onSuccess:^(NSURL* url) {
// when app is opened with airbridge deeplink
// show proper content using url (YOUR_SCHEME://...)
[self handleAirbridgeDeeplink:url];
}];
if (isAirbridgeDeeplink) { return; }
// when app is opened with other deeplink
// use existing logic as it is
}
}
// when backgrounded app is opened with scheme deeplink
- (void)scene:(UIScene *)scene openURLContexts:(NSSet<UIOpenURLContext *> *)URLContexts {
NSURL* url = URLContexts.allObjects.firstObject.URL;
if (url == nil) { return; }
// track deeplink
[Airbridge trackDeeplinkWithUrl:url];
// handle deeplink
BOOL isAirbridgeDeeplink = [Airbridge handleDeeplinkWithUrl:url onSuccess:^(NSURL* url) {
// when app is opened with airbridge deeplink
// show proper content using url (YOUR_SCHEME://...)
[self handleAirbridgeDeeplink:url];
}];
if (isAirbridgeDeeplink) { return; }
// when app is opened with other deeplink
// use existing logic as it is
}
// when backgrounded app is opened with universal links
- (void)scene:(UIScene *)scene continueUserActivity:(NSUserActivity *)userActivity {
// track deeplink
[Airbridge trackDeeplinkWithUserActivity:userActivity];
// handle deeplink
BOOL isAirbridgeDeeplink = [Airbridge handleDeeplinkWithUserActivity:userActivity onSuccess:^(NSURL* url) {
// when app is opened with airbridge deeplink
// show proper content using url (YOUR_SCHEME://...)
[self handleAirbridgeDeeplink:url];
}];
if (isAirbridgeDeeplink) { return; }
// when app is opened with other deeplink
// use existing logic as it is
}
@end
#import "AppDelegate.h"
#import <Airbridge/Airbridge.h>
@interface AppDelegate ()
@end
@implementation AppDelegate
// when app is opened with airbridge deeplink
- (void)handleAirbridgeDeeplink:(NSURL *)url {
// show proper content using url (YOUR_SCHEME://...)
}
// when app is opened with scheme deeplink
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
// track deeplink
[Airbridge trackDeeplinkWithUrl:url];
// handle deeplink
BOOL isAirbridgeDeeplink = [Airbridge handleDeeplinkWithUrl:url onSuccess:^(NSURL* url) {
// when app is opened with airbridge deeplink
// show proper content using url (YOUR_SCHEME://...)
[self handleAirbridgeDeeplink:url];
}];
if (isAirbridgeDeeplink) { return; }
// when app is opened with other deeplink
// use existing logic as it is
return isAirbridgeDeeplink;
}
// when app is opened with universal links
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler {
// track deeplink
[Airbridge trackDeeplinkWithUserActivity:userActivity];
// handle deeplink
BOOL isAirbridgeDeeplink = [Airbridge handleDeeplinkWithUserActivity:userActivity onSuccess:^(NSURL* url) {
// when app is opened with airbridge deeplink
// show proper content using url (YOUR_SCHEME://...)
[self handleAirbridgeDeeplink:url];
}];
if (isAirbridgeDeeplink) { return; }
// when app is opened with other deeplink
// use existing logic as it is
return isAirbridgeDeeplink;
}
@end
When a user who hasn't installed the app clicks on a tracking link with a deep link set as the user destination, they can be redirected to the app store to prompt app install. After the user installs and launches the app, you can call the handleDeferredDeeplink
function at the appropriate moment to obtain the deep link set in the tracking link. Ensure the user is redirected to the intended in-app location using the obtained deep link.
The first time handleDeferredDeeplink
is called after app installation, it returns true
, and the deep link from the tracking link is passed as a parameter to the callback function.
If handleDeferredDeeplink
is called again after the initial call, it returns false
, and the callback function will not be invoked.
import UIKit
import Airbridge
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
let option = AirbridgeOptionBuilder(name: "YOUR_APP_NAME", token: "YOUR_APP_SDK_TOKEN")
.build()
Airbridge.initializeSDK(option: option)
let isFirstCalled = Airbridge.handleDeferredDeeplink() { url in
// when handleDeferredDeeplink is called firstly after install
if let url {
// show `proper content using url (YOUR_SCHEME://...)
}
}
if (isFirstCalled) { return true }
// when handleDeferredDeeplink is called secondly or later after install
// use existing logic as it is
return true
}
}
import UIKit
import Airbridge
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
let option = AirbridgeOptionBuilder(name: "YOUR_APP_NAME", token: "YOUR_APP_SDK_TOKEN")
.build()
Airbridge.initializeSDK(option: option)
let isFirstCalled = Airbridge.handleDeferredDeeplink() { url in
// when handleDeferredDeeplink is called firstly after install
if let url {
// show `proper content using url (YOUR_SCHEME://...)
}
}
if (isFirstCalled) { return true }
// when handleDeferredDeeplink is called secondly or later after install
// use existing logic as it is
return true
}
}
import SwiftUI
import Airbridge
@main
struct ExampleApp: App {
init() {
let option = AirbridgeOptionBuilder(name: "YOUR_APP_NAME", token: "YOUR_APP_SDK_TOKEN")
.build()
Airbridge.initializeSDK(option: option)
let isFirstCalled = Airbridge.handleDeferredDeeplink() { url in
// when handleDeferredDeeplink is called firstly after install
if let url {
// show `proper content using url (YOUR_SCHEME://...)
}
}
if (isFirstCalled) { return true }
// when handleDeferredDeeplink is called secondly or later after install
// use existing logic as it is
}
}
#import "AppDelegate.h"
#import <Airbridge/Airbridge.h>
@interface AppDelegate ()
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
AirbridgeOptionBuilder* optionBuilder = [[AirbridgeOptionBuilder alloc] initWithName:@"YOUR_APP_NAME"
token:@"YOUR_APP_SDK_TOKEN"];
AirbridgeOption* option = [optionBuilder build];
[Airbridge initializeSDKWithOption:option];
BOOL isFirstCalled = [Airbridge handleDeferredDeeplinkOnSuccess:^(NSURL* url) {
// when handleDeferredDeeplink is called firstly after install
if let url {
// show `proper content using url (YOUR_SCHEME://...)
}
}];
if (isFirstCalled) { return YES; }
// when handleDeferredDeeplink is called secondly or later after install
// use existing logic as it is
return YES;
}
@end
#import "AppDelegate.h"
#import <Airbridge/Airbridge.h>
@interface AppDelegate ()
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
AirbridgeOptionBuilder* optionBuilder = [[AirbridgeOptionBuilder alloc] initWithName:@"YOUR_APP_NAME"
token:@"YOUR_APP_SDK_TOKEN"];
AirbridgeOption* option = [optionBuilder build];
[Airbridge initializeSDKWithOption:option];
BOOL isFirstCalled = [Airbridge handleDeferredDeeplinkOnSuccess:^(NSURL* url) {
// when handleDeferredDeeplink is called firstly after install
if let url {
// show `proper content using url (YOUR_SCHEME://...)
}
}];
if (isFirstCalled) { return YES; }
// when handleDeferredDeeplink is called secondly or later after install
// use existing logic as it is
return YES;
}
@end
Install the Airbridge React Native SDK.
npm install airbridge-react-native-sdk
cd ios; pod install
Initialize the SDK when the app is opened.
The YOUR_APP_NAME and YOUR_APP_SDK_TOKEN can be found on the [Settings]>[Tokens] page in the Airbridge dashboard.
ios/YOUR_PROJECT_NAME/AppDelegate.m
file
import AirbridgeReactNative
...
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
AirbridgeReactNative.initializeSDK(name: "YOUR_APP_NAME", token:"YOUR_APP_SDK_TOKEN")
...
}
#import <AirbridgeReactNative/AirbridgeReactNative.h>
...
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[AirbridgeReactNative initializeSDKWithName:@"YOUR_APP_NAME" token:@"YOUR_APP_SDK_TOKEN"];
...
}
android/app/src/main/java/.../MainApplication.kt
file
import co.ab180.airbridge.reactnative.AirbridgeReactNative
...
override fun onCreate() {
super.onCreate()
AirbridgeReactNative.initializeSDK(this, "YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN")
...
}
import co.ab180.airbridge.reactnative.AirbridgeReactNative;
...
@Override
public void onCreate() {
super.onCreate();
AirbridgeReactNative.initializeSDK(this, "YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN");
...
}
Configure the SDK settings by following the steps below.
{
"sdkEnabled": boolean,
"logLevel": "debug" | "info" | "warning" | "error" | "fault",
"autoStartTrackingEnabled": boolean,
"autoDetermineTrackingAuthorizationTimeoutInSecond": number,
"trackMetaDeferredAppLinkEnabled": boolean,
"sessionTimeoutInSecond": number,
"metaInstallReferrerAppID": string,
"trackAirbridgeDeeplinkOnlyEnabled": boolean,
"trackInSessionLifecycleEventEnabled": boolean,
"hashUserInformationEnabled": boolean,
"sdkSignatureID": string,
"sdkSignatureSecret": string,
"clearEventBufferOnInitializeEnabled": boolean,
"eventBufferCountLimit": number,
"eventBufferSizeLimitInGibibyte": number,
"eventTransmitIntervalInSecond": number,
"isHandleAirbridgeDeeplinkOnly": boolean,
"collectTCFDataEnabled": boolean
}
1. Create an airbridge.json file at the top level of the React Native project folder, input the JSON as above, and configure the SDK settings.
2. Don't input values for keys that are not necessary for your service.
Set backup rules optionally based on the information of each tag in the AndroidManifest.xml
file.
Add content to the xmlns:tools
attribute in the <manifest>
tag.
If the <application>
tag contains android:allowBackup
, add a value to tools:replace
.
If the <application>
tag contains android:dataExtractionRules
, add a value to tools:replace
and include the following rules in the file.
If the <application>
tag contains android:fullBackupContent
, add a value to tools:replace
and include the following rules in the file.
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
...>
<application
android:allowBackup="..."
android:dataExtractionRules="..."
android:fullBackupContent="..."
tools:replace="android:allowBackup,android:dataExtractionRules,android:fullBackupContent"
...>
<?xml version="1.0" encoding="utf-8"?>
<data-extraction-rules>
<cloud-backup>
<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" />
</cloud-backup>
<device-transfer>
<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" />
</device-transfer>
</data-extraction-rules>
<?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>
The SDK does not collect install events or trigger deferred deep linking until the user has responded to the ATT prompt.
You can configure the timeout for the user's response to the ATT prompt using the autoDetermineTrackingAuthorizationTimeoutInSecond
setting in airbridge.json
.
If the user does not respond within the specified timeout period, the install event will be collected, and deferred deep linking will be enabled regardless of the ATT prompt response. The default timeout value is 30 seconds.
The Airbridge DeepLink Plan does not support attribution using identifiers. Therefore, to ensure that users who haven't installed the app are directed to the intended destination through deferred deep linking without delay, set the autoDetermineTrackingAuthorizationTimeoutInSecond
value to 0 seconds.
{
"autoDetermineTrackingAuthorizationTimeoutInSecond": 0
}
Follow the instructions below and complete the setup for all the items below.
Complete the scheme deep link app setup and universal link app setup for iOS, and the scheme deep link app setup and app link setup for Android by referring to the codes below.
When a tracking link is triggered, Airbridge will launch the app with the most appropriate type of Airbridge Deep Link depending on the browser and whether the app is installed on the user's device.
ios/YOUR_PROJECT_NAME.xcodeproj
file
android/app/src/main/AndroidManifest.xml
file
Scheme deep link app setup
Add YOUR_SCHEME
to the intent-filter
.
App link setup
Add YOUR_APP_NAME.airbridge.io
and YOUR_APP_NAME.abr.ge
to the intent-filter
.
<application ...>
...
<activity android:name=".DeeplinkActivity" ...>
...
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- YOUR_SCHEME: Input your Android URI Scheme -->
<data android:scheme="YOUR_SCHEME" />
</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" />
<!-- YOUR_APP_NAME: Input your App Name -->
<data android:scheme="http" android:host="YOUR_APP_NAME.abr.ge" />
<data android:scheme="https" android:host="YOUR_APP_NAME.abr.ge" />
</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" />
<!-- YOUR_APP_NAME: Input your App Name -->
<data android:scheme="http" android:host="YOUR_APP_NAME.airbridge.io" />
<data android:scheme="https" android:host="YOUR_APP_NAME.airbridge.io" />
</intent-filter>
...
</activity>
...
</application>
YOUR_SCHEME
should be the URI scheme you submitted to the [Tracking Links]>[Deep Links] page in the Airbridge dashboard, without the ://
.
The YOUR_APP_NAME and YOUR_APP_SDK_TOKEN can be found on the [Settings]>[Tokens] page in the Airbridge dashboard.
Call the trackDeeplink
function when the app is opened through a deep link, so the SDK can collect the deep link event.
ios/YOUR_PROJECT_NAME/AppDelegate.m
file
import AirbridgeReactNative
...
// when app is opened with scheme deeplink
func application(
_ app: UIApplication,
open url: URL,
options: [UIApplication.OpenURLOptionsKey : Any] = [:]
) -> Bool {
// track deeplink
AirbridgeReactNative.trackDeeplink(url: url)
return true
}
...
// when app is opened with universal links
func application(
_ application: UIApplication,
continue userActivity: NSUserActivity,
restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void
) -> Bool {
// track deeplink
AirbridgeReactNative.trackDeeplink(userActivity: userActivity)
return true
}
#import <AirbridgeReactNative/AirbridgeReactNative.h>
...
// when app is opened with scheme deeplink
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
// track deeplink
[AirbridgeReactNative trackDeeplinkWithUrl:url];
return YES;
}
...
// when app is opened with universal links
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler {
// track deeplink
[AirbridgeReactNative trackDeeplinkWithUserActivity:userActivity];
return YES;
}
android/app/src/main/java/.../MainActivity.kt
file
import co.ab180.airbridge.reactnative.AirbridgeReactNative
...
override fun onResume() {
super.onResume()
AirbridgeReactNative.trackDeeplink(intent)
}
...
override fun onNewIntent(intent: Intent) {
super.onNewIntent(intent)
setIntent(intent)
}
import co.ab180.airbridge.reactnative.AirbridgeReactNative;
...
@Override
protected void onResume() {
super.onResume();
AirbridgeReactNative.trackDeeplink(getIntent());
}
...
@Override
public void onNewIntent(Intent intent) {
super.onNewIntent(intent);
setIntent(intent);
}
Call the setOnDeeplinkReceived
function to retrieve the deep link set in the tracking link. Also, make sure the user is redirected to the intended in-app location using the converted scheme deep link.
import { Airbridge } from 'airbridge-react-native-sdk'
...
Airbridge.setOnDeeplinkReceived((url) => {
// show proper content using url
})
No additional setup is required for deferred deep linking. When a user who hasn’t installed the app clicks a tracking link, they will be redirected to the app store, prompting them to install the app. After installation, when the user launches the app, the deep link set in the tracking link is automatically passed to the OnDeeplinkReceived
function.
Install the Airbridge Flutter SDK.
Add the following line to the dependencies
block in your pubspec.yaml
file. Check the link below for the latest version and replace $HERE_LATEST_VERSION
accordingly.
SDK version list: link
dependencies:
# Replace $HERE_LATEST_VERSION with latest version
# - Versions: https://pub.dev/packages/airbridge_flutter_sdk/versions
# - Example: airbridge_flutter_sdk: 0.0.0
airbridge_flutter_sdk: $HERE_LATEST_VERSION
From the root directory of your project, open the terminal and run the following command.
Note that the Airbridge Flutter SDK only works with Flutter 1.20.0 or higher and Dart 2.12.0 or later.
flutter pub get
Initialize the SDK when the app is opened.
The YOUR_APP_NAME and YOUR_APP_SDK_TOKEN can be found on the [Settings]>[Tokens] page in the Airbridge dashboard.
ios/YOUR_PROJECT_NAME/AppDelegate.m
파일
import airbridge_flutter_sdk
...
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
AirbridgeFlutter.initializeSDK(name: "YOUR_APP_NAME", token:"YOUR_APP_SDK_TOKEN")
...
}
#import <AirbridgeFlutter/AirbridgeFlutter.h>
...
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[AirbridgeFlutter initializeSDKWithName:@"YOUR_APP_NAME" token:@"YOUR_APP_SDK_TOKEN"];
...
}
android/app/src/main/java/.../MainApplication.kt
파일
import co.ab180.airbridge.flutter.AirbridgeFlutter
...
override fun onCreate() {
super.onCreate()
AirbridgeFlutter.initializeSDK(this, "YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN")
...
}
import co.ab180.airbridge.flutter.AirbridgeFlutter;
...
@Override
public void onCreate() {
super.onCreate();
AirbridgeFlutter.initializeSDK(this, "YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN");
...
}
Configure the SDK settings by following the steps below.
{
"sdkEnabled": boolean,
"logLevel": "debug" | "info" | "warning" | "error" | "fault",
"autoStartTrackingEnabled": boolean,
"autoDetermineTrackingAuthorizationTimeoutInSecond": number,
"trackMetaDeferredAppLinkEnabled": boolean,
"sessionTimeoutInSecond": number,
"metaInstallReferrerAppID": string,
"trackAirbridgeDeeplinkOnlyEnabled": boolean,
"trackInSessionLifecycleEventEnabled": boolean,
"hashUserInformationEnabled": boolean,
"sdkSignatureID": string,
"sdkSignatureSecret": string,
"clearEventBufferOnInitializeEnabled": boolean,
"eventBufferCountLimit": number,
"eventBufferSizeLimitInGibibyte": number,
"eventTransmitIntervalInSecond": number,
"isHandleAirbridgeDeeplinkOnly": boolean,
"collectTCFDataEnabled": boolean
}
1. Create an airbridge.json file at the top level of the project folder, input the JSON as above, and configure the SDK settings.
2. Don't input values for keys that are not necessary for your service.
Set backup rules optionally based on the information of each tag in the AndroidManifest.xml
file.
Add content to the xmlns:tools
attribute in the <manifest>
tag.
If the <application>
tag contains android:allowBackup
, add a value to tools:replace
.
If the <application>
tag contains android:dataExtractionRules
, add a value to tools:replace
and include the following rules in the file.
If the <application>
tag contains android:fullBackupContent
, add a value to tools:replace
and include the following rules in the file.
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
...>
<application
android:allowBackup="..."
android:dataExtractionRules="..."
android:fullBackupContent="..."
tools:replace="android:allowBackup,android:dataExtractionRules,android:fullBackupContent"
...>
<?xml version="1.0" encoding="utf-8"?>
<data-extraction-rules>
<cloud-backup>
<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" />
</cloud-backup>
<device-transfer>
<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" />
</device-transfer>
</data-extraction-rules>
<?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>
The SDK does not collect install events or trigger deferred deep linking until the user has responded to the ATT prompt.
You can configure the timeout for the user's response to the ATT prompt using the autoDetermineTrackingAuthorizationTimeoutInSecond
setting in airbridge.json
.
If the user does not respond within the specified timeout period, the install event will be collected, and deferred deep linking will be enabled regardless of the ATT prompt response. The default timeout value is 30 seconds.
The Airbridge DeepLink Plan does not support attribution using identifiers. Therefore, to ensure that users who haven't installed the app are directed to the intended destination through deferred deep linking without delay, set the autoDetermineTrackingAuthorizationTimeoutInSecond
value to 0 seconds.
{
"autoDetermineTrackingAuthorizationTimeoutInSecond": 0
}
Follow the instructions below and complete the setup for all the items below.
Complete the scheme deep link app setup and universal link app setup for iOS, and the scheme deep link app setup and app link setup for Android by referring to the codes below.
When a tracking link is triggered, Airbridge will launch the app with the most appropriate type of Airbridge Deep Link depending on the browser and whether the app is installed on the user's device.
ios/YOUR_PROJECT_NAME.xcodeproj
file
android/app/src/main/AndroidManifest.xml
file
Scheme deep link app setup
Add YOUR_SCHEME
to the intent-filter
.
App link setup
Add YOUR_APP_NAME.airbridge.io
and YOUR_APP_NAME.abr.ge
to the intent-filter
.
<application ...>
...
<activity android:name=".DeeplinkActivity" ...>
...
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- YOUR_SCHEME: Input your Android URI Scheme -->
<data android:scheme="YOUR_SCHEME" />
</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" />
<!-- YOUR_APP_NAME: Input your App Name -->
<data android:scheme="http" android:host="YOUR_APP_NAME.abr.ge" />
<data android:scheme="https" android:host="YOUR_APP_NAME.abr.ge" />
</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" />
<!-- YOUR_APP_NAME: Input your App Name -->
<data android:scheme="http" android:host="YOUR_APP_NAME.airbridge.io" />
<data android:scheme="https" android:host="YOUR_APP_NAME.airbridge.io" />
</intent-filter>
...
</activity>
...
</application>
YOUR_SCHEME
should be the URI scheme you submitted to the [Tracking Links]>[Deep Links] page in the Airbridge dashboard, without ://
.
The YOUR_APP_NAME and YOUR_APP_SDK_TOKEN can be found on the [Settings]>[Tokens] page in the Airbridge dashboard.
Call the trackDeeplink
function when the app is opened through a deep link, so the SDK can collect the deep link event.
ios/YOUR_PROJECT_NAME/AppDelegate.m
file
import airbridge_flutter_sdk
...
// when app is opened with scheme deeplink
override func application(
_ app: UIApplication,
open url: URL,
options: [UIApplication.OpenURLOptionsKey : Any] = [:]
) -> Bool {
// track deeplink
AirbridgeFlutter.trackDeeplink(url: url)
return true
}
...
// when app is opened with universal links
override func application(
_ application: UIApplication,
continue userActivity: NSUserActivity,
restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void
) -> Bool {
// track deeplink
AirbridgeFlutter.trackDeeplink(userActivity: userActivity)
return true
}
#import <AirbridgeFlutter/AirbridgeFlutter.h>
...
// when app is opened with scheme deeplink
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
// track deeplink
[AirbridgeFlutter trackDeeplinkWithUrl:url];
return YES;
}
...
// when app is opened with universal links
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler {
// track deeplink
[AirbridgeFlutter trackDeeplinkWithUserActivity:userActivity];
return YES;
}
android/app/src/main/java/.../MainActivity.kt
file
import co.ab180.airbridge.flutter.AirbridgeFlutter
...
override fun onResume() {
super.onResume()
AirbridgeFlutter.trackDeeplink(intent)
}
...
override fun onNewIntent(intent: Intent) {
super.onNewIntent(intent)
setIntent(intent)
}
import co.ab180.airbridge.flutter.AirbridgeFlutter;
...
@Override
protected void onResume() {
super.onResume();
AirbridgeFlutter.trackDeeplink(getIntent());
}
...
@Override
public void onNewIntent(Intent intent) {
super.onNewIntent(intent);
setIntent(intent);
}
Call the setOnDeeplinkReceived
function to retrieve the deep link set in the tracking link. Also, make sure the user is redirected to the intended in-app location using the converted scheme deep link.
import 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
...
Airbridge.setOnDeeplinkReceived((url) {
// show proper content using url
});
No additional setup is required for deferred deep linking. When a user who hasn’t installed the app clicks a tracking link, they will be redirected to the app store, prompting them to install the app. After installation, when the user launches the app, the deep link set in the tracking link is automatically passed to the OnDeeplinkReceived
function.
Install the Airbridge Expo SDK.
npm install --save airbridge-expo-sdk
npm install --save airbridge-react-native-sdk
Initialize the SDK when the app is opened.
The YOUR_APP_NAME and YOUR_APP_SDK_TOKEN can be found on the [Settings]>[Tokens] page in the Airbridge dashboard.
{
"expo": {
...
"plugins": [
...
[
"airbridge-expo-sdk",
{
"appName": "APP_NAME",
"appToken": "APP_TOKEN"
}
]
]
}
}
Configure the SDK settings by following the steps below.
{
"sdkEnabled": boolean,
"logLevel": "debug" | "info" | "warning" | "error" | "fault",
"autoStartTrackingEnabled": boolean,
"autoDetermineTrackingAuthorizationTimeoutInSecond": number,
"trackMetaDeferredAppLinkEnabled": boolean,
"sessionTimeoutInSecond": number,
"metaInstallReferrerAppID": string,
"trackAirbridgeDeeplinkOnlyEnabled": boolean,
"trackInSessionLifecycleEventEnabled": boolean,
"hashUserInformationEnabled": boolean,
"sdkSignatureID": string,
"sdkSignatureSecret": string,
"clearEventBufferOnInitializeEnabled": boolean,
"eventBufferCountLimit": number,
"eventBufferSizeLimitInGibibyte": number,
"eventTransmitIntervalInSecond": number,
"isHandleAirbridgeDeeplinkOnly": boolean,
"collectTCFDataEnabled": boolean
}
1. Create an airbridge.json file at the top level of the project folder, input the JSON as above, and configure the SDK settings.
2. Don't input values for keys that are not necessary for your service.
Set backup rules optionally based on the information of each tag in the AndroidManifest.xml
file.
Add content to the xmlns:tools
attribute in the <manifest>
tag.
If the <application>
tag contains android:allowBackup
, add a value to tools:replace
.
If the <application>
tag contains android:dataExtractionRules
, add a value to tools:replace
and include the following rules in the file.
If the <application>
tag contains android:fullBackupContent
, add a value to tools:replace
and include the following rules in the file.
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
...>
<application
android:allowBackup="..."
android:dataExtractionRules="..."
android:fullBackupContent="..."
tools:replace="android:allowBackup,android:dataExtractionRules,android:fullBackupContent"
...>
<?xml version="1.0" encoding="utf-8"?>
<data-extraction-rules>
<cloud-backup>
<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" />
</cloud-backup>
<device-transfer>
<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" />
</device-transfer>
</data-extraction-rules>
<?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>
The SDK does not collect install events or trigger deferred deep linking until the user has responded to the ATT prompt.
You can configure the timeout for the user's response to the ATT prompt using the autoDetermineTrackingAuthorizationTimeoutInSecond
setting in airbridge.json
.
If the user does not respond within the specified timeout period, the install event will be collected, and deferred deep linking will be enabled regardless of the ATT prompt response. The default timeout value is 30 seconds.
The Airbridge DeepLink Plan does not support attribution using identifiers. Therefore, to ensure that users who haven't installed the app are directed to the intended destination through deferred deep linking without delay, set the autoDetermineTrackingAuthorizationTimeoutInSecond
value to 0 seconds.
{
"autoDetermineTrackingAuthorizationTimeoutInSecond": 0
}
Follow the instructions below and complete the setup for all the items below.
Complete the universal link app setup in the associatedDomains
for iOS, and the app link setup in the associatedDomains
for Android by referring to the code below.
{
"expo": {
...
"scheme": "YOUR_SCHEME",
"android": {
...
"intentFilters": [{
"autoVerify": true,
"action": "VIEW",
"data": { "scheme": "https", "host": "APP_NAME.airbridge.io" },
"category": ["BROWSABLE", "DEFAULT"]
}, {
"autoVerify": true,
"action": "VIEW",
"data": { "scheme": "https", "host": "APP_NAME.abr.ge" },
"category": ["BROWSABLE", "DEFAULT"]
}, {
"autoVerify": true,
"action": "VIEW",
"data": { "scheme": "http", "host": "APP_NAME.airbridge.io" },
"category": ["BROWSABLE", "DEFAULT"]
}, {
"autoVerify": true,
"action": "VIEW",
"data": { "scheme": "http", "host": "APP_NAME.abr.ge" },
"category": ["BROWSABLE", "DEFAULT"]
}]
},
"ios": {
...
"associatedDomains": [
"applinks:APP_NAME.airbridge.io",
"applinks:APP_NAME.abr.ge"
]
}
}
}
YOUR_SCHEME
should be the URI scheme you submitted to the [Tracking Links]>[Deep Links] page in the Airbridge dashboard, without ://
.
The YOUR_APP_NAME and YOUR_APP_SDK_TOKEN can be found on the [Settings]>[Tokens] page in the Airbridge dashboard.
Call the setOnDeeplinkReceived
function to retrieve the deep link set in the tracking link. Also, make sure the user is redirected to the intended in-app location using the converted scheme deep link.
import { Airbridge } from 'airbridge-react-native-sdk'
...
Airbridge.setOnDeeplinkReceived((url) => {
// show proper content using url
})
No additional setup is required for deferred deep linking. When a user who hasn’t installed the app clicks a tracking link, they will be redirected to the app store, prompting them to install the app. After installation, when the user launches the app, the deep link set in the tracking link is automatically passed to the OnDeeplinkReceived
function.
Follow the steps below to verify that the SDK has been successfully installed.
Navigate to [Settings]>[Testing Console]>[Attributed Installs].
Enter the ADID of the test device, which is GAID or IDFA.
Delete your app from the test device and scan the QR code.
Check the results.
If the test fails, revisit the SDK setup and SDK initialization steps and make sure the SDK is properly implemented.
Navigate to [Settings]>[Testing Console]>[Deep Linking].
Input the deep link of the app you want to test. It should be entered in the format of scheme://product/12345
.
Complete the Essential Test 1, 2, and 3 by following the instructions on the dashboard.
Check the results.
If the test fails, revisit the dashboard setup, SDK setup, and deep link setup steps and make sure the SDK is properly implemented.
Was this helpful?