[WIP] SDK Migration - Expo SDK (v4)

    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 Airbridge apps created after September 4, 2023, the issue where the deep link URL provided in the deep link callback decodes the content entered in the Airbridge dashboard twice has been resolved in versions v2.5.0 ~ v2.5.2.

    For Airbridge apps created after September 4, 2023, the DeepLink URL provided in the DeepLink callback no longer adds airbridge_referrer.

    If you update your iOS app, it becomes final with the last calculated SKAdNetwork Conversion Value, and it does not calculate additionally.

    • Versions under 2.5.1 calculate SKAdNetwork Conversion Value for only up to 24 hours.

    • This won't be a problem for newly installed users.

    deeplink.page has been deprecated. From 2.5.1 onwards, we recommend you create code using the DeepLink domain abr.ge.

    • deeplink.page is still supported and functions 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?