This article contains the information required to update the Airbridge Flutter SDK. We recommend checking the information regarding all versions.
Check the information below after updating the Airbridge Flutter SDK to v4.0.
airbridge.json (v2) | airbridge.json (v4) | Change |
---|---|---|
- | sdkEnabled | New features have been added. |
logLevel | logLevel | - |
autoStartTrackingEnabled | autoStartTrackingEnabled | - |
trackingAuthorizeTimeoutSeconds | autoDetermineTrackingAuthorizationTimeoutInSecond | The name has been changed. |
facebookDeferredAppLinkEnabled | trackMetaDeferredAppLinkEnabled | The name has been changed. |
sessionTimeoutSeconds | sessionTimeoutInSecond | The name has been changed. |
metaInstallReferrer | metaInstallReferrerAppID | The name has been changed. |
trackAirbridgeLinkOnly | trackAirbridgeDeeplinkOnlyEnabled | The name has been changed. |
- | trackInSessionLifecycleEventEnabled | New features have been added. |
userInfoHashEnabled | hashUserInformationEnabled | The name has been changed. |
sdkSignatureSecretID | sdkSignatureID | The name has been changed. |
sdkSignatureSecret | sdkSignatureSecret | The name has been changed. |
- | clearEventBufferOnInitializeEnabled | New features have been added. |
- | eventBufferCountLimit | New features have been added. |
- | eventBufferSizeLimitInGibibyte | New features have been added. |
- | eventTransmitIntervalInSecond | New features have been added. |
Airbridge (v2) | Airbridge (v4) | Change |
---|---|---|
setAttributionListener | setOnAttributionReceived | The name has been changed. |
setDeeplinkListener | setOnDeeplinkReceived | The name has been changed. |
event.trackEvent | trackEvent | The name has been changed. Method of inserting attributes is changed. |
state.deviceUUID | fetchDeviceUUID | The name has been changed. DeviceUUID is now returned with callback. |
- | fetchAirbridgeGeneratedUUID | New features have been added. |
- | isUninstallTrackingNotification | New features have been added. |
placement.click | click | The name has been changed. Callback feature is added. |
placement.impression | impression | The name has been changed. Callback feature is added. |
state.setUser | - | Replaced with User related functions. |
state.updateUser | - | Replaced with User related functions. |
- | setUserID | New features have been added. |
- | clearUserID | New features have been added. |
- | setUserEmail | New features have been added. |
- | clearUserEmail | New features have been added. |
- | setUserPhone | New features have been added. |
- | clearUserPhone | New features have been added. |
- | setUserAttribute | New features have been added. |
- | removeUserAttribute | New features have been added. |
- | clearUserAttributes | New features have been added. |
- | setUserAlias | New features have been added. |
- | removeUserAlias | New features have been added. |
- | clearUserAlias | New features have been added. |
- | clearUser | New features have been added. |
setDeviceAlias | setDeviceAlias | - |
removeDeviceAlias | removeDeviceAlias | - |
clearDeviceAlias | clearDeviceAlias | - |
registerPushToken | registerPushToken | - |
- | enableSDK | New features have been added. |
- | disableSDK | New features have been added. |
- | isSDKEnabled | New features have been added. |
state.startTracking | startTracking | The name has been changed. |
- | stopTracking | New features have been added. |
- | isTrackingEnabled | New features have been added. |
createWebInterface | - | Replaced with WebInterface related functions. |
- | createWebInterfaceScript | New features have been added. |
- | handleWebInterfaceCommand | New features have been added. |
AirbridgeCategory (v2) | AirbridgeCategory (v4) | Change |
---|---|---|
SIGN_UP | SIGN_UP | - |
SIGN_IN | SIGN_IN | - |
SIGN_OUT | SIGN_OUT | - |
HOME_VIEWED | HOME_VIEWED | - |
PRODUCT_LIST_VIEWED | PRODUCT_LIST_VIEWED | - |
SEARCH_RESULTS_VIEWED | SEARCH_RESULTS_VIEWED | - |
PRODUCT_VIEWED | PRODUCT_VIEWED | - |
ADD_PAYMENT_INFO | ADD_PAYMENT_INFO | - |
ADD_TO_WISHLIST | ADD_TO_WISHLIST | - |
ADDED_TO_CART | ADDED_TO_CART | - |
INITIATE_CHECKOUT | INITIATE_CHECKOUT | - |
ORDER_COMPLETED | ORDER_COMPLETED | - |
ORDER_CANCELED | ORDER_CANCELED | - |
START_TRIAL | START_TRIAL | - |
SUBSCRIBE | SUBSCRIBE | - |
UNSUBSCRIBE | UNSUBSCRIBE | - |
AD_IMPRESSION | AD_IMPRESSION | - |
AD_CLICK | AD_CLICK | - |
COMPLETE_TUTORIAL | COMPLETE_TUTORIAL | - |
ACHIEVE_LEVEL | ACHIEVE_LEVEL | - |
UNLOCK_ACHIEVEMENT | UNLOCK_ACHIEVEMENT | - |
RATE | RATE | - |
SHARE | SHARE | - |
SCHEDULE | SCHEDULE | - |
SPEND_CREDITS | SPEND_CREDITS | - |
AirbridgeAttributes (v2) | AirbridgeAttribute (v4) | Change |
---|---|---|
- | ACTION | New features have been added. |
- | LABEL | New features have been added. |
- | VALUE | New features have been added. |
TOTAL_VALUE | - | The feature has been removed. Please enter in VALUE. |
CURRENCY | CURRENCY | - |
ORIGINAL_CURRENCY | ORIGINAL_CURRENCY | - |
PRODUCTS | PRODUCTS | - |
PERIOD | PERIOD | - |
IS_RENEWAL | IS_RENEWAL | - |
RENEWAL_COUNT | RENEWAL_COUNT | - |
PRODUCT_LIST_ID | PRODUCT_LIST_ID | - |
CART_ID | CART_ID | - |
TRANSACTION_ID | TRANSACTION_ID | - |
TRANSACTION_TYPE | TRANSACTION_TYPE | - |
TRANSACTION_PAIRED_EVENT_CATEGORY | TRANSACTION_PAIRED_EVENT_CATEGORY | - |
TRANSACTION_PAIRED_EVENT_TIMESTAMP | TRANSACTION_PAIRED_EVENT_TIMESTAMP | - |
TOTAL_QUANTITY | TOTAL_QUANTITY | - |
QUERY | QUERY | - |
IN_APP_PURCHASED | IN_APP_PURCHASED | - |
CONTRIBUTION_MARGIN | CONTRIBUTION_MARGIN | - |
ORIGINAL_CONTRIBUTION_MARGIN | ORIGINAL_CONTRIBUTION_MARGIN | - |
LIST_ID | LIST_ID | - |
RATE_ID | RATE_ID | - |
RATE | RATE | - |
MAX_RATE | MAX_RATE | - |
ACHIEVEMENT_ID | ACHIEVEMENT_ID | - |
SHARED_CHANNEL | SHARED_CHANNEL | - |
DATE_TIME | DATE_TIME | - |
DESCRIPTION | DESCRIPTION | - |
IS_REVENUE | IS_REVENUE | - |
PLACE | PLACE | - |
SCHEDULE_ID | SCHEDULE_ID | - |
TYPE | TYPE | - |
LEVEL | LEVEL | - |
SCORE | SCORE | - |
AD_PARTNERS | AD_PARTNERS | - |
IS_FIRST_PER_USER | IS_FIRST_PER_USER | - |
AirbridgeProduct (v2) | AirbridgeAttribute (v4) | Change |
---|---|---|
PRODUCT_ID | PRODUCT_ID | - |
PRODUCT_NAME | PRODUCT_NAME | - |
PRODUCT_PRICE | PRODUCT_PRICE | - |
PRODUCT_QUANTITY | PRODUCT_QUANTITY | - |
PRODUCT_CURRENCY | PRODUCT_CURRENCY | - |
PRODUCT_POSITION | PRODUCT_POSITION | - |
PRODUCT_CATEGORY_ID | PRODUCT_CATEGORY_ID | - |
PRODUCT_CATEGORY_NAME | PRODUCT_CATEGORY_NAME | - |
PRODUCT_BRAND_ID | PRODUCT_BRAND_ID | - |
PRODUCT_BRAND_NAME | PRODUCT_BRAND_NAME | - |
AirbridgeFlutter (v2) | AirbridgeFlutter (v4) | Change |
---|---|---|
getInstance | initializeSDK | The name has been changed. |
deeplink.handleURLSchemeDeeplink | trackDeeplink | The name has been changed. |
deeplink.handleUserActivity | trackDeeplink | The name has been changed. |
AirbridgeFlutter (v2) | AirbridgeFlutter (v4) | Change |
---|---|---|
init | initializeSDK | The name has been changed. |
processDeeplinkData | trackDeeplink | The name has been changed. |
setLifecycleIntegration | setLifecycleIntegration | - |
The location of airbridge.json
has been changed. Move the assets/airbridge.json
file to the airbridge.json
file at the top of the Flutter project folder.
The key values of airbridge.json
have been changed. Change the key values as follows.
airbridge.json (v2) | airbridge.json (v4) |
---|---|
trackingAuthorizeTimeoutSeconds | autoDetermineTrackingAuthorizationTimeoutInSecond |
facebookDeferredAppLinkEnabled | trackMetaDeferredAppLinkEnabled |
sessionTimeoutSeconds | sessionTimeoutInSecond |
metaInstallReferrer | metaInstallReferrerAppID |
trackAirbridgeLinkOnly | trackAirbridgeDeeplinkOnlyEnabled |
userInfoHashEnabled | hashUserInformationEnabled |
sdkSignatureSecretID | sdkSignatureID |
sdkSignatureSecret | sdkSignatureSecret |
The AirbridgeFlutter.init
function in iOS has been replaced with the AirbridgeFlutter.initializeSDK
function. Modify the ios/YOUR_PROJECT_NAME/AppDelegate.swift
file.
- override func application(
- _ application: UIApplication,
- didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
- ) -> Bool {
- AirbridgeFlutter.init(
- appName: "YOUR_APP_NAME",
- appToken: "YOUR_APP_SDK_TOKEN",
- withLaunchOptions: launchOptions
- )
- }
+ override func application(
+ _ application: UIApplication,
+ didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
+ ) -> Bool {
+ AirbridgeFlutter.initializeSDK(
+ name: "YOUR_APP_NAME",
+ token: "YOUR_APP_SDK_TOKEN",
+ )
+ }
The AirbridgeFlutter.init
function in Android has been replaced with the AirbridgeFlutter.initializeSDK
function. Modify the android/app/src/main/java/.../MainApplication.kt
file.
- import co.ab180.airbridge.flutter.AirbridgeFlutter
- ...
- override fun onCreate() {
- super.onCreate()
- AirbridgeFlutter.init(this, "YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN")
- ...
- }
+ import co.ab180.airbridge.flutter.AirbridgeFlutter
+ ...
+ override fun onCreate() {
+ super.onCreate()
+ AirbridgeFlutter.initializeSDK(this, "YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN")
+ ...
+ }
The Airbridge.setDeeplinkListener
function has been replaced with the Airbridge.setOnDeeplinkReceived
function.
- import 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
- ...
- Airbridge.setDeeplinkListener((url) => {
- // show proper content
- })
+ import 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
+ ...
+ Airbridge.setOnDeeplinkReceived((url) => {
+ // show proper content
+ })
In iOS, the AirbridgeFlutter.deeplink.handleURLSchemeDeeplink
and the AirbridgeFlutter.deeplink.handleUserActivity
functions have been replaced with the AirbridgeFlutter.trackDeeplink
function.
- override func application(
- _ application: UIApplication,
- continue userActivity: NSUserActivity,
- restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void
- ) -> Bool {
- AirbridgeFlutter.deeplink.handle(userActivity)
-
- return true
- }
-
- override func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
- AirbridgeFlutter.deeplink.handleURLSchemeDeeplink(url)
-
- return true
- }
+ override func application(
+ _ application: UIApplication,
+ continue userActivity: NSUserActivity,
+ restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void
+ ) -> Bool {
+ AirbridgeFlutter.trackDeeplink(userActivity: userActivity)
+
+ return true
+ }
+
+ override func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
+ AirbridgeFlutter.trackDeeplink(url: url)
+
+ return true
+ }
In Android, the AirbridgeFlutter.processDeeplinkData
function has been replaced with the AirbridgeFlutter.trackDeeplink
function.
- import co.ab180.airbridge.flutter.AirbridgeFlutter
- ...
- override fun onResume() {
- super.onResume()
- AirbridgeFlutter.processDeeplinkData(intent)
- }
+ import co.ab180.airbridge.flutter.AirbridgeFlutter
+ ...
+ override fun onResume() {
+ super.onResume()
+ AirbridgeFlutter.trackDeeplink(intent)
+ }
Attention
Please input the value into
AirbridgeAttribute.VALUE
instead of the existingAirbridgeAttributes.TOTAL_VALUE
.If you're using
AirbridgeAttributes.TOTAL_VALUE
and defining avalue
, the logic thatAirbridgeAttributes.TOTAL_VALUE
overwrites thevalue
has been removed from Flutter SDK v4 onwards.
The function Airbridge.event.trackEvent has been replaced with Airbridge.trackEvent.
Please change the function Airbridge.event.trackEvent to Airbridge.trackEvent following the example code below.
- import 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
- ...
- Airbridge.event.trackEvent(
- 'event',
- AirbridgeEventOption(
- action: '...',
- label: '...',
- value: 100,
- semanticAttributes: {
- AirbridgeAttributes.QUERY: '...',
- },
- customAttributes: {
- 'key1': '...',
- 'key2': '...',
- 'key3': '...',
- },
- ));
+ import 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
+ ...
+ Airbridge.trackEvent(
+ category: 'event',
+ semanticAttributes: {
+ AirbridgeAttribute.ACTION: '...',
+ AirbridgeAttribute.LABEL: '...',
+ AirbridgeAttribute.VALUE: 100,
+ AirbridgeAttribute.QUERY: '...',
+ },
+ customAttributes: {
+ 'key1': '...',
+ 'key2': '...',
+ 'key3': '...',
+ });
Attention
The
action
,label
,value
,semanticAttributes
values, which are in the second parameter of theAirbridge.event.trackEvent
function must be included in the second parameter of theAirbridge.trackEvent
function.The
customAttributes
value, which is the second parameter of theAirbridge.event.trackEvent
function must be included in the third parameter of theAirbridge.trackEvent
function.
The functions Airbridge.state.setUser
and Airbridge.state.updateUser
have been replaced with the Airbridge.setUser related functions. The setUser
, updateUser
functions, which set user information all at once, are no longer supported.
- import 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
- ...
- Airbridge.state.setUser(
- User(
- id: '...',
- email: '...'
- ));
- Airbridge.state.updateUser(
- User(
- phone: '...'
- ));
+ import 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
+ ...
+ Airbridge.setUserID('...')
+ Airbridge.setUserEmail('...')
+ Airbridge.setUserPhone('...')
The Airbridge.setAttributionListener
function has been replaced with the Airbridge.setOnAttributionReceived
function.
- import 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
- ...
- Airbridge.setAttributionListener((attribution) {
- // using attribution
- });
+ import 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
+ ...
+ Airbridge.setOnAttributionReceived((attribution) {
+ // using attribution
+ });
The Airbridge.placement.click
, Airbridge.placement.impression
functions have been replaced with the Airbridge.click
, Airbridge.impression
functions.
- import 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
- ...
- Airbridge.placement.click(url);
- Airbridge.placement.impression(url);
+ import 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
+ ...
+ Airbridge.click(url);
+ Airbridge.impression(url);
The Airbridge.createWebInterface
function has been replaced with the Airbridge.createWebInterfaceScript
, Airbridge.handleWebInterfaceCommand
functions.
- var webInterface = Airbridge.createWebInterface(
- webToken: 'YOUR_WEB_TOKEN',
- postCommandFunction: (arg) {
- return """window.flutter_inappwebview.callHandler('postMessage', $arg);""";
- });
- ...
- InAppWebView(
- initialUrlRequest: URLRequest(url: WebUri('https://...')),
- onWebViewCreated: (controller) async {
- controller.addJavaScriptHandler(handlerName: 'postMessage', callback: (args) {
- webInterface.handle(args[0]);
- return args;
- });
- },
- initialUserScripts: UnmodifiableListView<UserScript>([
- UserScript(
- source: webInterface.script,
- injectionTime: UserScriptInjectionTime.AT_DOCUMENT_START)
- ]),
- ...
- )
- ...
+ Future<String?> getJavascriptInterface() async {
+ return await Airbridge.createWebInterfaceScript(
+ webToken: 'YOUR_WEB_TOKEN',
+ postMessageScript: 'window.flutter_inappwebview.callHandler(payload);',
+ );
+ }
+ ...
+ FutureBuilder(
+ future: getJavascriptInterface(),
+ builder: (BuildContext context, AsyncSnapshot snapshot) {
+ return
+ ...
+ InAppWebView(
+ initialUrlRequest: URLRequest(url: WebUri('https://...')),
+ onWebViewCreated: (controller) async {
+ controller.addJavaScriptHandler(handlerName: 'postMessage', callback: (args) {
+ Airbridge.handleWebInterfaceCommand(args[0]);
+ return args;
+ });
+ },
+ initialUserScripts: UnmodifiableListView<UserScript>([
+ UserScript(
+ source: snapshot.data ?? "",
+ injectionTime: UserScriptInjectionTime.AT_DOCUMENT_START)
+ ]),
+ )
+ ...
+ });
+ ...
See the major changes in each version of the Flutter SDK.
For Airbridge Apps created after September 4, 2023, an issue where the deep link URL provided in the deep link callback was decoded twice from the content entered in the Airbridge dashboard has been resolved. This issue was found in versions v3.4.2 to v3.4.7.
For Airbridge Apps created after September 4, 2023, the "airbridge_referrer" will no longer be added to the deep link URL provided in the deep link callback.
In the case of an iOS app update, the last calculated SKAdNetwork Conversion Value is finalized. No additional calculations are processed.
In versions earlier than v3.4.2, the SKAdNetwork Conversion Value is only calculated for up to 24 hours.
This does not affect users who newly installed the app.
deeplink.page
has been deprecated. From v3.4.2, we recommend writing code using the deep link domain, abr.ge
.
deeplink.page
will still be supported and functioning for backward compatibility.
The Kotlin plugin version has been updated to 1.5.21.
The default value of "trackingAuthorizeTimeout" has been changed to 30 seconds.
Was this page helpful?