You'll find what you need to know about the process of updating the Airbridge Unity SDK. We recommend that you check everything from the current version onwards to the version after the update.
Confirm once you update the Airbridge Unity SDK to v4.0.
Airbridge Settings (v1) | Airbridge Settings (v4) | Change |
---|---|---|
App Name | App Name | - |
App Token | App Token | - |
Log Level | Log Level | - |
iOS URI Scheme | iOS URI Scheme | - |
Android URI Scheme | Android URI Scheme | - |
Custom Domain | Custom Domain | Multiple inputs are now supported. |
Session Timeout Seconds | Session Timeout Seconds | - |
User Info Hash Enabled | User Info Hash Enabled | - |
Location Collection Enabled | Location Collection Enabled | - |
Track Airbridge Link Only | Track Airbridge Link Only | - |
Auto Start Tracking Enabled | Auto Start Tracking Enabled | - |
Facebook Deferred App Link Enabled | Facebook Deferred App Link Enabled | - |
iOS Tracking Authorize Timeout Seconds | iOS Tracking Authorize Timeout Seconds | - |
Sdk Signature Secret ID | SDK Signature Secret ID | The name has been changed. |
Sdk Signature Secret | SDK Signature Secret | The name has been changed. |
- | Track In Session Life Cycle Event Enabled | New features have been added. |
- | Pause Event Transmit On Background Enabled | New features have been added. |
- | Clear Event Buffer On Initialize Enabled | New features have been added. |
- | SDK Enabled | New features have been added. |
- | App Market Identifier | New features have been added. |
- | Event Buffer Count Limit | New features have been added. |
- | Event Buffer Size Limit In Gibibyte | New features have been added. |
- | Event Transmit Interval Seconds | New features have been added. |
Meta Install Referrer (Facebook App ID) | Meta Install Referrer (Facebook App ID) | - |
In-App Purchase Environment | - | v4.0.0 does not support this feature. |
Attention
The name of the access function class has been changed from
AirbridgeUnity
toAirbridge
.
AirbridgeUnity (v1) | Airbridge (v4) | Change |
---|---|---|
- | EnableSDK | New features have been added. |
- | DisableSDK | New features have been added. |
IsSDKEnabled | IsSDKEnabled | - |
StartTracking | StartTracking | - |
StopTracking | StopTracking | - |
- | IsTrackingEnabled | New features have been added. |
SetUser | - | It has been replaced with functions related to User. |
- | 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. |
ExpireUser | ClearUser | The name has been changed. |
ClickTrackingLink | Click | The name has been changed. Callback function has been added. |
ImpressionTrackingLink | Impression | The name has been changed. Callback function has been added. |
SetDeeplinkCallback | SetOnDeeplinkReceived | The name has been changed. The value has been changed to be received in lambda form. |
SetOnAttributionReceived | SetOnAttributionReceived | The value has been changed to be received in lambda form. |
TrackEvent | TrackEvent | The method of receiving event information in TrackEvent has changed. |
SetDeviceAlias | SetDeviceAlias | - |
RemoveDeviceAlias | RemoveDeviceAlias | - |
ClearDeviceAlias | ClearDeviceAlias | - |
RegisterPushToken | RegisterPushToken | - |
CreateWebInterface | - | It has been replaced with functions related to WebInterface. |
- | CreateWebInterfaceScript | New features have been added. |
- | HandleWebInterfaceCommand | New features have been added. |
FetchAirbridgeGeneratedUUID | FetchAirbridgeGeneratedUUID | The callback function has been added. |
FetchDeviceUUID | FetchDeviceUUID | onFailure callback has been added. |
StartInAppPurchaseTracking | - | v4.0.0 does not support this feature. |
StopInAppPurchaseTracking | - | v4.0.0 does not support this feature. |
SetOnInAppPurchaseReceived | - | v4.0.0 does not support this feature. |
- | IsUninstallTrackingNotification | New features have been added. |
Airbridge.Constants.CATEGORY (v1) | AirbridgeCategory (v4) | Change |
---|---|---|
SIGN_UP | SIGN_UP | - |
SIGN_IN | SIGN_IN | - |
SIGN_OUT | SIGN_OUT | - |
VIEW_HOME | - | The feature has been removed. Please enter in HOME_VIEWED. |
HOME_VIEWED | HOME_VIEWED | - |
VIEW_SEARCH_RESULT | - | The feature has been removed. Please enter in SEARCH_RESULTS_VIEWED. |
SEARCH_RESULTS_VIEWED | SEARCH_RESULTS_VIEWED | - |
VIEW_PRODUCT_LIST | - | The feature has been removed. Please enter in PRODUCT_LIST_VIEWED. |
PRODUCT_LIST_VIEWED | PRODUCT_LIST_VIEWED | - |
VIEW_PRODUCT_DETAILS | - | The feature has been removed. Please enter in PRODUCT_VIEWED. |
PRODUCT_VIEWED | PRODUCT_VIEWED | - |
ADD_TO_CART | - | The feature has been removed. Please enter in ADDED_TO_CART. |
ADDED_TO_CART | ADDED_TO_CART | - |
ORDER_COMPLETE | - | The feature has been removed. Please enter in ORDER_COMPLETED. |
ORDER_COMPLETED | ORDER_COMPLETED | - |
ADD_PAYMENT_INFO | ADD_PAYMENT_INFO | - |
ADD_TO_WISHLIST | ADD_TO_WISHLIST | - |
INITIATE_CHECKOUT | INITIATE_CHECKOUT | - |
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 | - |
AirbridgeEvent (v1) | AirbridgeAttribute (v4) | Change |
---|---|---|
SetAction | ACTION | Changed to constant key value. |
SetLabel | LABEL | Changed to constant key value. |
SetValue | VALUE | Changed to constant key value. |
SetTotalValue | - | The feature has been removed. Please enter in VALUE. |
SetCurrency | CURRENCY | Changed to constant key value. |
originalCurrency | ORIGINAL_CURRENCY | Changed to constant key value. |
SetProducts | PRODUCTS | Changed to constant key value. |
SetPeriod | PERIOD | Changed to constant key value. |
SetIsRenewal | IS_RENEWAL | Changed to constant key value. |
SetRenewalCount | RENEWAL_COUNT | Changed to constant key value. |
SetProductListId | PRODUCT_LIST_ID | Changed to constant key value. |
SetCartId | CART_ID | Changed to constant key value. |
SetTransactionId | TRANSACTION_ID | Changed to constant key value. |
SetTransactionType | TRANSACTION_TYPE | Changed to constant key value. |
SetTransactionPairedEventCategory | TRANSACTION_PAIRED_EVENT_CATEGORY | Changed to constant key value. |
SetTransactionPairedEventTimestamp | TRANSACTION_PAIRED_EVENT_TIMESTAMP | Changed to constant key value. |
SetTotalQuantity | TOTAL_QUANTITY | Changed to constant key value. |
SetQuery | QUERY | Changed to constant key value. |
SetInAppPurchased | IN_APP_PURCHASED | Changed to constant key value. |
SetContributionMargin | CONTRIBUTION_MARGIN | Changed to constant key value. |
SetOriginalContributionMargin | ORIGINAL_CONTRIBUTION_MARGIN | Changed to constant key value. |
SetListId | LIST_ID | Changed to constant key value. |
SetRateId | RATE_ID | Changed to constant key value. |
SetRate | RATE | Changed to constant key value. |
SetMaxRate | MAX_RATE | Changed to constant key value. |
SetAchievementId | ACHIEVEMENT_ID | Changed to constant key value. |
SetSharedChannel | SHARED_CHANNEL | Changed to constant key value. |
SetDatetime | DATE_TIME | Changed to constant key value. |
SetDescription | DESCRIPTION | Changed to constant key value. |
SetIsRevenue | IS_REVENUE | Changed to constant key value. |
SetPlace | PLACE | Changed to constant key value. |
SetScheduleId | SCHEDULE_ID | Changed to constant key value. |
SetType | TYPE | Changed to constant key value. |
SetLevel | LEVEL | Changed to constant key value. |
SetScore | SCORE | Changed to constant key value. |
- | AD_PARTNERS | New features have been added. |
- | IS_FIRST_PER_USER | New features have been added. |
Airbridge.Ecommerce.Product (v1) | AirbridgeAttribute (v4) | Change |
---|---|---|
SetId | PRODUCT_ID | Changed to constant key value. |
SetName | PRODUCT_NAME | Changed to constant key value. |
SetPrice | PRODUCT_PRICE | Changed to constant key value. |
SetQuantity | PRODUCT_QUANTITY | Changed to constant key value. |
SetCurrency | PRODUCT_CURRENCY | Changed to constant key value. |
SetPosition | PRODUCT_POSITION | Changed to constant key value. |
SetCategoryId | PRODUCT_CATEGORY_ID | Changed to constant key value. |
SetCategoryName | PRODUCT_CATEGORY_NAME | Changed to constant key value. |
SetBrandId | PRODUCT_BRAND_ID | Changed to constant key value. |
SetBrandName | PRODUCT_BRAND_NAME | Changed to constant key value. |
AirbridgeUnity (v1) | AirbridgeUnity (v4) | Change |
---|---|---|
processDeeplinkData | processHandleDeeplink | The name has been changed. |
Attention
When updating the Airbridge Unity SDK from v1.x.x to v4.0.0, please first remove the folders below that were previously imported and add the Airbridge Unity SDK v4.0.0 package.
Assets/Airbridge
Assets/Plugins/Airbridge
The key values of Assets/Airbridge/Resources/AirbridgeData.asset
have been changed. Change the key values as follows.
AirbridgeData.asset (v1) | AirbridgeData.asset (v4) |
---|---|
iosUriScheme | iOSURIScheme |
The AirbridgeUnity.StartTracking
function has been replaced with the Airbridge.StartTracking
function.
- AirbridgeUnity.StartTracking();
+ Airbridge.StartTracking();
The AirbridgeUnity.StopTracking
function has been replaced with the Airbridge.StopTracking
function.
- AirbridgeUnity.StopTracking();
+ Airbridge.StopTracking();
The AirbridgeUnity.SetDeeplinkCallback
function has been replaced with the Airbridge.SetOnDeeplinkReceived
function.
public class AirbridgeManager : MonoBehaviour
{
private void Awake()
{
- AirbridgeUnity.SetDeeplinkCallback(gameObject.name);
+ Airbridge.SetOnDeeplinkReceived((string url) =>
+ {
+ // show proper content
+ });
}
- // Method will call by Airbridge when deeplink detected
- private void OnTrackingLinkResponse(string url)
- {
- // show proper content
- }
}
In Android, the AirbridgeUnity.processDeeplinkData
function has been replaced with the AirbridgeUnity.processHandleDeeplink
function.
package co.ab180.airbridge.unity;
@Override
protected void onResume() {
super.onResume();
- AirbridgeUnity.processDeeplinkData(getIntent());
+ AirbridgeUnity.processHandleDeeplink(getIntent());
}
Attention
Please enter the value into
AirbridgeAttribute.VALUE
instead of the existingAirbridgeEvent.SetTotalValue
.The logic where
totalValue
overwritesvalue
iftotalValue
is used andvalue
is defined has been removed from Unity SDK v4.0.0.
The AirbridgeUnity.TrackEvent
function has been replaced with the Airbridge.TrackEvent
function.
Please change the function AirbridgeUnity.TrackEvent
to Airbridge.TrackEvent
following the example code below.
- AirbridgeEvent @event = new AirbridgeEvent(Airbridge.Constants.CATEGORY.ORDER_COMPLETED);
- // action
- @event.SetAction("Tool");
- // label
- @event.SetLabel("Hammer");
- // value
- @event.SetValue(10);
-
- // semantic attribute (provided by sdk)
- @event.SetCurrency("USD");
-
- List<Airbridge.Ecommerce.Product> products = new List<Airbridge.Ecommerce.Product>();
- Airbridge.Ecommerce.Product plasticHammer = new Airbridge.Ecommerce.Product();
- // semantic attribute value (provided by sdk)
- plasticHammer.SetId("12345");
- // semantic attribute value (not provided by sdk)
- plasticHammer.AddData("name", "PlasticHammer");
- products.Add(plasticHammer);
- @event.SetProducts(products.ToArray());
-
- // semantic attribute (not provided by sdk)
- @event.AddSemanticAttribute("totalQuantity", 1);
-
- // custom attribute
- @event.AddCustomAttribute("promotion", "FirstPurchasePromotion");
+ Airbridge.TrackEvent(
+ category: AirbridgeCategory.ORDER_COMPLETED,
+ semanticAttributes: new Dictionary<string, object>()
+ {
+ // action
+ { AirbridgeAttribute.ACTION, "Tool" },
+ // label
+ { AirbridgeAttribute.LABEL, "Hammer" },
+ // value
+ { AirbridgeAttribute.VALUE, 10 },
+ // semantic attribute (provided by sdk)
+ { AirbridgeAttribute.CURRENCY, "USD" },
+ {
+ AirbridgeAttribute.PRODUCTS, new List<Dictionary<string, object>>()
+ {
+ new Dictionary<string, object>()
+ {
+ // semantic attribute value (provided by sdk)
+ { AirbridgeAttribute.PRODUCT_ID, "12345" },
+ // semantic attribute value (not provided by sdk)
+ { "name", "PlasticHammer" }
+ }
+ }
+ },
+ // semantic attribute (not provided by sdk)
+ { "totalQuantity", 1 }
+ },
+ customAttributes: new Dictionary<string, object>()
+ {
+ // custom attribute
+ { "promotion", "FirstPurchasePromotion" }
+ }
+);
Attention
The
AirbridgeEvent
class has been removed.The first parameter of the
Airbridge.TrackEvent
function must includecategory
information contained in the AirbridgeEvent constructor.The second parameter of the
Airbridge.TrackEvent
function must include values fromAirbridgeEvent.SetAction
,AirbridgeEvent.SetLabel
,AirbridgeEvent.SetValue
, andSemantic Attributes
.The third parameter of the
Airbridge.TrackEvent
function must include values from theCustom Attributes
.
The functions AirbridgeUnity.SetUser
have been replaced with the #set-additional-user-information Airbridge.SetUser
related functions. The SetUser
function, which set user information all at once, are no longer supported.
- AirbridgeUser user = new AirbridgeUser();
- user.SetId("personID");
- user.SetEmail("persondoe@airbridge.io");
- user.SetPhoneNumber("1(123)123-1234");
- user.SetAttribute("key", "value");
- user.SetAlias("key", "value");
- AirbridgeUnity.SetUser(user);
+ Airbridge.SetUserID("personID");
+ Airbridge.SetUserEmail("persondoe@airbridge.io");
+ Airbridge.SetUserPhone("1(123)123-1234");
+ Airbridge.SetUserAttribute("key", "value");
+ Airbridge.SetUserAlias("key", "value");
The AirbridgeUnity.ImpressionTrackingLink
function has been replaced with the Airbridge.Impression
function.
- AirbridgeUnity.ImpressionTrackingLink("https://abr.ge/~~~");
+ Airbridge.Impression(
+ trackingLink: "https://abr.ge/~~~",
+ onSuccess: () =>
+ {
+ // Handle on success
+ },
+ onFailure: (Exception exception) =>
+ {
+ // Handle on failure
+ }
+);
The AirbridgeUnity.ClickTrackingLink
function has been replaced with the Airbridge.Click
function.
- AirbridgeUnity.ClickTrackingLink("https://abr.ge/~~~");
+ Airbridge.Click(
+ trackingLink: "https://abr.ge/~~~",
+ onSuccess: () =>
+ {
+ // Handle on success
+ },
+ onFailure: (Exception exception) =>
+ {
+ // Handle on failure
+ }
+);
The AirbridgeUnity.SetOnAttributionReceived
function has been replaced with the Airbridge.SetOnAttributionReceived
function.
public class AirbridgeManager : MonoBehaviour
{
private void Awake()
{
- AirbridgeUnity.SetOnAttributionReceived(gameObject.name);
+ Airbridge.SetOnAttributionReceived((Dictionary<string, object> attributionResult) =>
+ {
+ // using attribution
+ });
}
- // Method will call by Airbridge when attribution result received
- private void OnAttributionResultReceived(string data)
- {
- // using attribution
- }
}
- AirbridgeUnity.SetDeviceAlias("ADD_YOUR_KEY", "AND_YOUR_VALUE");
+ Airbridge.SetDeviceAlias("ADD_YOUR_KEY", "AND_YOUR_VALUE");
- AirbridgeUnity.RemoveDeviceAlias("DELETE_THIS_KEY");
+ Airbridge.RemoveDeviceAlias("DELETE_THIS_KEY");
- AirbridgeUnity.ClearDeviceAlias();
+ Airbridge.ClearDeviceAlias();
- bool isSDKEnabled = AirbridgeUnity.IsSDKEnabled();
+ bool isSDKEnabled = Airbridge.IsSDKEnabled();
The AirbridgeUnity.CreateWebInterface
function has been replaced with the Airbridge.CreateWebInterfaceScript
, Airbridge.HandleWebInterfaceCommand
functions.
private WebViewObject webViewObject;
string postMessageScript;
- AirbridgeWebInterface webInterface;
void Start()
{
string PostMessageGenerator(string arg) =>
$@"
if (window && window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.unityControl) {{
window.webkit.messageHandlers.unityControl.postMessage({arg});
}} else {{
var iframe = document.createElement('IFRAME');
iframe.setAttribute('src', 'unity:' + {arg});
document.documentElement.appendChild(iframe);
iframe.parentNode.removeChild(iframe);
iframe = null;
}}";
- webInterface = AirbridgeUnity.CreateWebInterface(WebViewController.WebToken, (string command) => PostMessageGenerator(command));
- postMessageScript = webInterface.Script;
+ postMessageScript = Airbridge.CreateWebInterfaceScript(WebViewController.WebToken, PostMessageGenerator("payload"));
try
{
webViewObject.Init(
cb: (msg) =>
{
- webInterface.Handle(msg);
+ Airbridge.HandleWebInterfaceCommand(msg);
},
...
ld: (msg) =>
{
webViewObject.EvaluateJS(postMessageScript);
}
...
);
webViewObject.LoadURL("https://...");
}
catch (System.Exception e)
{
...
}
}
Was this page helpful?