Skip to main content
NoteBefore proceeding with the hybrid app setup, install the Airbridge Unity SDK and Web SDK.
You can configure the Airbridge Unity SDK to handle Airbridge-related tasks occurring within the in-app website of a hybrid app without modifying the website’s code.

Handle Web SDK Commands with the Unity SDK

The Unity SDK can handle commands related to event transmission, device settings, and user settings that occur within the Web SDK. Before displaying the website in the web view, configure the Unity SDK using the Airbridge.CreateWebInterfaceScript and Airbridge.HandleWebInterfaceCommand functions.
  • webToken: This is the Web SDK token. Your Web SDK token can be found on the [Settings]>[Tokens] page in the Airbridge dashboard.
  • postMessageScript: This JavaScript code transmits the payload variable, which stores the command passed from the Web SDK to the Unity SDK, to the Unity area.
  • command: This command is passed from the Web SDK to the Unity SDK.

Attention

Note that with the hybrid app setup, events that occur in the in-app web view must be collected through the Web SDK only. If collected through the App SDK as well, event duplication will occur. If your in-app web view uses a live mobile website, utilize only the Web SDK for event collection.