SDK Migration - Expo SDK

You'll find what you need to know about the process of updating the Airbridge Expo SDK. We recommend that you check everything from the current version onwards to the version after the update.

Update from v2.x to v4.0

Confirm once you update the Airbridge Expo SDK to v4.0.

SDK installation and initialization

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 Airbridge.setDeeplinkListener function has been replaced with the Airbridge.setOnDeeplinkReceived function.

12345678910
- import Airbridge from 'airbridge-react-native-sdk'
- ...
- Airbridge.setDeeplinkListener((url) => {
-     // show proper content
- })
+ import { Airbridge } from 'airbridge-react-native-sdk'
+ ...
+ Airbridge.setOnDeeplinkReceived((url) => {
+     // show proper content
+ })

In-app events and user data

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.

123456789101112131415161718192021222324252627
- import Airbridge, { AirbridgeAttributes } from 'airbridge-react-native-sdk'
- ...
- Airbridge.event.trackEvent('event', {
-     action: '...',
-     label: '...',
-     value: 100,
-     semanticAttributes: {
-         [AirbridgeAttributes.QUERY]: '...',
-     },
-     customAttributes: {
-         'key1': '...',
-         'key2': '...',
-         'key3': '...',
-     },
- })
+ import { Airbridge, AirbridgeAttribute } from 'airbridge-react-native-sdk'
+ ...
+ Airbridge.trackEvent('event', {
+     [AirbridgeAttribute.ACTION]: '...',
+     [AirbridgeAttribute.LABEL]: '...',
+     [AirbridgeAttribute.VALUE]: 100,
+     [AirbridgeAttribute.QUERY]: '...',
+ }, {
+     'key1': '...',
+     'key2': '...',
+     'key3': '...',
+ })

Attention

The action , label , value , semanticAttributes values, which are in the second parameter of the Airbridge.event.trackEvent function must be included in the second parameter of the Airbridge.trackEvent function.

The customAttributes value, which is the second parameter of the Airbridge.event.trackEvent function must be included in the third parameter of the Airbridge.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.

123456789
- import Airbridge from 'airbridge-react-native-sdk'
- ...
- Airbridge.state.setUser({ ID: '...', email: '...' })
- Airbridge.state.updateUser({ phone: '...' })
+ import { Airbridge } from 'airbridge-react-native-sdk'
+ ...
+ Airbridge.setUserID('...')
+ Airbridge.setUserEmail('...')
+ Airbridge.setUserPhone('...')

Additional settings

The Airbridge.setAttributionListener function has been replaced with the Airbridge.SetOnAttributionReceived function.

12345678910
- import Airbridge from 'airbridge-react-native-sdk'
- ...
- Airbridge.setAttribuitonListener((attribution) => {
-     // using attribution
- })
+ import { Airbridge } from 'airbridge-react-native-sdk'
+ ...
+ Airbridge.setOnAttributionReceived((attribution) => {
+     // using attribution
+ })

The Airbridge.placement.click , Airbridge.placement.impression functions have been replaced with the Airbridge.click , Airbridge.impression functions.

12345678
- import Airbridge from 'airbridge-react-native-sdk'
- ...
- Airbridge.placement.click(url)
- Airbridge.placement.impression(url)
+ import { Airbridge } from 'airbridge-react-native-sdk'
+ ...
+ Airbridge.click(url)
+ Airbridge.impression(url)

The Airbridge.createWebInterface function has been replaced with the Airbridge.createWebInterfaceScript , Airbridge.handleWebInterfaceCommand functions.

12345678910111213141516171819202122
- import Airbridge from 'airbridge-react-native-sdk'
- ...
- const { script, handle } = Airbridge.createWebInterface(
-     'YOUR_WEB_TOKEN',
-     (command) => { 
-         return `window.ReactNativeWebView.postMessage(${command})`
-     },
- )
- <WebView
-     source={{ uri: 'https://...' }}
-     onMessage={(command) => { handle(command) }}
-     injectedJavaScript={script} />
+ import { Airbridge } from 'airbridge-react-native-sdk'
+ ...
+ const script = await Airbridge.createWebInterface(
+     'YOUR_WEB_TOKEN',
+     'window.ReactNativeWebView.postMessage(payload)',
+ )
+ <WebView
+     source={{ uri: 'https://...' }}
+     onMessage={(command) => { Airbridge.handleWebInterfaceCommand(command) }}
+     injectedJavaScript={script} />

Update within v2.x

See the major changes in each version of the Expo SDK.

For apps registered with Airbridge 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 v2.7.3 to v2.5.1.

For apps registered with Airbridge 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 v2.5.1, 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 v2.5.1, we recommend writing code using the deep link domain, abr.ge.

  • deeplink.page will still be supported and functioning for backward compatibility.

v2.5.0 - User privacy

The default value for trackingAuthorizeTimeout has been changed to 30 seconds.

Was this page helpful?

Have any questions or suggestions?