Install the Airbridge Flutter SDK and implement the necessary settings following the steps below.
The Airbridge React Native SDK can be installed using the method below. After installation, you can verify whether the SDK has been properly installed through .
1. Add the following code to the dependencies
block in the pubspec.yaml
file.
dependencies:
# Get the latest version from https://pub.dev/packages/airbridge_flutter_sdk/versions
airbridge_flutter_sdk: HERE_LATEST_VERSION
2. Open Terminal
at the root directory of the project and run the following command.
Note that the Airbridge Flutter SDK only works for Flutter versions 1.20.0 or later and Dart versions 2.12.0 or later.
flutter pub get
Attention
Install only one version of the SDK, either the general SDK or the restricted SDK.
Depending on policies and environments, restrictions on collecting device IDs like GAID and IDFA may be required. When installing the Restricted SDK version, the device IDs are not collected.
Install the Restricted SDK using the method below.
1. Add the following code to the dependencies
block in the pubspec.yaml
file.
dependencies:
# Get the latest version from https://pub.dev/packages/airbridge_flutter_sdk_restricted/versions
airbridge_flutter_sdk_restricted: HERE_LATEST_VERSION
2. Open Terminal
at the root directory of the project and run the following command.
flutter pub get
The initialization methods for iOS and Android are different. Refer to the methods described below.
Note that the YOUR_APP_NAME and YOUR_APP_SDK_TOKEN can be found on the [Settings]>[Tokens] page in the Airbridge dashboard.
Add the following code to the AppDelegat
e class file in the iOS module of the project.
import airbridge_flutter_sdk
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
AirbridgeFlutter.initializeSDK(appName: "YOUR_APP_NAME", appToken: "YOUR_APP_SDK_TOKEN")
}
#import <airbridge_flutter_sdk/AirbridgeFlutter.h>
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[AirbridgeFlutter initializeSDKWithAppName:@"YOUR_APP_NAME" appToken:@"YOUR_APP_SDK_TOKEN"];
}
If an application class is not defined in the Android module of the project, create one.
Add the following code to the android/app/src/main/java/.../MainApplication.kt
file.
import co.ab180.airbridge.flutter.AirbridgeFlutter
import io.flutter.app.FlutterApplication
class MainApplication: FlutterApplication() {
override fun onCreate() {
super.onCreate()
AirbridgeFlutter.initializeSDK(this, "YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN")
}
}
import co.ab180.airbridge.flutter.AirbridgeFlutter;
import io.flutter.app.FlutterApplication;
public class MainApplication extends FlutterApplication {
@Override
public void onCreate() {
super.onCreate();
AirbridgeFlutter.initializeSDK(this, "YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN");
}
}
Register the application class created earlier in the AndroidManifest.xml
file of the Android module of the project as follows.
<application
android:name=".MainApplication"
...>
...
</application>
Deep linking allows you to redirect users from ads to specific locations within your app. The data collected from the tracking link enables you to monitor the performance of the deep link in Airbridge.
When Airbridge generates a tracking link, it automatically selects and utilizes the optimal Airbridge deep link, depending on the environment.
Example)
Airbridge Deeplink: https://YOUR_APP_NAME.airbridge.io/~~~
Scheme Deeplink: YOUR_SCHEME://product/12345
When the app is installed on a device and the user clicks the tracking link, the app opens through the Airbridge deep link. The Airbridge SDK converts the Airbridge deep link into a scheme deep link set on the tracking link. The converted scheme deep link is sent to the app.
When the app is not installed on a device and the user clicks the tracking link, the Airbridge deep link is saved. After the user moves to the app store or website and the app is installed and launched, the Airbridge SDK converts the saved Airbridge deep link into a scheme deep link. The converted scheme deep link is sent to the app.
For the deep linking setup, the deep link information entered to the Airbridge dashboard and the in-app location address for user redirection is required.
First, enter the deep link information into the Airbridge dashboard.
For the deep linking setup, the following information must be entered into the Airbridge dashboard.
iOS URI scheme: The Airbridge Deep Link is converted to a scheme deep link using the iOS URI scheme.
iOS App ID: The universal link domain of the Airbridge Deep Link is set using the iOS App ID.
Android URI scheme: The Airbridge deep link is converted to a scheme deep link using the Android URI scheme. This information is necessary for the App Link and URI scheme.
Package name: This is the Android app identifier necessary for the App Link and URI scheme.
Android sha256_cert_fingerprints: This is used for setting the App Link domain. This information is necessary for the App Link.
Attention
To properly redirect users as intended, submit different information for the production app and the development app.
Follow the steps below to submit the necessary information to the Airbridge dashboard.
1. Navigate to [Tracking Link]>[Deep Links] in the Airbridge dashboard.
2. Enter the iOS URI scheme in the iOS URI Scheme field. Include ://
. For example, if the iOS URI scheme is demo
, enter demo://
.
3. In the Apple Developer Dashboard, navigate to [Identifier] of the app you want to set up the deep link. Find the App ID Prefix and Bundle ID.
4. The iOS App ID is in the format of App ID Prefix+ . + Bundle ID
. Enter the iOS App ID into the iOS App ID field. For example, if the App ID Prefix is prefix
and the Bundle ID is example
, the iOS App ID is prefix.example
.
1. Navigate to [Tracking Link]>[Deep Links] in the Airbridge dashboard.
2. Enter the Android URI scheme into the Android URI Scheme field. Include ://
. For example, if the URI scheme is demo
, enter demo://
.
3. Enter the package name in the Package name field.
4. You need to find the sha256_cert_fingerprints. Run the following command from the keystore file you are deploying.
keytool -list -v -keystore YOUR_KEYSTORE.keystore
Find the SHA256 value in the results. The SHA256 value is the sha256_cert_fingerprints.
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
5. Enter the SHA256 value into the sha256_cert_fingerprints field.
After entering the deep link information into the Airbridge dashboard, an additional setup is required to enable the following.
App launch with Airbridge deep links
Airbridge deep link event collection
User redirection with Airbridge deep links
For detailed instructions, refer to the information below.
Perform the following setup to enable app launch with Airbridge Deep Links after the user clicks on a tracking link.
1. For the scheme deep link setup, navigate to [YOUR_PROJECT]>[Info]>[URL Types] in Xcode.
2. Click + and enter the iOS URI scheme you submitted to the Airbridge dashboard into the URL Schemes field.
Attention
When entering the iOS URL scheme, exclude
://
.
3. For the Universal Link setup, go to [YOUR_PROJECT]>[Signing & Capabilities] in Xcode.
4. Click + Capability to add Associated Domains.
5. Add applinks:YOUR_APP_NAME.airbridge.io
and applinks:YOUR_APP_NAME.abr.ge
to Associated Domains.
YOUR_APP_NAME is the Airbridge App Name.
Attention
If you are using or plan to use the Password AutoFill feature, you must add the Webcredentials domain. A situation may arise where the domain of the password saved through the Password AutoFill feature appears as airbridge.io or abr.ge to your app users.
Refer to thisarticle for more details.
1. For the scheme deep link setup, add an intent filter to the Activity that handles deep links in the AndroidManifest.xml
.
The intent filter you add must use the Android URI Scheme you submitted to the Airbridge dashboard.
<activity ...>
...
<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_SCHEME" />
</intent-filter>
...
</activity>
Attention
When entering the Android URI Scheme, exclude
://
.
2. For the App Links setup, add an intent filter under the Activity that handles the deep link in the AndroidManifest.xml
.
YOUR_APP_NAME
is the Airbridge App Name.
<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.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" />
<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>
To pass the deep link events to the Airbridge SDK, the Airbridge.trackDeeplink
function should be called at the top of the OS callback triggered when the app is opened through a deep link.
Add the following code to the ios/YOUR_PROJECT_NAME/AppDelegate.m
file.
#import <airbridge_flutter_sdk/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;
}
import airbridge_flutter_sdk
...
// when app is opened with scheme deeplink
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
func application(
_ application: UIApplication,
continue userActivity: NSUserActivity,
restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void
) -> Bool {
// track deeplink
AirbridgeFlutter.trackDeeplink(userActivity: userActivity)
return true
}
Add the following code to the android/app/src/main/java/.../MainApplication.kt
file.
import co.ab180.airbridge.flutter.AirbridgeFlutter
import android.content.Intent
...
override fun onResume() {
super.onResume()
AirbridgeFlutter.trackDeeplink(intent)
}
...
override fun onNewIntent(intent: Intent) {
super.onNewIntent(intent)
setIntent(intent)
}
import co.ab180.airbridge.flutter.AirbridgeFlutter;
import android.content.Intent;
...
@Override
protected void onResume() {
super.onResume();
AirbridgeFlutter.trackDeeplink(intent);
}
...
@Override
public void onNewIntent(Intent intent) {
super.onNewIntent(intent);
setIntent(intent);
}
When an Airbridge Deep Link is executed, it is converted into a scheme deep link and passed to the OnDeeplinkReceived
callback. If a deep link other than an Airbridge Deep Link is executed, the deep link is passed directly to the callback without without being converted.
Use the deep link passed to the callback to redirect the user to the intended destination.
Airbridge.setOnDeeplinkReceived((deeplink) {
// show proper content using url
});
To pass only Airbridge Deep Links to the callback, set isHandleAirbridgeDeeplinkOnly
in the SDK settings to true
. For more information, refer to this section.
When a user clicks on a tracking link with deferred deep linking capabilities and your app is not installed on the device, the Airbridge SDK retrieves the deep link as follows.
After initialization, the Airbridge SDK attempts to collect a deep link when all of the following conditions are met. When the app is closed before collection, the Airbridge SDK considers it as if there has not been an Airbridge Deep Link.
The Airbridge.startTracking
function is called with the opt-in settings in place. Or, opt-in has not been set.
The user's response to the ATT prompt has been determined. Or, the event collection delay time configured regarding the ATT prompt has expired.
Deferred deep links are automatically passed to OnDeeplinkReceived
, so no additional setup is required.
The SDK functionality test and deep link test allow you to check whether the SDK and deep linking work as intended.
Was this page helpful?
dependencies:
# Get the latest version from https://pub.dev/packages/airbridge_flutter_sdk_restricted/versions
airbridge_flutter_sdk_restricted: HERE_LATEST_VERSION
import airbridge_flutter_sdk
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
AirbridgeFlutter.initializeSDK(appName: "YOUR_APP_NAME", appToken: "YOUR_APP_SDK_TOKEN")
}
#import <airbridge_flutter_sdk/AirbridgeFlutter.h>
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[AirbridgeFlutter initializeSDKWithAppName:@"YOUR_APP_NAME" appToken:@"YOUR_APP_SDK_TOKEN"];
}
import co.ab180.airbridge.flutter.AirbridgeFlutter
import io.flutter.app.FlutterApplication
class MainApplication: FlutterApplication() {
override fun onCreate() {
super.onCreate()
AirbridgeFlutter.initializeSDK(this, "YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN")
}
}
import co.ab180.airbridge.flutter.AirbridgeFlutter;
import io.flutter.app.FlutterApplication;
public class MainApplication extends FlutterApplication {
@Override
public void onCreate() {
super.onCreate();
AirbridgeFlutter.initializeSDK(this, "YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN");
}
}
<application
android:name=".MainApplication"
...>
...
</application>
keytool -list -v -keystore YOUR_KEYSTORE.keystore
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
<activity ...>
...
<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_SCHEME" />
</intent-filter>
...
</activity>
<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.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" />
<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>
#import <airbridge_flutter_sdk/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;
}
import airbridge_flutter_sdk
...
// when app is opened with scheme deeplink
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
func application(
_ application: UIApplication,
continue userActivity: NSUserActivity,
restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void
) -> Bool {
// track deeplink
AirbridgeFlutter.trackDeeplink(userActivity: userActivity)
return true
}
import co.ab180.airbridge.flutter.AirbridgeFlutter
import android.content.Intent
...
override fun onResume() {
super.onResume()
AirbridgeFlutter.trackDeeplink(intent)
}
...
override fun onNewIntent(intent: Intent) {
super.onNewIntent(intent)
setIntent(intent)
}
import co.ab180.airbridge.flutter.AirbridgeFlutter;
import android.content.Intent;
...
@Override
protected void onResume() {
super.onResume();
AirbridgeFlutter.trackDeeplink(intent);
}
...
@Override
public void onNewIntent(Intent intent) {
super.onNewIntent(intent);
setIntent(intent);
}
Airbridge.setOnDeeplinkReceived((deeplink) {
// show proper content using url
});