> ## Documentation Index
> Fetch the complete documentation index at: https://help.airbridge.io/llms.txt
> Use this file to discover all available pages before exploring further.

# SDK Migration - Unreal SDK

This article contains the information required to update the Airbridge Unreal SDK. We recommend checking the information regarding all versions.

## Update from v1.x.x to v4.0.0

Check the information below when updating the Airbridge Unreal SDK to v4.0.

<Accordion title="List of all changes">
  #### Option

  | 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         | New features have been added.      |
  | iOS Tracking Authorize Timeout Seconds  | iOS Tracking Authorize Timeout Seconds     | -                                  |
  | SDK Signature Secret ID                 | SDK Signature Secret ID                    | -                                  |
  | SDK Signature Secret                    | SDK Signature Secret                       | -                                  |
  | -                                       | 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)    | -                                  |

  #### Function (Unreal)

  <Danger>
    **Attention**

    The name of the access function class has been changed from `FAirbridgeUnreal` to `FAirbridge`.
  </Danger>

  | FAirbridgeUnreal (v1)  | FAirbridge (v4)                 | Change                                                                               |
  | ---------------------- | ------------------------------- | ------------------------------------------------------------------------------------ |
  | -                      | EnableSDK                       | New features have been added.                                                        |
  | -                      | DisableSDK                      | New features have been added.                                                        |
  | -                      | IsSDKEnabled                    | New features have been added.                                                        |
  | StartTracking          | StartTracking                   | -                                                                                    |
  | -                      | StopTracking                    | New features have been added.                                                        |
  | -                      | IsTrackingEnabled               | New features have been added.                                                        |
  | SetUserID              | SetUserID                       | -                                                                                    |
  | -                      | ClearUserID                     | New features have been added.                                                        |
  | SetUserEmail           | SetUserEmail                    | -                                                                                    |
  | -                      | ClearUserEmail                  | New features have been added.                                                        |
  | SetUserPhone           | SetUserPhone                    | -                                                                                    |
  | -                      | ClearUserPhone                  | New features have been added.                                                        |
  | SetUserAttribute       | SetUserAttribute                | -                                                                                    |
  | RemoveUserAttribute    | RemoveUserAttribute             | -                                                                                    |
  | ClearUserAttributes    | ClearUserAttributes             | -                                                                                    |
  | SetUserAlias           | SetUserAlias                    | -                                                                                    |
  | RemoveUserAlias        | RemoveUserAlias                 | -                                                                                    |
  | ClearUserAlias         | ClearUserAlias                  | -                                                                                    |
  | ClearUser              | ClearUser                       | -                                                                                    |
  | Click                  | Click                           | Callback function has been added.                                                    |
  | Impression             | Impression                      | Callback function has been added.                                                    |
  | SetDeeplinkCallback    | SetOnDeeplinkReceived           | The name has been changed. The value has been changed to be received in lambda form. |
  | SetAttributionCallback | SetOnAttributionReceived        | The name has been changed. 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     | New features have been added.                                                        |
  | -                      | FetchDeviceUUID                 | New features have been added.                                                        |
  | -                      | IsUninstallTrackingNotification | New features have been added.                                                        |

  #### Constant  (Unreal)

  | AirbridgeConstants::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          | -                                                                      |

  | AirbridgeConstants::ATTRIBUTES (v1)   | AirbridgeAttribute (v4)               | Change                                               |
  | ------------------------------------- | ------------------------------------- | ---------------------------------------------------- |
  | -                                     | ACTION                                | New features have been added.                        |
  | -                                     | LABEL                                 | New features have been added.                        |
  | -                                     | VALUE                                 | New features have been added.                        |
  | TOTAL\_VALUE                          | -                                     | The feature has been removed. Please enter in VALUE. |
  | CURRENCY                              | CURRENCY                              | -                                                    |
  | ORIGINAL\_CURRENCY                    | ORIGINAL\_CURRENCY                    | -                                                    |
  | PRODUCTS                              | PRODUCTS                              | -                                                    |
  | PERIOD                                | PERIOD                                | -                                                    |
  | IS\_RENEWAL                           | IS\_RENEWAL                           | -                                                    |
  | RENEWAL\_COUNT                        | RENEWAL\_COUNT                        | -                                                    |
  | PRODUCT\_LIST\_ID                     | PRODUCT\_LIST\_ID                     | -                                                    |
  | CART\_ID                              | CART\_ID                              | -                                                    |
  | TRANSACTION\_ID                       | TRANSACTION\_ID                       | -                                                    |
  | TRANSACTION\_TYPE                     | TRANSACTION\_TYPE                     | -                                                    |
  | TRANSACTION\_PAIRED\_EVENT\_CATEGORY  | TRANSACTION\_PAIRED\_EVENT\_CATEGORY  | -                                                    |
  | TRANSACTION\_PAIRED\_EVENT\_TIMESTAMP | TRANSACTION\_PAIRED\_EVENT\_TIMESTAMP | -                                                    |
  | TOTAL\_QUANTITY                       | TOTAL\_QUANTITY                       | -                                                    |
  | QUERY                                 | QUERY                                 | -                                                    |
  | IN\_APP\_PURCHASED                    | IN\_APP\_PURCHASED                    | -                                                    |
  | CONTRIBUTION\_MARGIN                  | CONTRIBUTION\_MARGIN                  | -                                                    |
  | ORIGINAL\_CONTRIBUTION\_MARGIN        | ORIGINAL\_CONTRIBUTION\_MARGIN        | -                                                    |
  | LIST\_ID                              | LIST\_ID                              | -                                                    |
  | RATE\_ID                              | RATE\_ID                              | -                                                    |
  | RATE                                  | RATE                                  | -                                                    |
  | MAX\_RATE                             | MAX\_RATE                             | -                                                    |
  | ACHIEVEMENT\_ID                       | ACHIEVEMENT\_ID                       | -                                                    |
  | SHARED\_CHANNEL                       | SHARED\_CHANNEL                       | -                                                    |
  | DATE\_TIME                            | DATE\_TIME                            | -                                                    |
  | DESCRIPTION                           | DESCRIPTION                           | -                                                    |
  | IS\_REVENUE                           | IS\_REVENUE                           | -                                                    |
  | PLACE                                 | PLACE                                 | -                                                    |
  | SCHEDULE\_ID                          | SCHEDULE\_ID                          | -                                                    |
  | TYPE                                  | TYPE                                  | -                                                    |
  | LEVEL                                 | LEVEL                                 | -                                                    |
  | SCORE                                 | SCORE                                 | -                                                    |
  | -                                     | AD\_PARTNERS                          | New features have been added.                        |
  | -                                     | IS\_FIRST\_PER\_USER                  | New features have been added.                        |

  | AirbridgeConstants::PRODUCT (v1) | AirbridgeAttribute (v4) | Change                         |
  | -------------------------------- | ----------------------- | ------------------------------ |
  | ID                               | PRODUCT\_ID             | Changed to constant key value. |
  | NAME                             | PRODUCT\_NAME           | Changed to constant key value. |
  | PRICE                            | PRODUCT\_PRICE          | Changed to constant key value. |
  | QUANTITY                         | PRODUCT\_QUANTITY       | Changed to constant key value. |
  | CURRENCY                         | PRODUCT\_CURRENCY       | Changed to constant key value. |
  | POSITION                         | PRODUCT\_POSITION       | Changed to constant key value. |
  | CATEGORY\_ID                     | PRODUCT\_CATEGORY\_ID   | Changed to constant key value. |
  | CATEGORY\_NAME                   | PRODUCT\_CATEGORY\_NAME | Changed to constant key value. |
  | BRAND\_ID                        | PRODUCT\_BRAND\_ID      | Changed to constant key value. |
  | BRAND\_NAME                      | PRODUCT\_BRAND\_NAME    | Changed to constant key value. |

  #### Function (Android)

  | - (v1) | AirbridgeUnreal (v4)    | Change                        |
  | ------ | ----------------------- | ----------------------------- |
  | -      | setLifecycleIntegration | New features have been added. |
</Accordion>

### SDK installation and initialization

The location of the Airbridge configuration values recorded in the `Project > Config > DefaultAirbridge.ini` file has been moved to the `[/Script/AirbridgeEditor.AirbridgeSettings]` section of the `Project > Config > DefaultEngine.ini` file.

The `FAirbridgeUnreal::StartTracking` function has been replaced with the `FAirbridge::StartTracking` function.

```diff lines theme={"theme":{"light":"github-dark-dimmed","dark":"github-dark-dimmed"}}
- FAirbridgeUnreal::StartTracking();
+ FAirbridge::StartTracking();
```

The `FAirbridgeUnreal::StopTracking` function has been replaced with the `FAirbridge::StopTracking` function.

```diff lines theme={"theme":{"light":"github-dark-dimmed","dark":"github-dark-dimmed"}}
- FAirbridgeUnreal::StopTracking();
+ FAirbridge::StopTracking();
```

### Deep Linking

The `FAirbridgeUnreal::SetDeeplinkCallback` function has been replaced with the `FAirbridge::SetOnDeeplinkReceived` function.

```diff lines theme={"theme":{"light":"github-dark-dimmed","dark":"github-dark-dimmed"}}
- AExampleGameModeBase::AExampleGameModeBase()
- {
-   AirbridgeCallbacks = CreateDefaultSubobject<UAirbridgeCallbacks>(TEXT("AIRBRIDGE_CALLBACKS"));
- }

void AExampleGameModeBase::BeginPlay()
{
-    AirbridgeCallbacks->OnDeeplinkReceived.AddDynamic(this, &AExampleGameModeBase::OnDeeplinkReceived);
-    FAirbridgeUnreal::SetDeeplinkCallback();
+    FAirbridge::SetOnDeeplinkReceived([](const FString& Url)
+    {
+        // show proper content
+    });
}

- void AExampleGameModeBase::OnDeeplinkReceived(const FString& Url)
- {
-     // show proper content 
- }
```

### Set up custom domain

In version 1.x, only one custom domain could be specified, but starting from version 4.0, multiple custom domains can be entered.

### In-app events and user data

The `FAirbridgeUnreal::TrackEvent` function has been replaced with the `FAirbridge::TrackEvent` function.

```diff lines theme={"theme":{"light":"github-dark-dimmed","dark":"github-dark-dimmed"}}
- FAirbridgeUnreal::TrackEvent(
-    AirbridgeConstants::CATEGORY::ORDER_COMPLETED,
-    UAirbridgeEventOption::CreateObject()
-    ->SetAction("Tool")
-    ->SetLabel("Hammer")
-    ->SetValue(10.0)
-    ->SetSemanticAttributes(
-        UAirbridgeMap::CreateObject()
-        ->Set(AirbridgeConstants::ATTRIBUTES::CURRENCY, "USD")
-        ->Set(AirbridgeConstants::ATTRIBUTES::PRODUCTS, UAirbridgeList::CreateObject()
-            ->Add(UAirbridgeMap::CreateObject()
-                ->Set(AirbridgeConstants::PRODUCT::ID, "12345")
-                ->Set("name", "PlasticHammer")
-            )
-        )
-        ->Set("totalQuantity", 1)
-    )
-    ->SetCustomAttributes(
-        UAirbridgeMap::CreateObject()
-        ->Set("promotion", "FirstPurchasePromotion")
-    )
- );
+ FAirbridge::TrackEvent(
+    AirbridgeCategory::ORDER_COMPLETED,
+    UAirbridgeMap::CreateObject()
+    ->Set(AirbridgeAttribute::ACTION, "Tool")
+    ->Set(AirbridgeAttribute::LABEL, "Hammer")
+    ->Set(AirbridgeAttribute::VALUE, 10)
+    ->Set(AirbridgeAttribute::CURRENCY, "USD")
+    ->Set(AirbridgeAttribute::PRODUCTS, UAirbridgeList::CreateObject()->Add(
+            UAirbridgeMap::CreateObject()
+            ->Set(AirbridgeAttribute::PRODUCT_ID, "12345")
+            ->Set("name", "PlasticHammer")
+        )
+    )
+    ->Set("totalQuantity", 1),
+    UAirbridgeMap::CreateObject()
+    ->Set("promotion", "FirstPurchasePromotion")
+ );
```

<Accordion title="Attention">
  The `AirbridgeConstants::CATEGORY` Namespace has been changed to `ArbridgeCategory` and the `AirbridgeConstants::ATTRIBUTES` Namespace has been changed to `AirbridgeAttribute`.

  The first parameter of the `FAirbridge::TrackEvent` function should now contain `category` information.

  The second parameter of the `FAirbridge::TrackEvent` function should contain the `Semantic Attributes` values.

  The third parameter of the `FAirbridge::TrackEvent` function should contain the `Custom Attributes` values.
</Accordion>

The `FAirbridgeUnreal::SetUser` function has been replaced with the `FAirbridge::SetUser` function.

```diff lines theme={"theme":{"light":"github-dark-dimmed","dark":"github-dark-dimmed"}}
- FAirbridgeUnreal::SetUserID("personID");
- FAirbridgeUnreal::SetUserEmail("persondoe@airbridge.io");
- FAirbridgeUnreal::SetUserPhone("1(123)123-1234");
- FAirbridgeUnreal::SetUserAttribute("key", "value");
- FAirbridgeUnreal::SetUserAlias("key", "value");
+ FAirbridge::SetUserID("personID");
+ FAirbridge::SetUserEmail("persondoe@airbridge.io");
+ FAirbridge::SetUserPhone("1(123)123-1234");
+ FAirbridge::SetUserAttribute("key", "value");
+ FAirbridge::SetUserAlias("key", "value");
```

### Additional settings

The `FAirbridgeUnreal::Impression` function has been replaced with the `FAirbridge::Impression` function.

```diff lines theme={"theme":{"light":"github-dark-dimmed","dark":"github-dark-dimmed"}}
- FAirbridgeUnreal::Impression(TEXT("https://abr.ge/~~~"));
+ FAirbridge::Impression(
+    TEXT("https://abr.ge/~~~"),
+    []() 
+    {
+        // Handle on success
+    },
+    [](const FString& Error)
+    {
+        // Handle on failure
+    }
+);
```

The `FAirbridgeUnreal::Click` function has been replaced with the `FAirbridge::Click`function.

```diff lines theme={"theme":{"light":"github-dark-dimmed","dark":"github-dark-dimmed"}}
- FAirbridgeUnreal::Click(TEXT("https://abr.ge/~~~"));
+ FAirbridge::Click(
+    TEXT("https://abr.ge/~~~"),
+    []() 
+    {
+        // Handle on success
+    },
+    [](const FString& Error)
+    {
+        // Handle on failure
+    }
+);
```

The `FAirbridgeUnreal::SetAttributionCallback` function has been replaced with the `FAirbridge::SetOnAttributionReceived` function.

```diff lines theme={"theme":{"light":"github-dark-dimmed","dark":"github-dark-dimmed"}}
- AExampleGameModeBase::AExampleGameModeBase()
- {
-   AirbridgeCallbacks = CreateDefaultSubobject<UAirbridgeCallbacks>(TEXT("AIRBRIDGE_CALLBACKS"));
- }

void AExampleGameModeBase::BeginPlay()
{
-    AirbridgeCallbacks->OnAttributionReceived.AddDynamic(this, &AExampleGameModeBase::OnAttributionReceived);
-    FAirbridgeUnreal::SetAttributionCallback();
+    FAirbridge::SetOnAttributionReceived([this](const TMap<FString, FString>& AttributionResult)
+    {
+        // using attribution
+    });
}

- void AExampleGameModeBase::OnAttributionReceived(const FAirbridgeAttribution& Attribution)
- {
-     // using attribution
- }
```

#### Device identifier setup

```diff lines theme={"theme":{"light":"github-dark-dimmed","dark":"github-dark-dimmed"}}
- FAirbridgeUnreal::SetDeviceAlias("ADD_YOUR_KEY", "AND_YOUR_VALUE");
+ FAirbridge::SetDeviceAlias("ADD_YOUR_KEY", "AND_YOUR_VALUE");
- FAirbridgeUnreal::RemoveDeviceAlias("DELETE_THIS_KEY");
+ FAirbridge::RemoveDeviceAlias("DELETE_THIS_KEY");
- FAirbridgeUnreal::ClearDeviceAlias();
+ FAirbridge::ClearDeviceAlias();
```

### Hybrid app setup

The `FAirbridgeUnreal::CreateWebInterface` function has been replaced with the `FAirbridge::CreateWebInterfaceScript` and the `FAirbridge::HandleWebInterfaceCommand` functions.

```diff lines theme={"theme":{"light":"github-dark-dimmed","dark":"github-dark-dimmed"}}
- TUniquePtr<IAirbridgeWebInterface> AirbridgeWebInterface;
+ FString WebInterfaceScript;
- AirbridgeWebInterface = TUniquePtr<IAirbridgeWebInterface>(FAirbridgeUnreal::CreateWebInterface(
-     TEXT("YOUR_WEB_TOKEN"),             
-     [](const FString& Msg) -> FString   
-     {
-         return TEXT("...");
-     }
- ));
+ WebInterfaceScript = FAirbridge::CreateWebInterfaceScript(
+     TEXT("YOUR_WEB_TOKEN"),
+     [](const FString& Msg) -> FString
+     {
+         return TEXT("...");
+     }("payload")
+ );
```

<link rel="alternate" hrefLang="en" href="https://help.airbridge.io/en/developers/migration-guide-for-unreal-sdk-v4" />

<link rel="alternate" hrefLang="ko" href="https://help.airbridge.io/ko/developers/migration-guide-for-unreal-sdk-v4" />
