Airbridge Unity SDK supports Unity version
2018.4
or above.
Attention
The Airbridge Unity SDK uses unity-jar-resolver (External Dependency Manager for Unity) to manage library dependencies.
If you're using Unity SDK v1.9.2 or lower, please refer to this page and finish the Unity package setup.
Airbridge Unity SDK v1.9.3+ automatically imports all Airbridge plugins and EDM4U assets, therefore any additional settings are unnecessary for the Unity package.
Download the latest version of the Airbridge Unity SDK.
Go to "Assets → Import Package → Custom Package..." and import the downloaded package file.
The AB180 tab will appear in the menu once the package is installed.
Click "AB180 → Airbridge Settings" to see the following screen.
Attention
Press "Update iOS App Setting" or "Update Android Manifest" to apply the changes.
Attention
If you want to customize or merge the
AndroidManifest
file, please refer to "Project → Plugins → Airbridge → Android → AndroidManifest.xml".
Fill in the "App Name" and "App Token" fields at "AB180 → Airbridge Settings".
This information can be found at the "Airbridge dashboard → Settings → Tokens".
No additional initialization is required for the Airbridge Unity SDK. However, migration might be required for particular cases depending on the platform.
If you are using Unity 2023.1
or later, please set according to what [Application Entry Point] is set at in your project, under [Android Player Settings] > [Other Settings] > [Configuration].
If you did not set it separately, follow the GameActivity guide for Unity 6 version, and follow the Activity guide for versions below Unity 6.
You do not require additional work because the Android Manifest file is automatically updated with the values set in the "AB180 → Airbridge Settings".
You do not require additional work because the Android Manifest file is automatically updated with the values set in the "AB180 → Airbridge Settings".
The custom Activity provided by the Airbridge Unity SDK is an Activity that inherits from com.unity3d.player.UnityPlayerActivity, so it requires additional steps as follows.
Please remove the file Assets/Plugins/Airbridge/Android/java/co/ab180/airbridge/unity/AirbridgeActivity.java
.
Please create a Custom Activity file (AirbridgeGameActivity.java
) as follows.
package co.ab180.airbridge.unity;
import android.content.Intent;
import android.os.Bundle;
import com.unity3d.player.UnityPlayerGameActivity;
public class AirbridgeGameActivity extends UnityPlayerGameActivity {
@Override
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
}
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
setIntent(intent);
}
@Override
protected void onResume() {
super.onResume();
AirbridgeUnity.processDeeplinkData(getIntent());
}
}
Please register the Custom Activity as follows in the Android Manifest file ({UNITY_PROJECT}/Plugins/Android/AndroidManifest.xml
).
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<application>
<activity android:name="co.ab180.airbridge.unity.AirbridgeGameActivity"
android:theme="@style/BaseUnityGameActivityTheme"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
<meta-data android:name="android.app.lib_name" android:value="game" />
</activity>
</application>
</manifest>
Attention
Multiple application entries should only be specified for development purposes.
Refer to the AirbridgeActivity.java.template
file and AirbridgeGameActivity.java.template
file located inside the {UNITY_PROJECT}/Plugins/Airbridge/Android/java/co/ab180/airbridge/unity
folder to create your activities.
Apply each activity to your Android Manifest file.
The Android Manifest file will then be automatically updated with the values set in the "AB180 → Airbridge Settings".
Airbridge Unity SDK does not provide a custom Activity that inherits from com.unity3d.player.UnityPlayerGameActivity, and setting the Intent Filter to the value set in the "AB180 → Airbridge Settings" is only automatic for one Activity, so the following additional work is required.
Please create a Custom Activity file (AirbridgeGameActivity.java
) as follows.
package co.ab180.airbridge.unity;
import android.content.Intent;
import android.os.Bundle;
import com.unity3d.player.UnityPlayerGameActivity;
public class AirbridgeGameActivity extends UnityPlayerGameActivity {
@Override
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
}
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
setIntent(intent);
}
@Override
protected void onResume() {
super.onResume();
AirbridgeUnity.processDeeplinkData(getIntent());
}
}
Please set the Android Manifest file ({UNITY_PROJECT}/Plugins/Android/AndroidManifest.xml
) as follows.
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<application>
<!--Used when Application Entry is set to Activity, otherwise remove this activity block-->
<activity android:name="co.ab180.airbridge.unity.AirbridgeActivity"
android:theme="@style/UnityThemeSelector"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</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.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>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="YOUR_APP_URI_SCHEME" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
</activity>
<!--Used when Application Entry is set to GameActivity, otherwise remove this activity block-->
<activity android:name="co.ab180.airbridge.unity.AirbridgeGameActivity"
android:theme="@style/BaseUnityGameActivityTheme"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</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.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>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="YOUR_APP_URI_SCHEME" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
<meta-data android:name="android.app.lib_name" android:value="game" />
</activity>
</application>
</manifest>
YOUR_APP_NAME
: App Name
field at "AB180 → Airbridge Settings".
YOUR_APP_URI_SCHEME
: Android URI Scheme
field at "AB180 → Airbridge Settings".
Check if install events are sent when the application is installed and opened.
Events from the Airbridge SDK are shown at the "Airbridge Dashboard → Raw Data → App Real-time Logs".
Go to Airbridge Dashboard → Raw Data → App Real-time Logs
.
Search for the device's ADID (IDFA, IDFV, GAID).
Attention
Logs may be delayed for up to 5 minutes.
Please refer to the guides below to setup your deep links in the Airbridge dashboard.
Fill in the "iOS URI Scheme" field at "AB180 → Airbridge Settings".
This information can be found at the "Airbridge dashboard → Tracking Link → Deep Link".
Fill in the "Android URI Scheme" field at "AB180 → Airbridge Settings".
This information can be found at the "Airbridge dashboard → Tracking Link → Deep Link".
The deeplink.page
or abr.ge
domains are available when creating a tracking link at the Airbridge dashboard. Customized URLs such as go.my_company.com/abcd
can also be used as tracking links to improve the branding and CTR (Click Through Rate).
Please follow this guide to setup custom domains.
Fill in the "Custom Domain" field at "AB180 → Airbridge Settings".
Register an object as below using SetDeeplinkCallback
to receive user-clicked deep link data.
private void Awake()
{
AirbridgeUnity.SetDeeplinkCallback("AirbridgeManager");
}
Airbridge will receive the deep link URL once SetDeeplinkCallback
is set as above.
using UnityEngine;
public class AirbridgeManager : MonoBehaviour
{
private void Awake() {
AirbridgeUnity.SetDeeplinkCallback("AirbridgeManager");
}
// Method will call by Airbridge when deeplink detected
private void OnTrackingLinkResponse(string url)
{
}
}
The Airbridge Unity SDK uses Unity's
UnitySendMessage
method to forward deep link information.
Click on your URI scheme to test if your deep link has been properly set up in the Airbridge SDK.
YOUR_APP_URI_SCHEME://
The results will show on the "Airbridge dashboard → Raw Data → App Real-time Log" page if everything is working.
To measure the fragmented contributions of users between web and app, Airbridge collects the following user identifier information.
User Email: Email address
User Phone: Phone number
User ID: Unique User ID (The ID value that specifies the user must be the same in both web and mobile)
User Alias: Identifiers that can represent users (e.g. loyalty program ID, affiliate integrated ID, etc)
The user's email and phone numbers are hashed (SHA256) by default and then sent to servers.
You can set the user identifier as below for the SDK.
Dictionary<string, string> alias = new Dictionary<string, string>();
AirbridgeUser user = new AirbridgeUser();
user.SetId("personID");
user.SetEmail("persondoe@airbridge.io");
user.SetPhoneNumber("1(123)123-1234");
user.SetAlias("key", "value");
AirbridgeUnity.SetUser(user);
Name | Description | Limitations |
---|---|---|
Id | User ID | - |
User email | Hashed by default | |
PhoneNumber | User phone number | Hashed by default |
Alias | User alias | - Maximum 10 aliases |
Once the user identifier has been configured, all events will be forwarded with the corresponding identity information.
Attention
The user identifier properties can be reset or overwritten through user events.
Additional user attributes can be used for more accurate Multi-Touch Attribution (MTA) analyses, additional internal data analyses, and linking third-party solutions.
Dictionary<string, object> attrs = new Dictionary<string, object>();
AirbridgeUser user = new AirbridgeUser();
user.SetAttributes("key", "value");
AirbridgeUnity.SetUser(user);
Name | Description | Limitations |
---|---|---|
Attributes | User attribute | - Maximum 100 attributes |
Attention
The user identifier properties can be reset or overwritten through user events.
Make sure that your user information settings are being properly sent through the SDK.
Configure user identifier information.
Send an event using the SDK.
Click the event at "Airbridge dashboard → Raw Data → App Real-time Logs"
Check if the user information is correctly sent under the user
block.
Setup a device alias through the Airbridge SDK. The alias will be sustained even after the app closes, unless otherwise deleted.
AirbridgeUnity.SetDeviceAlias("ADD_YOUR_KEY", "AND_YOUR_VALUE");
AirbridgeUnity.RemoveDeviceAlias("DELETE_THIS_KEY");
AirbridgeUnity.ClearDeviceAlias();
SetDeviceAlias(string key, string value) | Add the key value pair to the device identifier. |
RemoveDeviceAlias(string key) | Delete the corresponding device alias. |
ClearDeviceAlias() | Delete all device aliases. |
When important user actions occur, in-app events can be sent to measure performance by channel.
All event parameters are optional. However, more information about the event will help provide a more accurate analysis.
All events called by the Airbridge SDK can be sent with the following fields.
Name | Type | Description |
---|---|---|
Event Category | String | Name of the event Required |
Event Action | String | Event attribute 1 |
Event Label | String | Event attribute 2 |
Event Value | Float | Event attribute value |
Event Custom Attributes | Dictionary<string, object> | Custom attributes |
Event Semantic Attributes | Dictionary<string, object> | Semantic attributes |
Send standard user events with the SDK.
action
, label
, value
, attributes
can also be used when sending standard events.
Dictionary<string, string> alias = new Dictionary<string, string>();
AirbridgeUser user = new AirbridgeUser();
user.SetId(UserId);
user.SetEmail(Email);
user.SetPhoneNumber(Phone);
user.SetAlias(alias);
AirbridgeUnity.SetUser(user);
AirbridgeEvent @event = new AirbridgeEvent(Airbridge.Constants.CATEGORY.SIGN_UP);
AirbridgeUnity.TrackEvent(@event);
Dictionary<string, string> alias = new Dictionary<string, string>();
AirbridgeUser user = new AirbridgeUser();
user.SetId(UserId);
user.SetEmail(Email);
user.SetPhoneNumber(Phone);
user.SetAlias(alias);
AirbridgeUnity.SetUser(user);
AirbridgeEvent @event = new AirbridgeEvent(Airbridge.Constants.CATEGORY.SIGN_IN);
AirbridgeUnity.TrackEvent(@event);
AirbridgeEvent @event = new AirbridgeEvent(Airbridge.Constants.CATEGORY.SIGN_OUT);
AirbridgeUnity.TrackEvent(@event);
AirbridgeUnity.ExpireUser();
Attention
All user identifier properties will disappear after
sign out
is called.
Airbridge.Ecommerce.Product cocacola = new Airbridge.Ecommerce.Product();
cocacola.SetId("beverage_1");
cocacola.SetName("Coca Cola");
cocacola.SetPrice(1.25);
cocacola.SetCurrency("USD");
cocacola.SetQuantity(1);
cocacola.SetPosition(0);
AirbridgeEvent @event = new AirbridgeEvent(Airbridge.Constants.CATEGORY.VIEW_HOME);
AirbridgeUnity.TrackEvent(@event);
List<Airbridge.Ecommerce.Product> beverages = new List<Airbridge.Ecommerce.Product>();
Airbridge.Ecommerce.Product cocacola = new Airbridge.Ecommerce.Product();
cocacola.SetId("beverage_1");
cocacola.SetName("Coca Cola");
cocacola.SetPrice(1.25);
cocacola.SetCurrency("USD");
cocacola.SetQuantity(1);
cocacola.SetPosition(0);
beverages.Add(cocacola);
Airbridge.Ecommerce.Product fanta = new Airbridge.Ecommerce.Product();
fanta.SetId("beverage_2");
fanta.SetName("Fanta");
fanta.SetPrice(10.99);
fanta.SetCurrency("USD");
fanta.SetQuantity(1);
fanta.SetPosition(1);
beverages.Add(fanta);
AirbridgeEvent @event = new AirbridgeEvent(Airbridge.Constants.CATEGORY.VIEW_SEARCH_RESULT);
@event.SetQuery("SELECT * FROM beverages");
@event.SetProducts(beverages.ToArray());
@event.SetValue(12.24);
AirbridgeUnity.TrackEvent(@event);
List<Airbridge.Ecommerce.Product> beverages = new List<Airbridge.Ecommerce.Product>();
Airbridge.Ecommerce.Product cocacola = new Airbridge.Ecommerce.Product();
cocacola.SetId("beverage_1");
cocacola.SetName("Coca Cola");
cocacola.SetPrice(1.25);
cocacola.SetCurrency("USD");
cocacola.SetQuantity(1);
cocacola.SetPosition(0);
beverages.Add(cocacola);
Airbridge.Ecommerce.Product fanta = new Airbridge.Ecommerce.Product();
fanta.SetId("beverage_3");
fanta.SetName("Fanta");
fanta.SetPrice(10.99);
fanta.SetCurrency("USD");
fanta.SetQuantity(1);
fanta.SetPosition(2);
beverages.Add(fanta);
AirbridgeEvent @event = new AirbridgeEvent(Airbridge.Constants.CATEGORY.VIEW_PRODUCT_LIST);
@event.SetProductListId("beverage_list_0");
@event.SetProducts(beverages.ToArray());
@event.SetValue(12.24);
AirbridgeUnity.TrackEvent(@event);
Airbridge.Ecommerce.Product cocacola = new Airbridge.Ecommerce.Product();
cocacola.SetId("beverage_1");
cocacola.SetName("Coca Cola");
cocacola.SetPrice(1.25);
cocacola.SetCurrency("USD");
cocacola.SetQuantity(1);
cocacola.SetPosition(0);
AirbridgeEvent @event = new AirbridgeEvent(Airbridge.Constants.CATEGORY.VIEW_PRODUCT_DETAILS);
@event.SetProducts(cocacola);
AirbridgeUnity.TrackEvent(@event);
Airbridge.Ecommerce.Product cocacola = new Airbridge.Ecommerce.Product();
cocacola.SetId("beverage_1");
cocacola.SetName("Coca Cola");
cocacola.SetPrice(1.25);
cocacola.SetCurrency("USD");
cocacola.SetQuantity(1);
cocacola.SetPosition(0);
AirbridgeEvent @event = new AirbridgeEvent(Airbridge.Constants.CATEGORY.ADDED_TO_CART);
@event.SetProducts(cocacola);
@event.SetCurrency("USD");
@event.SetValue(1.25);
AirbridgeUnity.TrackEvent(@event);
List<Airbridge.Ecommerce.Product> beverages = new List<Airbridge.Ecommerce.Product>();
Airbridge.Ecommerce.Product cocacola = new Airbridge.Ecommerce.Product();
cocacola.SetId("beverage_1");
cocacola.SetName("Coca Cola");
cocacola.SetPrice(1.25);
cocacola.SetCurrency("USD");
cocacola.SetQuantity(1);
cocacola.SetPosition(0);
beverages.Add(cocacola);
Airbridge.Ecommerce.Product fanta = new Airbridge.Ecommerce.Product();
fanta.SetId("beverage_3");
fanta.SetName("Fanta");
fanta.SetPrice(10.99f);
fanta.SetCurrency("USD");
fanta.SetQuantity(1);
fanta.SetPosition(2);
beverages.Add(fanta);
AirbridgeEvent @event = new AirbridgeEvent(Airbridge.Constants.CATEGORY.ORDER_COMPLETED);
@event.SetTransactionId("transaction_123");
@event.SetProducts(beverages.ToArray());
@event.SetCurrency("USD");
@event.SetInAppPurchased(true);
@event.SetValue(1.25);
AirbridgeUnity.TrackEvent(@event);
Send custom events with the SDK.
AirbridgeEvent @event = new AirbridgeEvent("category");
@event.SetAction("action");
@event.SetLabel("label");
@event.SetValue(9999);
@event.AddCustomAttribute("custom_key", "value");
@event.AddSemanticAttribute("query", "query_123");
AirbridgeUnity.TrackEvent(@event);
To configure and deliver
Semantic Attributes
directly, please refer to this guide.
Make sure that the events are being properly sent through the SDK.
Send an event with the SDK.
Check if the event shows up at "Airbridge dashboard → Raw Data → App Real-time Logs".
Protection against SDK spoofing is possible once you input the "SDK Signature Secret ID" and "SDK Signature Secret" values in the "AB180 -> Airbridge Settings menu".
The SDK Signature Credentials are required for the SDK Signature setup. Refer to this article to learn how to create them.
Email addresses and phone numbers are hashed by default. (SHA256)
Settings can be changed by configuring the "User Info Hash Enabled" field at "AB180 → Airbridge Settings".
Attention
Other security measures must be taken internally when sensitive personal information such as "User Email" and "User Phone" is being handled.
The Airbridge Unity SDK does not send app open events again if the user reopens the app within the time configured at the "Session Timeout Seconds" field at "AB180 → Airbridge Settings".
Session timeout is in milliseconds and must range between 0 and 604800000 (7 days).
The default value is 1000 * 60 * 5 (5 minutes).
This feature is useful for conducting data collection and transmission in compliance with GDPR or CCPA.
You can explicitly start data collection and transmission by navigating to AB180
> Airbridge Settings
in the top menu bar of Unity, and selecting the Auto Start Tracking Enabled
field.
When this feature is disabled, the following function must be explicitly called for proper data collection.
AirbridgeUnity.StartTracking();
Attention
The instructions below are optional. Proceed only if necessary.
Opt-Out is a policy where user information is used until the user refuses.
After setting setAutoStartTrackingEnabled
to true
, call the stopTracking
function at the point where events cannot be collected. From the point when the stopTracking
function is called, events are not collected.
AirbridgeUnity.stopTracking();
If it is difficult to see the performance of re-engagement through Airbridge at a glance due to too many deep link actions within the advertiser's app, "Track Airbridge Link Only" field at "AB180 → Airbridge Settings" can be used to only filter results received through Airbridge deep links.
This option will measure deep links only if the following requirements are met.
The app is opened through a airbridge.io
link
The app is opened through a deeplink.page
link
The app is opened through a Custom Domain Setup that is registered on the Airbridge dashboard
The app is opened through a link that contains airbridge_referrer
information in the query
Airbridge Unity SDK can collect user location information through the "Location Collection Enabled" field at "AB180 → Airbridge Settings"
Attention
Location information must be collected for legal purposes through legal methods.
You can receive Facebook Deferred App Links from the Airbridge Unity SDK through by configuring "Facebook Deferred App Link Enabled" at "AB180 → Airbridge Settings".
Attention
The Facebook SDK setting must be installed in advance to use this feature.
See - https://developers.facebook.com/docs/unity/
When the AppTrackingTransparency.framework is used to present an app-tracking authorization request to the user, IDFA will not be collected when the install event occurs because the install event occurs before the selection.
The "iOS Tracking Authorize Timeout Seconds" field at "AB180 → Airbridge Settings" allows you to delay the transmission of installation events so that the IDFA value may be included.
Meta install referrer (MIR) Colection Setup supported by Airbridge Unity SDK in version 1.16.1 or higher. To collect data, set as below.
You can pass your Facebook App ID through by configuring "Meta Install Referrer (Facebook App ID)" at "AB180 → Airbridge Settings".
After adding the settings, you must enter the decryption key to see decrypted MIR. Refer to this article to learn about MIR.
This feature is available for only Unity SDK v1.9.0+.
1. Setup Firebase Cloud Messaging
Please refer to the official Firebase Cloud Messaging documentation for basic app setup.
2. Forward Firebase Push Token
Forward the push token to Airbridge using the RegisterPushToken
method.
public void Start() {
Firebase.Messaging.FirebaseMessaging.TokenReceived += OnTokenReceived;
Firebase.Messaging.FirebaseMessaging.MessageReceived += OnMessageReceived;
}
public void OnTokenReceived(object sender, Firebase.Messaging.TokenReceivedEventArgs token) {
#if UNITY_ANDROID
AirbridgeUnity.RegisterPushToken(token.Token);
#endif
}
// Make sure the notification is not shown on the device if the remote message value is airbridge-uninstall-tracking.
public void OnMessageReceived(object sender, Firebase.Messaging.MessageReceivedEventArgs e) {
if (e.Message.Data.ContainsKey("airbridge-uninstall-tracking")) return;
...
}
1. Setup Apple Push Notification Service
Please refer to the official Unity Mobile Notifications Package documentation and install the package.
2. Forward Device Token
Forward the device token to Airbridge using the RegisterPushToken
method.
void Start()
{
#if UNITY_IOS
StartCoroutine(RequestAuthorization());
#endif
}
#if UNITY_IOS
IEnumerator RequestAuthorization()
{
var authorizationOption = AuthorizationOption.Alert | AuthorizationOption.Badge;
using (var req = new AuthorizationRequest(authorizationOption, true))
{
while (!req.IsFinished)
{
yield return null;
};
if (req.Granted && req.DeviceToken != "")
{
AirbridgeUnity.RegisterPushToken(req.DeviceToken);
}
}
}
#endif
Additional events such as app installs, app open,s and deep link opens can't be tracked with just the web SDK. The following simple setup allows in-app events to be called for a hybrid app.
AirbridgeWebInterface webInterface;
webInterface = AirbridgeUnity.CreateWebInterface(
"YOUR_WEB_TOKEN", // web token
(msg) => $@"..." // post command function
);
AirbridgeUnity.CreateWebInterface
allows you to control the web interface.
Please refer to the Unity Hybrid App Integration Guide for more information.
Attention
Hybrid app setup is available for Airbridge Unity SDK v1.9.3+.
The Airbridge Unity SDK for Android initializes automatically through Content Provider. For proper initialization, the following XML tag must be correctly placed in "Project → Plugins → Android → AndroidManifest.xml".
<provider
android:authorities="${applicationId}.co.ab180.airbridge.unity.AirbridgeContentProvider"
android:name="co.ab180.airbridge.unity.AirbridgeContentProvider"
android:exported="false" />
The Airbridge Unity SDK uses custom activities in "UnityPlayerActivity" to get deep link data. If you are using your own custom activity class, please override the following codes inside your custom activity class.
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
setIntent(intent);
}
@Override
protected void onResume() {
super.onResume();
AirbridgeUnity.processDeeplinkData(getIntent());
}
The "AndroidManifest Merger" that the Airbridge Unity SDK provides is a simple component that merges "Project → Plugins → Android → AndroidManifest.xml" and "Project → Plugins → Airbridge → Android → AndroidManifest.xml". The merge may not satisfy all cases, and you will have to separately merge your "AndroidManifest.xml" file with reference to "Project → Plugins → Airbridge → Android → AndroidManifest.xml".
Due to the addition of Android 11's Package Visibility
policy, applications should be properly informed by <queries>
inside the manifest
file about which packages are used in order to properly interact with another applications.
The Airbridge SDK is compliant with the policy and requires Gradle v5.6.4+
and Android Gradle Plugin v3.6.0+
to support the <queries>
tag.
Please refer to this page for information on which version of Gradle is used by Unity.
No further action is required because the necessary Gradle and Android Gradle plugin exists.
The following customization is supported only on Unity 2019.3 patch 7 and later.
1. Go to the Gradle Build Tool page and download Gradle v5.6.4 or higher
2. Go to "Preferences → External Tools" to uncheck "Gradle Installed with Unity (recommended)" and set the path to the downloaded Gradle file as below.
3. Go to "Project Settings → Player → Android Tab → Publishing Settings → Build" and select the following options:
a. Custom Main Gradle Template
b. Custom Launcher Gradle Template
4. Please change both of the following auto-generated files as follows
Assets/Plugins/Android/mainTemplate.gradle
Assets/Plugins/Android/launcherTemplate.gradle
buildscript {
repositories {
google()
jcenter()
}
dependencies {
// Must be Android Gradle Plugin 3.6.0 or later. For a list of
// compatible Gradle versions refer to:
// https://developer.android.com/studio/releases/gradle-plugin
classpath 'com.android.tools.build:gradle:3.6.0'
}
}
allprojects {
repositories {
google()
jcenter()
flatDir {
dirs 'libs'
}
}
}
1. Go to the Gradle Build Tool page and download Gradle v5.6.4 or higher.
2. Go to "Preferences → External Tools" to uncheck "Gradle Installed with Unity (recommended)" and set the path to the downloaded Gradle file as below.
3. Go to "Project Settings → Player → Android Tab → Publishing Settings → Build" and select "Custom Gradle Template".
4. Go to the auto generated "Assets/Plugins/Android/MainTemplate.gradle" file and make the following changes.
buildscript {
dependencies {
// Must be Android Gradle Plugin 3.6.0 or later. For a list of
// compatible Gradle versions refer to:
// https://developer.android.com/studio/releases/gradle-plugin
classpath 'com.android.tools.build:gradle:3.6.0'
}
}
The following customization is supported only on Unity
2018.4 patch 24
and later
1. Go to the Gradle Build Tool page and download Gradle v5.6.4 or higher.
2. Go to "Build Settings → Android" and set "Build System" to "Gradle" to use a custom version of Gradle.
3. Go to "Preferences → External Tools", uncheck "Gradle Installed with Unity (recommended)" and set the path to the downloaded "Gradle" file.
4. Go to "Project Settings → Player → Android Tab → Publishing Settings → Build" and select the "Custom Gradle Template" option.
5. Go to the auto generated "Assets/Plugins/Android/MainTemplate.gradle" file and make the following changes.
buildscript {
dependencies {
// Must be Android Gradle Plugin 3.6.0 or later. For a list of
// compatible Gradle versions refer to:
// https://developer.android.com/studio/releases/gradle-plugin
classpath 'com.android.tools.build:gradle:3.6.0'
}
}
Gradle customizations are not supported on these versions of Unity and are not compatible with the necessary changes to support Android 11 (API level 30).
Airbridge Unity SDK uses IMPL_APP_CONTROLLER_SUBCLASS
to create a custom AppController. If you are using your own custom AppController, add the following code to your custom AppController.
- (BOOL) application:(UIApplication*)application
continueUserActivity:(NSUserActivity*)userActivity
restorationHandler:(void (^)(NSArray<id<UIUserActivityRestoring>>* _Nullable))restorationHandler
{
[AUAppDelegate.instance application:application
continueUserActivity:userActivity
restorationHandler:restorationHandler];
return YES;
}
Please remove the "Assets → Plugins → Airbridge → iOS → Delegate → AUAppController.mm" file once the above change has been made.
Error loading /var/containers/Bundle/Application/…/Frameworks/UnityFramework.framework/UnityFramework (…)
: dlopen(/var/containers/Bundle/Application/…/Frameworks/UnityFramework.framework/UnityFramework, …)
: Library not loaded: @rpath/AirBridge.framework/AirBridge
If you are using Airbridge Unity SDK version 1.14.1 or 1.16.2, Please update to version 1.16.3.
[!] CocoaPods could not find compatible versions for pod "AirBridge":
In Podfile:
AirBridge (= {MISSING_VERSION})
If you can't find a compatible AirBridge version on iOS,
execute the command below to update the source repository.
pod repo update
pod install --repo-update
After updating your source repository, run the pod search AirBrdige
command to verify that the correct AirBridge version exists in your repository, and then proceed with the iOS build.
Before updating the SDK, please review the following information.
With support for the privacy manifest, the Static Library has been changed to a Dynamic Library.
If you are installing using EDM4U, click on [Assets]>[External Dependency Manager]>[iOS Resolver]>[Settings] at the top of Unity to proceed with iOS builds after unchecking the 'Link frameworks statically' checkbox in the Podfile Configurations section of the iOS Resolver Settings window displayed.
Was this page helpful?