From e9d16b83b3f54934ea3de448b4fcc70a4f3a48b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Ainsworth?= Date: Fri, 20 Sep 2024 12:17:32 +0200 Subject: [PATCH 01/11] Add Cocos-2dx migration guide --- .../docs/sdk/migration/cocos2dx/index.mdx | 7 + .../docs/sdk/migration/cocos2dx/v4-to-v5.mdx | 730 ++++++++++++++++++ 2 files changed, 737 insertions(+) create mode 100644 src/content/docs/sdk/migration/cocos2dx/index.mdx create mode 100644 src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdx diff --git a/src/content/docs/sdk/migration/cocos2dx/index.mdx b/src/content/docs/sdk/migration/cocos2dx/index.mdx new file mode 100644 index 000000000..301861677 --- /dev/null +++ b/src/content/docs/sdk/migration/cocos2dx/index.mdx @@ -0,0 +1,7 @@ +--- +title: Cocos2d-x +description: Follow these guides to migrate between SDK versions +slug: en/sdk/migration/cocos2dx +sidebar-position: 6 +type: category +--- diff --git a/src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdx b/src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdx new file mode 100644 index 000000000..e36dfdeee --- /dev/null +++ b/src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdx @@ -0,0 +1,730 @@ +--- +title: SDK v5 migration guide +description: Follow this guide to upgrade from SDK v4 to SDK v5 +slug: en/sdk/migration/cocos2dx/v4-to-v5 +sidebar-position: 1 +--- + +## Before you begin {#before-you-begin} + +Here's what you need to do before updating to SDK v5: + +1. SDK v5 supports [SDK signature verification](https://help.adjust.com/en/article/sdk-signature) natively. If you currently use the SDK signature library, you need to remove the signature library from your app first. +2. The minimum supported API versions for SDK v5 have been updated. If your app targets a lower version, you need to update it first. + + - iOS: **12.0** + - Android: **21** + +## Install the SDK {#install-the-sdk} + +To start using SDK v5, you need to add it as a dependency in your project. To do this: + +1. Download the SDK archive [from GitHub](https://github.com/adjust/cocos2dx_sdk/releases) +2. Copy the C++ files from the `dist` directory and add them to your Cocos2d-x project +3. (**Android only**): add the paths of the C++ files to the `LOCAL_SRC_FILES` section of your `Android.mk` file. + + + + ```text + $(LOCAL_PATH)/../../../Classes/Adjust/AdjustConfig2dx.cpp \ + $(LOCAL_PATH)/../../../Classes/Adjust/AdjustAttribution2dx.cpp \ + $(LOCAL_PATH)/../../../Classes/Adjust/AdjustProxy2dx.cpp \ + $(LOCAL_PATH)/../../../Classes/Adjust/AdjustEvent2dx.cpp \ + $(LOCAL_PATH)/../../../Classes/Adjust/Adjust2dx.cpp \ + $(LOCAL_PATH)/../../../Classes/Adjust/AdjustEventFailure2dx.cpp \ + $(LOCAL_PATH)/../../../Classes/Adjust/AdjustEventSuccess2dx.cpp \ + $(LOCAL_PATH)/../../../Classes/Adjust/AdjustSessionFailure2dx.cpp \ + $(LOCAL_PATH)/../../../Classes/Adjust/AdjustSessionSuccess2dx.cpp \ + $(LOCAL_PATH)/../../../Classes/Adjust/AdjustAppStoreSubscription2dx.cpp \ + $(LOCAL_PATH)/../../../Classes/Adjust/AdjustPlayStoreSubscription2dx.cpp \ + $(LOCAL_PATH)/../../../Classes/Adjust/AdjustThirdPartySharing2dx.cpp \ + $(LOCAL_PATH)/../../../Classes/Adjust/AdjustAdRevenue2dx.cpp + $(LOCAL_PATH)/../../../Classes/Adjust/AdjustAppStorePurchase2dx.cpp \ + $(LOCAL_PATH)/../../../Classes/Adjust/AdjustPlayStorePurchase2dx.cpp \ + $(LOCAL_PATH)/../../../Classes/Adjust/AdjustDeeplink2dx.cpp \ + ``` + + + +4. (**Android only**): add the Adjust Android SDK to your project using Maven. + + + + ```groovy + dependencies { + implementation 'com.adjust.sdk:adjust-android:5.0.0' + } + ``` + + + +## Update the initialization method {#update-the-init-method} + + + +In SDK v4, the initialization method is `Adjust2dx::start(adjustConfig)`. This has been changed to `Adjust2dx::initSdk(adjustConfig)`. + + + +```cpp +#include "Adjust/Adjust2dx.h" + +std::string appToken = "YourAppToken"; +std::string environment = AdjustEnvironmentSandbox2dx; + +AdjustConfig2dx adjustConfig = AdjustConfig2dx(appToken, environment); +- Adjust2dx::start(adjustConfig); ++ Adjust2dx::initSdk(adjustConfig); +``` + + + +## Changed APIs {#changed-apis} + + + +The following APIs have been changed in SDK v5. + +### Disable and enable the SDK {#disable-enable-sdk} + +In SDK v4, you can enable and disable the SDK by calling `Adjust2dx::setEnabled` with a `boolean` value. + +```cpp +Adjust2dx::setEnabled(false); // disable SDK +Adjust2dx::setEnabled(true); // enable SDK +``` + +In SDK v5, this feature is split into separate commands for clarity. + +- Call `Adjust2dx::disable()` to disable the SDK. +- Call `Adjust2dx::enable()` to enable the SDK. + +```cpp +Adjust2dx::disable(); +Adjust2dx::enable(); +``` + +### Send information in background {#send-in-background} + +In SDK v4, you can set the `sendInBackground` property on your `adjustConfig` instance to `true` to enable the SDK to send information to Adjust while your app is running in the background. + +```cpp +adjustConfig.sendInBackground(true); +``` + +In SDK v5, you need to call the `enableSendingInBackground` method of your `adjustConfig` instance to enable the SDK to send information to Adjust while your app is running in the background. + +```cpp +adjustConfig.enableSendingInBackground(); +``` + +### Preinstalled app measurement {#preinstalled-app} + +In SDK v4, you can call the `setPreinstallTrackingEnabled` method of your `adjustConfig` instance with a `true` argument to enable measuring preinstalled apps. + +```cpp +adjustConfig.setPreinstallTrackingEnabled(true); +``` + +In SDK v5, you need to call the `enablePreinstallTracking` method of your `adjustConfig` instance to enable measuring preinstalled apps. + +```cpp +adjustConfig.enablePreinstallTracking(); +``` + +### Disable AdServices information reading {#disable-adservices} + +In SDK v4, you can call the `setAllowAdServicesInfoReading` method on your `adjustConfig` with the value `false` to prevent the Adjust SDK from reading AdServices information. + +```cpp +adjustConfig.setAllowAdServicesInfoReading(false); +``` + +In SDK v5, you need to call the `disableAdServices` method on your `adjustConfig` instance to prevent the Adjust SDK from reading AdServices information. The default state is `true`. + +```cpp +adjustConfig.disableAdServices(); +``` + +### Disable IDFA reading {#disable-idfa} + +In SDK v4, you can call the `setAllowIdfaReading` method on your `adjustConfig` with the value `false` to prevent the Adjust SDK from reading the device's IDFA. + +```cpp +adjustConfig.setAllowIdfaReading(false); +``` + +In SDK v5, you need to call the `disableIdfaReading` method on your `adjustConfig` instance to prevent the Adjust SDK from reading the device's IDFA. The default state is `true`. + +```cpp +adjustConfig.disableIdfaReading(); +``` + +### Enable cost data in attribution {#enable-cost-data} + +In SDK v4, you can call the `setNeedsCost` method on your `adjustConfig` instance with the value `true` to enable cost data in the device's attribution information. + +```cpp +adjustConfig.setNeedsCost(true); +``` + +In SDK v5, you need to call the `enableCostDataInAttribution` method on your `adjustConfig` instance to enable cost data in the device's attribution information. The default state is `false`. + +```cpp +adjustConfig.enableCostDataInAttribution(); +``` + +### Enable LinkMe {#enable-linkme} + +In SDK v4, you can call the `setLinkMeEnabled` method on your `adjustConfig` instance with the value `true` to enable [Adjust LinkMe](https://help.adjust.com/en/article/linkme). + +```cpp +adjustConfig.setLinkMeEnabled(true); +``` + +In SDK v5, you need to call the `enableLinkMe` method on your `adjustConfig` instance to enable [Adjust LinkMe](https://help.adjust.com/en/article/linkme). The default state is `false`. + +```cpp +adjustConfig.enableLinkMe(); +``` + +### Only read device IDs once {#read-device-id-once} + +In SDK v4, you can call the `setReadDeviceInfoOnceEnabled` method on your `adjustConfig` with the value `true` to instruct the SDK to only read device IDs once. + +```cpp +adjustConfig.setReadDeviceInfoOnceEnabled(true); +``` + +In SDK v5, you need to call the `enableDeviceIdsReadingOnce` method on your `adjustConfig` to instruct the SDK to only read device IDs once. The default state is `false`. + +```cpp +adjustConfig.enableDeviceIdsReadingOnce(); +``` + +### Offline mode {#offline-mode} + +In SDK v4, you can enable and disable offline mode the SDK by calling `Adjust2dx::setOfflineMode` with a `boolean` argument. + +```cpp +Adjust2dx::setOfflineMode(true); +Adjust2dx::setOfflineMode(false); +``` + +In SDK v5, this feature is split into separate commands for clarity. + +- Call `Adjust2dx::switchToOfflineMode` to set the SDK to offline mode. +- Call `Adjust2dx::switchBackToOnlineMode` to set the SDK back to online mode. + +```cpp +Adjust2dx::switchToOfflineMode(); // Put the SDK in offline mode +Adjust2dx::switchBackToOnlineMode(); // Put the SDK back in online mode +``` + +### Session callback parameters {#callback-params} + +In SDK v4, you can add session callback parameters by passing a key-value pair to the `Adjust2dx::addSessionCallbackParameter` method and remove individual parameters using the `Adjust2dx::removeSessionCallbackParameter` method. + +```cpp +Adjust2dx::addSessionCallbackParameter("key", "value"); +Adjust2dx::removeSessionCallbackParameter("key"); +Adjust2dx::resetSessionCallbackParameters(); +``` + +In SDK v5, session callback parameters are renamed to global parameters. + +```cpp +Adjust2dx::addGlobalCallbackParameter("key", "value"); +Adjust2dx::removeGlobalCallbackParameter("key"); +Adjust2dx::removeGlobalCallbackParameters(); +``` + +### Session partner parameters {#partner-params} + +In SDK v4, you can add session partner parameters by passing a key-value pair to the `Adjust2dx::addSessionPartnerParameter` method and remove individual parameters using the `Adjust2dx::removeSessionPartnerParameter` method. + +```cpp +Adjust2dx::addSessionPartnerParameter("key", "value"); +Adjust2dx::removeSessionPartnerParameter("key"); +Adjust2dx::resetSessionPartnerParameters(); +``` + +In SDK v5, session partner parameters are renamed to global partner parameters. + +```cpp +Adjust2dx::addGlobalPartnerParameter("key", "value"); +Adjust2dx::removeGlobalPartnerParameter("key"); +Adjust2dx::removeGlobalPartnerParameters(); +``` + +### Event deduplication {#event-deduplication} + +In SDK v4, event deduplication is coupled with the event `transaction ID` and is limited to a maximum of 10 unique IDs. + +```cpp +adjustEvent.setTransactionId("transaction-id"); +``` + +In SDK v5, the feature is decoupled from `transaction ID`. A new ID field called `deduplicationId` has been added for event deduplication. + +```cpp +adjustEvent.setDeduplicationId("deduplication-id"); +``` + +### App Store Subscriptions {#app-store-subscriptions} + +In SDK v4, you can set a new subscription by configuring an `AdjustAppStoreSubscription2dx` object. This object is initialized with four arguments: `price`, `currency`, `transactionId`, and `receipt`. + +```cpp +AdjustAppStoreSubscription2dx subscription = AdjustAppStoreSubscription2dx(price, currency, transactionId, receipt) +``` + +In SDK v5, you don't need to pass the `receipt` argument as it's no longer needed for purchase verification. + +```cpp +AdjustAppStoreSubscription2dx subscription = AdjustAppStoreSubscription2dx(price, currency, transactionId) +``` + +### Reattribution using deep links {#reattribution-using-deep-links} + +In SDK v4, you can pass your deep link information to the `Adjust2dx::appWillOpenUrl` method. + +```cpp +Adjust2dx::appWillOpenUrl("url"); +``` + +In SDK v5, this has been renamed to `Adjust2dx::processDeeplink` for clarity. A new `AdjustDeeplink2dx` class has been added for constructing deep links. To process a deep link, instantiate an `AdjustDeeplink2dx` object with your deep link URL and pass it to the `Adjust2dx::processDeeplink` method. + +```cpp +AdjustDeeplink2dx deeplink = AdjustDeeplink2dx("url"); +Adjust2dx::processDeeplink(deeplink); +``` + +### Deep link resolution {#deeplink-resolution} + +In SDK v4, you can resolve a shortened deep link by passing the `url` to the `Adjust2dx::processDeeplink` method. + +```cpp +Adjust2dx::processDeeplink("url", [](std::string resolvedLink) { + std::cout << "Resolved link: " << resolvedLink; +}); +``` + +In SDK v5, you need to send an `AdjustDeeplink2dx` object initialized with the deep link `url`. This returns the original unshortened deep link. + +```cpp +AdjustDeeplink2dx deeplink = AdjustDeeplink2dx("url"); +Adjust2dx::processDeeplink(deeplink, [](std::string resolvedLink) { + std::cout << "Resolved link: " << resolvedLink; +}); +``` + +### COPPA compliance {#coppa-compliance} + +In SDK v4, you can call the `coppaCompliantEnabled` method on your `adjustConfig` instance with the value `true` to enable COPPA compliance. + +```cpp +adjustConfig.setCoppaCompliantEnabled(true); +``` + +In SDK v5, you need to call the `enableCoppaCompliance` method on your `adjustConfig` instance to enable COPPA compliance. The default state is `false`. + +```cpp +adjustConfig.enableCoppaCompliance(); +``` + +### Play Store Kids Apps {#play-store-kids} + +In SDK v4, you can mark an app as a [Play Store Kids app](/en/sdk/react-native/features/privacy#play-store-kids-apps-android-only) by calling the `setPlayStoreKidsAppEnabled` method on your `adjustConfig` instance with the value `true`. This is read during SDK initialization, which means that the value can't be updated once the SDK is initialized. + +```cpp +adjustConfig.setPlayStoreKidsAppEnabled(true); +``` + +In SDK v5, you need to call the `enablePlayStoreKidsCompliance` method of your `adjustConfig` instance to enable compliance. The default state is `false`. + +```cpp +adjustConfig.enablePlayStoreKidsCompliance(); +``` + +### Set data residency and URL strategy {#url-strategy} + +In SDK v4, URL strategy and data residency domains are defined as constants in the `AdjustConfig` class. + +```cpp +adjustConfig.setUrlStrategy(AdjustDataResidencyEU); +``` + +In SDK v5, you need to pass your chosen domain or domains as an array. You need to also set the following: + +- `useSubdomains` (`boolean`): Whether the domain should be treated as an Adjust domain. If `true`, the SDK will prefix the domains with Adjust-specific subdomains. If `false`, the SDK will use the provided domain as-is, without adding any prefixes. +- `isDataResidency` (`boolean`): Whether the domain should be used for data residency. + +```cpp +adjustConfig.setUrlStrategy(["eu.adjust.com"], true, true); +``` + +Check the table below to see how to configure your URL strategy in SDK v5. + + + +| v4 | v5 - main and fallback domain | v5 - use sub domains | v5 - is Data Residency | +| ------------------------- | --------------------------------- | -------------------- | ---------------------- | +| `AdjustDataResidencyEU` | `"eu.adjust.com"` | `true` | `true` | +| `AdjustDataResidencyTR` | `"tr.adjust.com"` | `true` | `true` | +| `AdjustDataResidencyUS` | `"us.adjust.com"` | `true` | `true` | +| `AdjustUrlStrategyChina` | `"adjust.world"`, `"adjust.com"` | `true` | `false` | +| `AdjustUrlStrategyCn` | `"adjust.cn"`, `"adjust.com"` | `true` | `false` | +| `AdjustUrlStrategyCnOnly` | `"adjust.cn"` | `true` | `false` | +| `AdjustUrlStrategyIndia` | `"adjust.net.in"`, `"adjust.com"` | `true` | `false` | + +
+ +#### Examples {#examples} + + + +```cpp +adjustConfig.setUrlStrategy(['adjust.net.in', 'adjust.com'], true, false); +``` + + + + + +```cpp +adjustConfig.setUrlStrategy(['adjust.world', 'adjust.com'], true, false); +``` + + + + + +```cpp +adjustConfig.setUrlStrategy(['adjust.cn'], true, false); +``` + + + + + +```cpp +adjustConfig.setUrlStrategy(['eu.adjust.com'], true, true); +``` + + + + + +```cpp +adjustConfig.setUrlStrategy(['tr.adjust.com'], true, true); +``` + + + + + +```cpp +adjustConfig.setUrlStrategy(['us.adjust.com'], true, true); +``` + + + +### Record ad revenue {#record-ad-revenue} + +In SDK v4, you can record ad revenue by instantiating an `AdjustAdRevenue2dx` object with an ad revenue source constant. + +```cpp +AdjustAdRevenue2dx adRevenue = AdjustAdRevenue2dx(AdjustAdRevenueSourceAppLovinMAX); +``` + +In SDK v5, you need to instantiate an `AdjustAdRevenue` object with a string `source`. + +```cpp +AdjustAdRevenue2dx adRevenue = AdjustAdRevenue2dx("applovin_max_sdk") +``` + + + +| v4 | v5 | +| --------------------------------------- | ------------------------- | +| `AdjustAdRevenueAppLovinMAX` | `'applovin_max_sdk'` | +| `AdjustAdRevenueSourceAdMob` | `'admob_sdk'` | +| `AdjustAdRevenueSourceIronSource` | `'ironsource_sdk'` | +| `AdjustAdRevenueSourceAdMost` | `'admost_sdk'` | +| `AdjustAdRevenueSourceUnity` | `'unity_sdk'` | +| `AdjustAdRevenueSourceHeliumChartboost` | `'helium_chartboost_sdk'` | +| `adjustConfig.AdRevenueSourceADX` | `'adx_sdk'` | +| `AdjustAdRevenueSourcePublisher` | `'publisher_sdk'` | +| `AdjustAdRevenueSourceTradplus` | `'tradplus_sdk'` | +| `AdjustAdRevenueSourceTopOn` | `'topon_sdk'` | +| `AdjustAdRevenueSourceMopub` | No longer supported | + +
+ +### Disable SKAdNetwork communication {#disable-skan} + +In SDK v4, you can prevent the SDK from communicating with SKAdNetwork by calling the `adjustConfig.deactivateSKAdNetworkHandling` method. + +```cpp +adjustConfig.deactivateSKAdNetworkHandling(); +``` + +In SDK v5, you need to call the `disableSkanAttribution` method on your `adjustConfig` instance to disable SKAdNetwork communication. The default state is `true`. + +```cpp +adjustConfig.disableSkanAttribution(); +``` + +### Listen for conversion value updates {#listen-for-cv-updates} + +In SDK v4, you can call the `setPostbackConversionValueUpdatedCallback` method on your `adjustConfig` to listen for conversion value updates. Before SKAN4, you could use the `setConversionValueUpdatedCallback` method. + +```cpp +// pre-SKAN4 callback +adjustConfig.setConversionValueUpdatedCallback([](int conversionValue) { + std::cout << "\nConversion value: " << conversionValue; +}); +// SKAN4 callback +adjustConfig.setPostbackConversionValueUpdatedCallback([]( + int conversionValue, + std::string coarseValue, + bool lockWindow) { + std::cout << "\nConversion value: " << conversionValue; + std::cout << "\nCoarse value: " << coarseValue; + std::cout << "\nLock window: " << lockWindow; +}); +``` + +In SDK v5, you need to assign a callback function to the `setSkanUpdatedCallback` method of your `adjustConfig` object. + +```cpp +adjustConfig.setSkanUpdatedCallback([]( + std::map skanData) { + std::cout << "\nConversion value: " << skanData["conversionValue"]; + std::cout << "\nCoarse value: " << skanData["coarseValue"]; + std::cout << "\nLock window: " << skanData["lockWindow"]; + std::cout << "\nError: " << skanData["error"]; +}); +``` + +### Update conversion values {#update-cvs} + +In SDK v4, you can use one of these methods to send updated conversion values to Adjust: + +```cpp +// pass just the conversion value (deprecated method) +Adjust2dx::updateConversionValue(6); + +// pass the conversion value and a callback to receive a message about potential error +Adjust2dx::updatePostbackConversionValue(6, [](std::string error) { + std::cout << "Error while updating conversion value: " << error; +}); + +// SKAN 4.0 +// pass the conversion value, coarse value and a callback to receive a message about potential error +Adjust2dx::updatePostbackConversionValue(6, "low", [](std::string error) { + std::cout << "Error while updating conversion value: " << error; +}); + +// SKAN 4.0 +// pass the conversion value, coarse value, lock window and a callback to receive a message about potential error +Adjust2dx::updatePostbackConversionValue(6, "low", false, [](std::string error) { + std::cout << "Error while updating conversion value: " << error; +}); +``` + +To update conversion values in SDK v5, use the `updateSkanConversionValue` method with the following arguments: + +- `conversionValue` (`Number`): The updated conversion value +- `coarseValue` (`string`): The updated [coarse conversion value](https://developer.apple.com/documentation/storekit/skadnetwork/coarseconversionvalue) +- `lockWindow` (`boolean`): Whether to send the postback before the conversion window ends + +```cpp +Adjust2dx::updateSkanConversionValue(6, "low", true, [](std::string error) { + std::cout << "Error while updating conversion value: " << error; +}); +``` + +### App Tracking Transparency authorization wrapper {#att-wrapper} + +In SDK v4, you can handle changes to a user's ATT authorization status using the `Adjust2dx::requestTrackingAuthorizationWithCompletionHandler` method. + +```cpp +static void authorizationStatusCallback(int status) { + switch (status) { + case 0: + // ATTrackingManagerAuthorizationStatusNotDetermined case + break; + case 1: + // ATTrackingManagerAuthorizationStatusRestricted case + break; + case 2: + // ATTrackingManagerAuthorizationStatusDenied case + break; + case 3: + // ATTrackingManagerAuthorizationStatusAuthorized case + break; + } +} + +Adjust2dx::requestTrackingAuthorizationWithCompletionHandler(authorizationStatusCallback); +``` + +This has been renamed to `Adjust2dx::requestAppTrackingAuthorization` in SDK v5 for clarity. + +```cpp +static void authorizationStatusCallback(int status) { + switch (status) { + case 0: + // ATTrackingManagerAuthorizationStatusNotDetermined case + break; + case 1: + // ATTrackingManagerAuthorizationStatusRestricted case + break; + case 2: + // ATTrackingManagerAuthorizationStatusDenied case + break; + case 3: + // ATTrackingManagerAuthorizationStatusAuthorized case + break; + } +} + +Adjust2dx::requestAppTrackingAuthorization(authorizationStatusCallback); +``` + +### Get device information {#device-info} + +In SDK v4, all device information getter methods run synchronously. In SDK v5, these methods have been changed to run asynchronously. You can add a callback function to handle the information when the asynchronous process completes + + + +```cpp +Adjust2dx::getIdfa([](std::string idfa) { + std::cout << "\nIDFA = " << idfa; +}); +``` + + + + + +```cpp +Adjust2dx::getIdfv([](std::string idfv) { + std::cout << "\nIDFV = " << idfa; +}); +``` + + + + + +```cpp +Adjust2dx::getAdid([](std::string adid) { + std::cout << "\nAdjust ID = " << adid; +}); +``` + + + + + +```cpp +Adjust2dx::getAttribution([](AdjustAttribution2dx attribution) { + // process attribution +}); +``` + + + + + +```cpp +Adjust2dx::isEnabled([](bool isEnabled) { + // process isEnabled +}); +``` + + + + + +```cpp +Adjust2dx::getSdkVersion([](std::string sdkVersion) { + std::cout << "\nSDK version = " << sdkVersion; +}); +``` + + + + + +```cpp +Adjust2dx::getLastDeeplink([](std::string lastDeeplink) { + std::cout << "\nLast deeplink = " << lastDeeplink; +}); +``` + + + +## Removed APIs {#removed-apis} + + + +The following APIs have been removed in SDK v5. + +### Event buffering {#event-buffering} + +SDK v4 supports event buffering. This feature stores requests event, ad revenue, push tokens, and other information on a local buffer to send at a later date. + +```cpp +adjustConfig.setEventBufferingEnabled(true); +``` + +This setting has been removed in SDK v5. + +### Custom user agent string {#custom-user-agent} + +SDK v4 supports setting a custom User Agent by calling `adjustConfig.setUserAgent()` with a user agent string. + +```cpp +adjustConfig.setUserAgent("custom-user-agent"); +``` + +This setting has been removed in SDK v5. + +### Set whether a device is known {#set-device-known} + +In SDK v4, you can call the `adjustConfig.setDeviceKnown()` method to manually inform the SDK whether a device is known. + +```cpp +adjustConfig.setDeviceKnown(true); +``` + +This setting has been removed in SDK v5. + +### Delay SDK start {#delay-sdk-start} + +SDK v4 supports delaying the start of the SDK by calling `adjustConfig.setDelayStart()` with up to **10 seconds** of delay. + +```cpp +adjustConfig.setDelayStart(10); +``` + +This method has been removed in SDK v5. The `Adjust2dx::sendFirstPackages()` method that interrupts this delay has also been removed. + +### Disable third party sharing globally {#disable-sharing-globally} + +In SDK v4, you can call the `Adjust2dx::disableThirdPartySharing()` method to globally disable sharing information with third parties globally. + +```cpp +Adjust2dx::disableThirdPartySharing() +``` + +This feature has been removed from SDK v5. In SDK v5, use the `Adjust2dx::trackThirdPartySharing()` method to enable or disable third party sharing. + +```cpp +AdjustThirdPartySharing2dx thirdPartySharing = AdjustThirdPartySharing2dx(false); +Adjust2dx::trackThirdPartySharing(thirdPartySharing); +``` From 43a760aecffcab4a86834e535bce2f048cd0d6b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Ainsworth?= Date: Mon, 23 Sep 2024 17:33:05 +0200 Subject: [PATCH 02/11] Remove table tags --- src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdx b/src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdx index e36dfdeee..9b211798e 100644 --- a/src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdx +++ b/src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdx @@ -366,8 +366,6 @@ adjustConfig.setUrlStrategy(["eu.adjust.com"], true, true); Check the table below to see how to configure your URL strategy in SDK v5. - - | v4 | v5 - main and fallback domain | v5 - use sub domains | v5 - is Data Residency | | ------------------------- | --------------------------------- | -------------------- | ---------------------- | | `AdjustDataResidencyEU` | `"eu.adjust.com"` | `true` | `true` | @@ -378,8 +376,6 @@ Check the table below to see how to configure your URL strategy in SDK v5. | `AdjustUrlStrategyCnOnly` | `"adjust.cn"` | `true` | `false` | | `AdjustUrlStrategyIndia` | `"adjust.net.in"`, `"adjust.com"` | `true` | `false` | -
- #### Examples {#examples} From ba2132c0e4282065acd10562d50b8ab49732dbe5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Ainsworth?= Date: Mon, 23 Sep 2024 19:51:29 +0200 Subject: [PATCH 03/11] Remove table tag --- src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdx b/src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdx index 9b211798e..880414a6b 100644 --- a/src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdx +++ b/src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdx @@ -440,8 +440,6 @@ In SDK v5, you need to instantiate an `AdjustAdRevenue` object with a string `so AdjustAdRevenue2dx adRevenue = AdjustAdRevenue2dx("applovin_max_sdk") ``` - - | v4 | v5 | | --------------------------------------- | ------------------------- | | `AdjustAdRevenueAppLovinMAX` | `'applovin_max_sdk'` | @@ -456,8 +454,6 @@ AdjustAdRevenue2dx adRevenue = AdjustAdRevenue2dx("applovin_max_sdk") | `AdjustAdRevenueSourceTopOn` | `'topon_sdk'` | | `AdjustAdRevenueSourceMopub` | No longer supported | -
- ### Disable SKAdNetwork communication {#disable-skan} In SDK v4, you can prevent the SDK from communicating with SKAdNetwork by calling the `adjustConfig.deactivateSKAdNetworkHandling` method. From 3a535f6ecf91d2abe5dd1a799ead1132e36bfa9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Ainsworth?= Date: Mon, 23 Sep 2024 21:25:44 +0200 Subject: [PATCH 04/11] Migrate to markdoc --- .../cocos2dx/{index.mdx => index.mdoc} | 0 .../cocos2dx/{v4-to-v5.mdx => v4-to-v5.mdoc} | 140 +++++++++--------- 2 files changed, 70 insertions(+), 70 deletions(-) rename src/content/docs/sdk/migration/cocos2dx/{index.mdx => index.mdoc} (100%) rename src/content/docs/sdk/migration/cocos2dx/{v4-to-v5.mdx => v4-to-v5.mdoc} (88%) diff --git a/src/content/docs/sdk/migration/cocos2dx/index.mdx b/src/content/docs/sdk/migration/cocos2dx/index.mdoc similarity index 100% rename from src/content/docs/sdk/migration/cocos2dx/index.mdx rename to src/content/docs/sdk/migration/cocos2dx/index.mdoc diff --git a/src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdx b/src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdoc similarity index 88% rename from src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdx rename to src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdoc index 880414a6b..42c6e620e 100644 --- a/src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdx +++ b/src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdoc @@ -5,7 +5,7 @@ slug: en/sdk/migration/cocos2dx/v4-to-v5 sidebar-position: 1 --- -## Before you begin {#before-you-begin} +## Before you begin {% #before-you-begin %} Here's what you need to do before updating to SDK v5: @@ -15,7 +15,7 @@ Here's what you need to do before updating to SDK v5: - iOS: **12.0** - Android: **21** -## Install the SDK {#install-the-sdk} +## Install the SDK {% #install-the-sdk %} To start using SDK v5, you need to add it as a dependency in your project. To do this: @@ -23,7 +23,7 @@ To start using SDK v5, you need to add it as a dependency in your project. To do 2. Copy the C++ files from the `dist` directory and add them to your Cocos2d-x project 3. (**Android only**): add the paths of the C++ files to the `LOCAL_SRC_FILES` section of your `Android.mk` file. - + {% codeblock title="Android.mk" %} ```text $(LOCAL_PATH)/../../../Classes/Adjust/AdjustConfig2dx.cpp \ @@ -44,11 +44,11 @@ To start using SDK v5, you need to add it as a dependency in your project. To do $(LOCAL_PATH)/../../../Classes/Adjust/AdjustDeeplink2dx.cpp \ ``` - + {% /codeblock %} 4. (**Android only**): add the Adjust Android SDK to your project using Maven. - + {% codeblock title="build.gradle" %} ```groovy dependencies { @@ -56,15 +56,15 @@ To start using SDK v5, you need to add it as a dependency in your project. To do } ``` - + {% /codeblock %} -## Update the initialization method {#update-the-init-method} +## Update the initialization method {% #update-the-init-method %} - +{% minorversion changed="v5" size="large" /%} In SDK v4, the initialization method is `Adjust2dx::start(adjustConfig)`. This has been changed to `Adjust2dx::initSdk(adjustConfig)`. - +{% codeblock useDiffSyntax=true %} ```cpp #include "Adjust/Adjust2dx.h" @@ -77,15 +77,15 @@ AdjustConfig2dx adjustConfig = AdjustConfig2dx(appToken, environment); + Adjust2dx::initSdk(adjustConfig); ``` - +{% /codeblock %} -## Changed APIs {#changed-apis} +## Changed APIs {% #changed-apis %} - +{% minorversion changed="v5" size="large" /%} The following APIs have been changed in SDK v5. -### Disable and enable the SDK {#disable-enable-sdk} +### Disable and enable the SDK {% #disable-enable-sdk %} In SDK v4, you can enable and disable the SDK by calling `Adjust2dx::setEnabled` with a `boolean` value. @@ -104,7 +104,7 @@ Adjust2dx::disable(); Adjust2dx::enable(); ``` -### Send information in background {#send-in-background} +### Send information in background {% #send-in-background %} In SDK v4, you can set the `sendInBackground` property on your `adjustConfig` instance to `true` to enable the SDK to send information to Adjust while your app is running in the background. @@ -118,7 +118,7 @@ In SDK v5, you need to call the `enableSendingInBackground` method of your `adju adjustConfig.enableSendingInBackground(); ``` -### Preinstalled app measurement {#preinstalled-app} +### Preinstalled app measurement {% #preinstalled-app %} In SDK v4, you can call the `setPreinstallTrackingEnabled` method of your `adjustConfig` instance with a `true` argument to enable measuring preinstalled apps. @@ -132,7 +132,7 @@ In SDK v5, you need to call the `enablePreinstallTracking` method of your `adjus adjustConfig.enablePreinstallTracking(); ``` -### Disable AdServices information reading {#disable-adservices} +### Disable AdServices information reading {% #disable-adservices %} In SDK v4, you can call the `setAllowAdServicesInfoReading` method on your `adjustConfig` with the value `false` to prevent the Adjust SDK from reading AdServices information. @@ -146,7 +146,7 @@ In SDK v5, you need to call the `disableAdServices` method on your `adjustConfig adjustConfig.disableAdServices(); ``` -### Disable IDFA reading {#disable-idfa} +### Disable IDFA reading {% #disable-idfa %} In SDK v4, you can call the `setAllowIdfaReading` method on your `adjustConfig` with the value `false` to prevent the Adjust SDK from reading the device's IDFA. @@ -160,7 +160,7 @@ In SDK v5, you need to call the `disableIdfaReading` method on your `adjustConfi adjustConfig.disableIdfaReading(); ``` -### Enable cost data in attribution {#enable-cost-data} +### Enable cost data in attribution {% #enable-cost-data %} In SDK v4, you can call the `setNeedsCost` method on your `adjustConfig` instance with the value `true` to enable cost data in the device's attribution information. @@ -174,7 +174,7 @@ In SDK v5, you need to call the `enableCostDataInAttribution` method on your `ad adjustConfig.enableCostDataInAttribution(); ``` -### Enable LinkMe {#enable-linkme} +### Enable LinkMe {% #enable-linkme %} In SDK v4, you can call the `setLinkMeEnabled` method on your `adjustConfig` instance with the value `true` to enable [Adjust LinkMe](https://help.adjust.com/en/article/linkme). @@ -188,7 +188,7 @@ In SDK v5, you need to call the `enableLinkMe` method on your `adjustConfig` ins adjustConfig.enableLinkMe(); ``` -### Only read device IDs once {#read-device-id-once} +### Only read device IDs once {% #read-device-id-once %} In SDK v4, you can call the `setReadDeviceInfoOnceEnabled` method on your `adjustConfig` with the value `true` to instruct the SDK to only read device IDs once. @@ -202,7 +202,7 @@ In SDK v5, you need to call the `enableDeviceIdsReadingOnce` method on your `adj adjustConfig.enableDeviceIdsReadingOnce(); ``` -### Offline mode {#offline-mode} +### Offline mode {% #offline-mode %} In SDK v4, you can enable and disable offline mode the SDK by calling `Adjust2dx::setOfflineMode` with a `boolean` argument. @@ -221,7 +221,7 @@ Adjust2dx::switchToOfflineMode(); // Put the SDK in offline mode Adjust2dx::switchBackToOnlineMode(); // Put the SDK back in online mode ``` -### Session callback parameters {#callback-params} +### Session callback parameters {% #callback-params %} In SDK v4, you can add session callback parameters by passing a key-value pair to the `Adjust2dx::addSessionCallbackParameter` method and remove individual parameters using the `Adjust2dx::removeSessionCallbackParameter` method. @@ -239,7 +239,7 @@ Adjust2dx::removeGlobalCallbackParameter("key"); Adjust2dx::removeGlobalCallbackParameters(); ``` -### Session partner parameters {#partner-params} +### Session partner parameters {% #partner-params %} In SDK v4, you can add session partner parameters by passing a key-value pair to the `Adjust2dx::addSessionPartnerParameter` method and remove individual parameters using the `Adjust2dx::removeSessionPartnerParameter` method. @@ -257,7 +257,7 @@ Adjust2dx::removeGlobalPartnerParameter("key"); Adjust2dx::removeGlobalPartnerParameters(); ``` -### Event deduplication {#event-deduplication} +### Event deduplication {% #event-deduplication %} In SDK v4, event deduplication is coupled with the event `transaction ID` and is limited to a maximum of 10 unique IDs. @@ -271,7 +271,7 @@ In SDK v5, the feature is decoupled from `transaction ID`. A new ID field called adjustEvent.setDeduplicationId("deduplication-id"); ``` -### App Store Subscriptions {#app-store-subscriptions} +### App Store Subscriptions {% #app-store-subscriptions %} In SDK v4, you can set a new subscription by configuring an `AdjustAppStoreSubscription2dx` object. This object is initialized with four arguments: `price`, `currency`, `transactionId`, and `receipt`. @@ -285,7 +285,7 @@ In SDK v5, you don't need to pass the `receipt` argument as it's no longer neede AdjustAppStoreSubscription2dx subscription = AdjustAppStoreSubscription2dx(price, currency, transactionId) ``` -### Reattribution using deep links {#reattribution-using-deep-links} +### Reattribution using deep links {% #reattribution-using-deep-links %} In SDK v4, you can pass your deep link information to the `Adjust2dx::appWillOpenUrl` method. @@ -300,7 +300,7 @@ AdjustDeeplink2dx deeplink = AdjustDeeplink2dx("url"); Adjust2dx::processDeeplink(deeplink); ``` -### Deep link resolution {#deeplink-resolution} +### Deep link resolution {% #deeplink-resolution %} In SDK v4, you can resolve a shortened deep link by passing the `url` to the `Adjust2dx::processDeeplink` method. @@ -319,7 +319,7 @@ Adjust2dx::processDeeplink(deeplink, [](std::string resolvedLink) { }); ``` -### COPPA compliance {#coppa-compliance} +### COPPA compliance {% #coppa-compliance %} In SDK v4, you can call the `coppaCompliantEnabled` method on your `adjustConfig` instance with the value `true` to enable COPPA compliance. @@ -333,7 +333,7 @@ In SDK v5, you need to call the `enableCoppaCompliance` method on your `adjustCo adjustConfig.enableCoppaCompliance(); ``` -### Play Store Kids Apps {#play-store-kids} +### Play Store Kids Apps {% #play-store-kids %} In SDK v4, you can mark an app as a [Play Store Kids app](/en/sdk/react-native/features/privacy#play-store-kids-apps-android-only) by calling the `setPlayStoreKidsAppEnabled` method on your `adjustConfig` instance with the value `true`. This is read during SDK initialization, which means that the value can't be updated once the SDK is initialized. @@ -347,7 +347,7 @@ In SDK v5, you need to call the `enablePlayStoreKidsCompliance` method of your ` adjustConfig.enablePlayStoreKidsCompliance(); ``` -### Set data residency and URL strategy {#url-strategy} +### Set data residency and URL strategy {% #url-strategy %} In SDK v4, URL strategy and data residency domains are defined as constants in the `AdjustConfig` class. @@ -376,57 +376,57 @@ Check the table below to see how to configure your URL strategy in SDK v5. | `AdjustUrlStrategyCnOnly` | `"adjust.cn"` | `true` | `false` | | `AdjustUrlStrategyIndia` | `"adjust.net.in"`, `"adjust.com"` | `true` | `false` | -#### Examples {#examples} +#### Examples {% #examples %} - +{% codeblock title="India URL strategy" %} ```cpp adjustConfig.setUrlStrategy(['adjust.net.in', 'adjust.com'], true, false); ``` - +{% /codeblock %} - +{% codeblock title="China URL strategy" %} ```cpp adjustConfig.setUrlStrategy(['adjust.world', 'adjust.com'], true, false); ``` - +{% /codeblock %} - +{% codeblock title="China only URL strategy" %} ```cpp adjustConfig.setUrlStrategy(['adjust.cn'], true, false); ``` - +{% /codeblock %} - +{% codeblock title="EU URL strategy" %} ```cpp adjustConfig.setUrlStrategy(['eu.adjust.com'], true, true); ``` - +{% /codeblock %} - +{% codeblock title="Turkey URL strategy" %} ```cpp adjustConfig.setUrlStrategy(['tr.adjust.com'], true, true); ``` - +{% /codeblock %} - +{% codeblock title="US URL strategy" %} ```cpp adjustConfig.setUrlStrategy(['us.adjust.com'], true, true); ``` - +{% /codeblock %} -### Record ad revenue {#record-ad-revenue} +### Record ad revenue {% #record-ad-revenue %} In SDK v4, you can record ad revenue by instantiating an `AdjustAdRevenue2dx` object with an ad revenue source constant. @@ -454,7 +454,7 @@ AdjustAdRevenue2dx adRevenue = AdjustAdRevenue2dx("applovin_max_sdk") | `AdjustAdRevenueSourceTopOn` | `'topon_sdk'` | | `AdjustAdRevenueSourceMopub` | No longer supported | -### Disable SKAdNetwork communication {#disable-skan} +### Disable SKAdNetwork communication {% #disable-skan %} In SDK v4, you can prevent the SDK from communicating with SKAdNetwork by calling the `adjustConfig.deactivateSKAdNetworkHandling` method. @@ -468,7 +468,7 @@ In SDK v5, you need to call the `disableSkanAttribution` method on your `adjustC adjustConfig.disableSkanAttribution(); ``` -### Listen for conversion value updates {#listen-for-cv-updates} +### Listen for conversion value updates {% #listen-for-cv-updates %} In SDK v4, you can call the `setPostbackConversionValueUpdatedCallback` method on your `adjustConfig` to listen for conversion value updates. Before SKAN4, you could use the `setConversionValueUpdatedCallback` method. @@ -500,7 +500,7 @@ adjustConfig.setSkanUpdatedCallback([]( }); ``` -### Update conversion values {#update-cvs} +### Update conversion values {% #update-cvs %} In SDK v4, you can use one of these methods to send updated conversion values to Adjust: @@ -538,7 +538,7 @@ Adjust2dx::updateSkanConversionValue(6, "low", true, [](std::string error) { }); ``` -### App Tracking Transparency authorization wrapper {#att-wrapper} +### App Tracking Transparency authorization wrapper {% #att-wrapper %} In SDK v4, you can handle changes to a user's ATT authorization status using the `Adjust2dx::requestTrackingAuthorizationWithCompletionHandler` method. @@ -586,11 +586,11 @@ static void authorizationStatusCallback(int status) { Adjust2dx::requestAppTrackingAuthorization(authorizationStatusCallback); ``` -### Get device information {#device-info} +### Get device information {% #device-info %} In SDK v4, all device information getter methods run synchronously. In SDK v5, these methods have been changed to run asynchronously. You can add a callback function to handle the information when the asynchronous process completes - +{% codeblock title="IDFA getter" %} ```cpp Adjust2dx::getIdfa([](std::string idfa) { @@ -598,9 +598,9 @@ Adjust2dx::getIdfa([](std::string idfa) { }); ``` - +{% /codeblock %} - +{% codeblock title="IDFV getter" %} ```cpp Adjust2dx::getIdfv([](std::string idfv) { @@ -608,9 +608,9 @@ Adjust2dx::getIdfv([](std::string idfv) { }); ``` - +{% /codeblock %} - +{% codeblock title="ADID getter" %} ```cpp Adjust2dx::getAdid([](std::string adid) { @@ -618,9 +618,9 @@ Adjust2dx::getAdid([](std::string adid) { }); ``` - +{% /codeblock %} - +{% codeblock title="Attribution getter" %} ```cpp Adjust2dx::getAttribution([](AdjustAttribution2dx attribution) { @@ -628,9 +628,9 @@ Adjust2dx::getAttribution([](AdjustAttribution2dx attribution) { }); ``` - +{% /codeblock %} - +{% codeblock title="Enabled status getter" %} ```cpp Adjust2dx::isEnabled([](bool isEnabled) { @@ -638,9 +638,9 @@ Adjust2dx::isEnabled([](bool isEnabled) { }); ``` - +{% /codeblock %} - +{% codeblock title="SDK version getter" %} ```cpp Adjust2dx::getSdkVersion([](std::string sdkVersion) { @@ -648,9 +648,9 @@ Adjust2dx::getSdkVersion([](std::string sdkVersion) { }); ``` - +{% /codeblock %} - +{% codeblock title="Last deep link getter" %} ```cpp Adjust2dx::getLastDeeplink([](std::string lastDeeplink) { @@ -658,15 +658,15 @@ Adjust2dx::getLastDeeplink([](std::string lastDeeplink) { }); ``` - +{% /codeblock %} -## Removed APIs {#removed-apis} +## Removed APIs {% #removed-apis %} - +{% minorversion removed="v5" size="large" /%} The following APIs have been removed in SDK v5. -### Event buffering {#event-buffering} +### Event buffering {% #event-buffering %} SDK v4 supports event buffering. This feature stores requests event, ad revenue, push tokens, and other information on a local buffer to send at a later date. @@ -676,7 +676,7 @@ adjustConfig.setEventBufferingEnabled(true); This setting has been removed in SDK v5. -### Custom user agent string {#custom-user-agent} +### Custom user agent string {% #custom-user-agent %} SDK v4 supports setting a custom User Agent by calling `adjustConfig.setUserAgent()` with a user agent string. @@ -686,7 +686,7 @@ adjustConfig.setUserAgent("custom-user-agent"); This setting has been removed in SDK v5. -### Set whether a device is known {#set-device-known} +### Set whether a device is known {% #set-device-known %} In SDK v4, you can call the `adjustConfig.setDeviceKnown()` method to manually inform the SDK whether a device is known. @@ -696,7 +696,7 @@ adjustConfig.setDeviceKnown(true); This setting has been removed in SDK v5. -### Delay SDK start {#delay-sdk-start} +### Delay SDK start {% #delay-sdk-start %} SDK v4 supports delaying the start of the SDK by calling `adjustConfig.setDelayStart()` with up to **10 seconds** of delay. @@ -706,7 +706,7 @@ adjustConfig.setDelayStart(10); This method has been removed in SDK v5. The `Adjust2dx::sendFirstPackages()` method that interrupts this delay has also been removed. -### Disable third party sharing globally {#disable-sharing-globally} +### Disable third party sharing globally {% #disable-sharing-globally %} In SDK v4, you can call the `Adjust2dx::disableThirdPartySharing()` method to globally disable sharing information with third parties globally. From 54e708259d9e109e744db71ff47cdc3e802f70e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Ainsworth?= Date: Mon, 23 Sep 2024 22:46:43 +0200 Subject: [PATCH 05/11] Remove unused code blocks --- .../docs/sdk/migration/cocos2dx/v4-to-v5.mdoc | 172 ++++++------------ 1 file changed, 52 insertions(+), 120 deletions(-) diff --git a/src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdoc b/src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdoc index 42c6e620e..d49e5e734 100644 --- a/src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdoc +++ b/src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdoc @@ -10,20 +10,21 @@ sidebar-position: 1 Here's what you need to do before updating to SDK v5: 1. SDK v5 supports [SDK signature verification](https://help.adjust.com/en/article/sdk-signature) natively. If you currently use the SDK signature library, you need to remove the signature library from your app first. -2. The minimum supported API versions for SDK v5 have been updated. If your app targets a lower version, you need to update it first. - - iOS: **12.0** - - Android: **21** +1. The minimum supported API versions for SDK v5 have been updated. If your app targets a lower version, you need to update it first. + + - iOS: **12.0** + - Android: **21** ## Install the SDK {% #install-the-sdk %} To start using SDK v5, you need to add it as a dependency in your project. To do this: 1. Download the SDK archive [from GitHub](https://github.com/adjust/cocos2dx_sdk/releases) -2. Copy the C++ files from the `dist` directory and add them to your Cocos2d-x project -3. (**Android only**): add the paths of the C++ files to the `LOCAL_SRC_FILES` section of your `Android.mk` file. - {% codeblock title="Android.mk" %} +1. Copy the C++ files from the `dist` directory and add them to your Cocos2d-x project + +1. (**Android only**): add the paths of the C++ files to the `LOCAL_SRC_FILES` section of your `Android.mk` file. ```text $(LOCAL_PATH)/../../../Classes/Adjust/AdjustConfig2dx.cpp \ @@ -44,11 +45,7 @@ To start using SDK v5, you need to add it as a dependency in your project. To do $(LOCAL_PATH)/../../../Classes/Adjust/AdjustDeeplink2dx.cpp \ ``` - {% /codeblock %} - -4. (**Android only**): add the Adjust Android SDK to your project using Maven. - - {% codeblock title="build.gradle" %} +1. (**Android only**): add the Adjust Android SDK to your project using Maven. ```groovy dependencies { @@ -56,8 +53,6 @@ To start using SDK v5, you need to add it as a dependency in your project. To do } ``` - {% /codeblock %} - ## Update the initialization method {% #update-the-init-method %} {% minorversion changed="v5" size="large" /%} @@ -65,7 +60,6 @@ To start using SDK v5, you need to add it as a dependency in your project. To do In SDK v4, the initialization method is `Adjust2dx::start(adjustConfig)`. This has been changed to `Adjust2dx::initSdk(adjustConfig)`. {% codeblock useDiffSyntax=true %} - ```cpp #include "Adjust/Adjust2dx.h" @@ -76,7 +70,6 @@ AdjustConfig2dx adjustConfig = AdjustConfig2dx(appToken, environment); - Adjust2dx::start(adjustConfig); + Adjust2dx::initSdk(adjustConfig); ``` - {% /codeblock %} ## Changed APIs {% #changed-apis %} @@ -96,8 +89,8 @@ Adjust2dx::setEnabled(true); // enable SDK In SDK v5, this feature is split into separate commands for clarity. -- Call `Adjust2dx::disable()` to disable the SDK. -- Call `Adjust2dx::enable()` to enable the SDK. +- Call `Adjust2dx::disable()` to disable the SDK. +- Call `Adjust2dx::enable()` to enable the SDK. ```cpp Adjust2dx::disable(); @@ -213,8 +206,8 @@ Adjust2dx::setOfflineMode(false); In SDK v5, this feature is split into separate commands for clarity. -- Call `Adjust2dx::switchToOfflineMode` to set the SDK to offline mode. -- Call `Adjust2dx::switchBackToOnlineMode` to set the SDK back to online mode. +- Call `Adjust2dx::switchToOfflineMode` to set the SDK to offline mode. +- Call `Adjust2dx::switchBackToOnlineMode` to set the SDK back to online mode. ```cpp Adjust2dx::switchToOfflineMode(); // Put the SDK in offline mode @@ -357,8 +350,8 @@ adjustConfig.setUrlStrategy(AdjustDataResidencyEU); In SDK v5, you need to pass your chosen domain or domains as an array. You need to also set the following: -- `useSubdomains` (`boolean`): Whether the domain should be treated as an Adjust domain. If `true`, the SDK will prefix the domains with Adjust-specific subdomains. If `false`, the SDK will use the provided domain as-is, without adding any prefixes. -- `isDataResidency` (`boolean`): Whether the domain should be used for data residency. +- `useSubdomains` (`boolean`): Whether the domain should be treated as an Adjust domain. If `true`, the SDK will prefix the domains with Adjust-specific subdomains. If `false`, the SDK will use the provided domain as-is, without adding any prefixes. +- `isDataResidency` (`boolean`): Whether the domain should be used for data residency. ```cpp adjustConfig.setUrlStrategy(["eu.adjust.com"], true, true); @@ -366,66 +359,38 @@ adjustConfig.setUrlStrategy(["eu.adjust.com"], true, true); Check the table below to see how to configure your URL strategy in SDK v5. -| v4 | v5 - main and fallback domain | v5 - use sub domains | v5 - is Data Residency | -| ------------------------- | --------------------------------- | -------------------- | ---------------------- | -| `AdjustDataResidencyEU` | `"eu.adjust.com"` | `true` | `true` | -| `AdjustDataResidencyTR` | `"tr.adjust.com"` | `true` | `true` | -| `AdjustDataResidencyUS` | `"us.adjust.com"` | `true` | `true` | -| `AdjustUrlStrategyChina` | `"adjust.world"`, `"adjust.com"` | `true` | `false` | -| `AdjustUrlStrategyCn` | `"adjust.cn"`, `"adjust.com"` | `true` | `false` | -| `AdjustUrlStrategyCnOnly` | `"adjust.cn"` | `true` | `false` | -| `AdjustUrlStrategyIndia` | `"adjust.net.in"`, `"adjust.com"` | `true` | `false` | +| v4 | v5 - main and fallback domain | v5 - use sub domains | v5 - is Data Residency | +| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | +| `AdjustDataResidencyEU` | `"eu.adjust.com"` | `true` | `true` | +| `AdjustDataResidencyTR` | `"tr.adjust.com"` | `true` | `true` | +| `AdjustDataResidencyUS` | `"us.adjust.com"` | `true` | `true` | +| `AdjustUrlStrategyChina` | `"adjust.world"`, `"adjust.com"` | `true` | `false` | +| `AdjustUrlStrategyCn` | `"adjust.cn"`, `"adjust.com"` | `true` | `false` | +| `AdjustUrlStrategyCnOnly` | `"adjust.cn"` | `true` | `false` | +| `AdjustUrlStrategyIndia` | `"adjust.net.in"`, `"adjust.com"` | `true` | `false` | #### Examples {% #examples %} -{% codeblock title="India URL strategy" %} - ```cpp +// India URL strategy adjustConfig.setUrlStrategy(['adjust.net.in', 'adjust.com'], true, false); -``` -{% /codeblock %} - -{% codeblock title="China URL strategy" %} - -```cpp +// China URL strategy adjustConfig.setUrlStrategy(['adjust.world', 'adjust.com'], true, false); -``` - -{% /codeblock %} - -{% codeblock title="China only URL strategy" %} -```cpp +// China only URL strategy adjustConfig.setUrlStrategy(['adjust.cn'], true, false); -``` - -{% /codeblock %} - -{% codeblock title="EU URL strategy" %} -```cpp +// EU URL strategy adjustConfig.setUrlStrategy(['eu.adjust.com'], true, true); -``` - -{% /codeblock %} -{% codeblock title="Turkey URL strategy" %} - -```cpp +// Turkey URL strategy adjustConfig.setUrlStrategy(['tr.adjust.com'], true, true); -``` - -{% /codeblock %} - -{% codeblock title="US URL strategy" %} -```cpp +// US URL strategy adjustConfig.setUrlStrategy(['us.adjust.com'], true, true); ``` -{% /codeblock %} - ### Record ad revenue {% #record-ad-revenue %} In SDK v4, you can record ad revenue by instantiating an `AdjustAdRevenue2dx` object with an ad revenue source constant. @@ -440,19 +405,19 @@ In SDK v5, you need to instantiate an `AdjustAdRevenue` object with a string `so AdjustAdRevenue2dx adRevenue = AdjustAdRevenue2dx("applovin_max_sdk") ``` -| v4 | v5 | -| --------------------------------------- | ------------------------- | -| `AdjustAdRevenueAppLovinMAX` | `'applovin_max_sdk'` | -| `AdjustAdRevenueSourceAdMob` | `'admob_sdk'` | -| `AdjustAdRevenueSourceIronSource` | `'ironsource_sdk'` | -| `AdjustAdRevenueSourceAdMost` | `'admost_sdk'` | -| `AdjustAdRevenueSourceUnity` | `'unity_sdk'` | -| `AdjustAdRevenueSourceHeliumChartboost` | `'helium_chartboost_sdk'` | -| `adjustConfig.AdRevenueSourceADX` | `'adx_sdk'` | -| `AdjustAdRevenueSourcePublisher` | `'publisher_sdk'` | -| `AdjustAdRevenueSourceTradplus` | `'tradplus_sdk'` | -| `AdjustAdRevenueSourceTopOn` | `'topon_sdk'` | -| `AdjustAdRevenueSourceMopub` | No longer supported | +| v4 | v5 | +| --------------------------------------- | --------------------------------------- | +| `AdjustAdRevenueAppLovinMAX` | `'applovin_max_sdk'` | +| `AdjustAdRevenueSourceAdMob` | `'admob_sdk'` | +| `AdjustAdRevenueSourceIronSource` | `'ironsource_sdk'` | +| `AdjustAdRevenueSourceAdMost` | `'admost_sdk'` | +| `AdjustAdRevenueSourceUnity` | `'unity_sdk'` | +| `AdjustAdRevenueSourceHeliumChartboost` | `'helium_chartboost_sdk'` | +| `adjustConfig.AdRevenueSourceADX` | `'adx_sdk'` | +| `AdjustAdRevenueSourcePublisher` | `'publisher_sdk'` | +| `AdjustAdRevenueSourceTradplus` | `'tradplus_sdk'` | +| `AdjustAdRevenueSourceTopOn` | `'topon_sdk'` | +| `AdjustAdRevenueSourceMopub` | No longer supported | ### Disable SKAdNetwork communication {% #disable-skan %} @@ -528,9 +493,9 @@ Adjust2dx::updatePostbackConversionValue(6, "low", false, [](std::string error) To update conversion values in SDK v5, use the `updateSkanConversionValue` method with the following arguments: -- `conversionValue` (`Number`): The updated conversion value -- `coarseValue` (`string`): The updated [coarse conversion value](https://developer.apple.com/documentation/storekit/skadnetwork/coarseconversionvalue) -- `lockWindow` (`boolean`): Whether to send the postback before the conversion window ends +- `conversionValue` (`Number`): The updated conversion value +- `coarseValue` (`string`): The updated [coarse conversion value](https://developer.apple.com/documentation/storekit/skadnetwork/coarseconversionvalue) +- `lockWindow` (`boolean`): Whether to send the postback before the conversion window ends ```cpp Adjust2dx::updateSkanConversionValue(6, "low", true, [](std::string error) { @@ -590,76 +555,43 @@ Adjust2dx::requestAppTrackingAuthorization(authorizationStatusCallback); In SDK v4, all device information getter methods run synchronously. In SDK v5, these methods have been changed to run asynchronously. You can add a callback function to handle the information when the asynchronous process completes -{% codeblock title="IDFA getter" %} - ```cpp +// IDFA getter Adjust2dx::getIdfa([](std::string idfa) { std::cout << "\nIDFA = " << idfa; }); -``` - -{% /codeblock %} -{% codeblock title="IDFV getter" %} - -```cpp +// IDFV getter Adjust2dx::getIdfv([](std::string idfv) { std::cout << "\nIDFV = " << idfa; }); -``` -{% /codeblock %} - -{% codeblock title="ADID getter" %} - -```cpp +// ADID getter Adjust2dx::getAdid([](std::string adid) { std::cout << "\nAdjust ID = " << adid; }); -``` -{% /codeblock %} - -{% codeblock title="Attribution getter" %} - -```cpp +// Attribution getter Adjust2dx::getAttribution([](AdjustAttribution2dx attribution) { // process attribution }); -``` - -{% /codeblock %} -{% codeblock title="Enabled status getter" %} - -```cpp +// Enabled status getter Adjust2dx::isEnabled([](bool isEnabled) { // process isEnabled }); -``` - -{% /codeblock %} - -{% codeblock title="SDK version getter" %} -```cpp +// SDK version getter Adjust2dx::getSdkVersion([](std::string sdkVersion) { std::cout << "\nSDK version = " << sdkVersion; }); -``` - -{% /codeblock %} -{% codeblock title="Last deep link getter" %} - -```cpp +// Last deep link getter Adjust2dx::getLastDeeplink([](std::string lastDeeplink) { std::cout << "\nLast deeplink = " << lastDeeplink; }); ``` -{% /codeblock %} - ## Removed APIs {% #removed-apis %} {% minorversion removed="v5" size="large" /%} From f28d79cd2fd723b0c19686979265ed26a52137f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Ainsworth?= Date: Wed, 25 Sep 2024 16:48:36 +0200 Subject: [PATCH 06/11] Add updates from doc --- .../docs/sdk/migration/cocos2dx/v4-to-v5.mdoc | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdoc b/src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdoc index d49e5e734..6d62e72df 100644 --- a/src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdoc +++ b/src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdoc @@ -264,6 +264,14 @@ In SDK v5, the feature is decoupled from `transaction ID`. A new ID field called adjustEvent.setDeduplicationId("deduplication-id"); ``` +You can set a custom limit on the number of `deduplicationId` that can be added to the list for identifying duplicate events. By default, the limit is set to **10**. + +```cpp +AdjustConfig adjustConfig = new AdjustConfig("appToken", AdjustEnvironment.Sandbox); +adjustConfig.setEventDeduplicationIdsMaxSize(20); +Adjust2dx::initSdk(adjustConfig); +``` + ### App Store Subscriptions {% #app-store-subscriptions %} In SDK v4, you can set a new subscription by configuring an `AdjustAppStoreSubscription2dx` object. This object is initialized with four arguments: `price`, `currency`, `transactionId`, and `receipt`. @@ -373,22 +381,22 @@ Check the table below to see how to configure your URL strategy in SDK v5. ```cpp // India URL strategy -adjustConfig.setUrlStrategy(['adjust.net.in', 'adjust.com'], true, false); +adjustConfig.setUrlStrategy({'adjust.net.in', 'adjust.com'}, true, false); // China URL strategy -adjustConfig.setUrlStrategy(['adjust.world', 'adjust.com'], true, false); +adjustConfig.setUrlStrategy({'adjust.world', 'adjust.com'}, true, false); // China only URL strategy -adjustConfig.setUrlStrategy(['adjust.cn'], true, false); +adjustConfig.setUrlStrategy({'adjust.cn'}, true, false); // EU URL strategy -adjustConfig.setUrlStrategy(['eu.adjust.com'], true, true); +adjustConfig.setUrlStrategy({'eu.adjust.com'}, true, true); // Turkey URL strategy -adjustConfig.setUrlStrategy(['tr.adjust.com'], true, true); +adjustConfig.setUrlStrategy({'tr.adjust.com'}, true, true); // US URL strategy -adjustConfig.setUrlStrategy(['us.adjust.com'], true, true); +adjustConfig.setUrlStrategy({'us.adjust.com'}, true, true); ``` ### Record ad revenue {% #record-ad-revenue %} @@ -457,11 +465,11 @@ In SDK v5, you need to assign a callback function to the `setSkanUpdatedCallback ```cpp adjustConfig.setSkanUpdatedCallback([]( - std::map skanData) { - std::cout << "\nConversion value: " << skanData["conversionValue"]; - std::cout << "\nCoarse value: " << skanData["coarseValue"]; - std::cout << "\nLock window: " << skanData["lockWindow"]; - std::cout << "\nError: " << skanData["error"]; + std::unordered_map data) { + std::cout << "\nConversion value: " << data["conversionValue"]; + std::cout << "\nCoarse value: " << data["coarseValue"]; + std::cout << "\nLock window: " << data["lockWindow"]; + std::cout << "\nError: " << data["error"]; }); ``` From 87cc17d569316209dc5ff9da2b16585ae0a8d14d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Ainsworth?= Date: Fri, 27 Sep 2024 16:21:05 +0200 Subject: [PATCH 07/11] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Uglješa Erceg --- .../docs/sdk/migration/cocos2dx/v4-to-v5.mdoc | 62 +++++++++---------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdoc b/src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdoc index 6d62e72df..f9dcf3156 100644 --- a/src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdoc +++ b/src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdoc @@ -43,6 +43,7 @@ To start using SDK v5, you need to add it as a dependency in your project. To do $(LOCAL_PATH)/../../../Classes/Adjust/AdjustAppStorePurchase2dx.cpp \ $(LOCAL_PATH)/../../../Classes/Adjust/AdjustPlayStorePurchase2dx.cpp \ $(LOCAL_PATH)/../../../Classes/Adjust/AdjustDeeplink2dx.cpp \ + $(LOCAL_PATH)/../../../Classes/Adjust/AdjustPurchaseVerificationResult2dx.cpp \ ``` 1. (**Android only**): add the Adjust Android SDK to your project using Maven. @@ -267,7 +268,7 @@ adjustEvent.setDeduplicationId("deduplication-id"); You can set a custom limit on the number of `deduplicationId` that can be added to the list for identifying duplicate events. By default, the limit is set to **10**. ```cpp -AdjustConfig adjustConfig = new AdjustConfig("appToken", AdjustEnvironment.Sandbox); +AdjustConfig2dx adjustConfig = AdjustConfig2dx("appToken", AdjustEnvironmentSandbox2dx); adjustConfig.setEventDeduplicationIdsMaxSize(20); Adjust2dx::initSdk(adjustConfig); ``` @@ -277,13 +278,13 @@ Adjust2dx::initSdk(adjustConfig); In SDK v4, you can set a new subscription by configuring an `AdjustAppStoreSubscription2dx` object. This object is initialized with four arguments: `price`, `currency`, `transactionId`, and `receipt`. ```cpp -AdjustAppStoreSubscription2dx subscription = AdjustAppStoreSubscription2dx(price, currency, transactionId, receipt) +AdjustAppStoreSubscription2dx subscription = AdjustAppStoreSubscription2dx(price, currency, transactionId, receipt); ``` In SDK v5, you don't need to pass the `receipt` argument as it's no longer needed for purchase verification. ```cpp -AdjustAppStoreSubscription2dx subscription = AdjustAppStoreSubscription2dx(price, currency, transactionId) +AdjustAppStoreSubscription2dx subscription = AdjustAppStoreSubscription2dx(price, currency, transactionId); ``` ### Reattribution using deep links {% #reattribution-using-deep-links %} @@ -358,11 +359,11 @@ adjustConfig.setUrlStrategy(AdjustDataResidencyEU); In SDK v5, you need to pass your chosen domain or domains as an array. You need to also set the following: -- `useSubdomains` (`boolean`): Whether the domain should be treated as an Adjust domain. If `true`, the SDK will prefix the domains with Adjust-specific subdomains. If `false`, the SDK will use the provided domain as-is, without adding any prefixes. -- `isDataResidency` (`boolean`): Whether the domain should be used for data residency. +- `useSubdomains` (`bool`): Whether the domain should be treated as an Adjust domain. If `true`, the SDK will prefix the domains with Adjust-specific subdomains. If `false`, the SDK will use the provided domain as-is, without adding any prefixes. +- `isDataResidency` (`bool`): Whether the domain should be used for data residency. ```cpp -adjustConfig.setUrlStrategy(["eu.adjust.com"], true, true); +adjustConfig.setUrlStrategy({"eu.adjust.com"}, true, true); ``` Check the table below to see how to configure your URL strategy in SDK v5. @@ -381,22 +382,22 @@ Check the table below to see how to configure your URL strategy in SDK v5. ```cpp // India URL strategy -adjustConfig.setUrlStrategy({'adjust.net.in', 'adjust.com'}, true, false); +adjustConfig.setUrlStrategy({"adjust.net.in", "adjust.com"}, true, false); // China URL strategy -adjustConfig.setUrlStrategy({'adjust.world', 'adjust.com'}, true, false); +adjustConfig.setUrlStrategy({"adjust.world", "adjust.com"}, true, false); // China only URL strategy -adjustConfig.setUrlStrategy({'adjust.cn'}, true, false); +adjustConfig.setUrlStrategy({"adjust.cn"}, true, false); // EU URL strategy -adjustConfig.setUrlStrategy({'eu.adjust.com'}, true, true); +adjustConfig.setUrlStrategy({"eu.adjust.com"}, true, true); // Turkey URL strategy -adjustConfig.setUrlStrategy({'tr.adjust.com'}, true, true); +adjustConfig.setUrlStrategy({"tr.adjust.com"}, true, true); // US URL strategy -adjustConfig.setUrlStrategy({'us.adjust.com'}, true, true); +adjustConfig.setUrlStrategy({"us.adjust.com"}, true, true); ``` ### Record ad revenue {% #record-ad-revenue %} @@ -415,16 +416,15 @@ AdjustAdRevenue2dx adRevenue = AdjustAdRevenue2dx("applovin_max_sdk") | v4 | v5 | | --------------------------------------- | --------------------------------------- | -| `AdjustAdRevenueAppLovinMAX` | `'applovin_max_sdk'` | -| `AdjustAdRevenueSourceAdMob` | `'admob_sdk'` | -| `AdjustAdRevenueSourceIronSource` | `'ironsource_sdk'` | -| `AdjustAdRevenueSourceAdMost` | `'admost_sdk'` | -| `AdjustAdRevenueSourceUnity` | `'unity_sdk'` | -| `AdjustAdRevenueSourceHeliumChartboost` | `'helium_chartboost_sdk'` | -| `adjustConfig.AdRevenueSourceADX` | `'adx_sdk'` | -| `AdjustAdRevenueSourcePublisher` | `'publisher_sdk'` | -| `AdjustAdRevenueSourceTradplus` | `'tradplus_sdk'` | -| `AdjustAdRevenueSourceTopOn` | `'topon_sdk'` | +| `AdjustAdRevenueSourceAppLovinMAX` | `"applovin_max_sdk"` | +| `AdjustAdRevenueSourceAdMob` | `"admob_sdk"` | +| `AdjustAdRevenueSourceIronSource` | `"ironsource_sdk"` | +| `AdjustAdRevenueSourceAdMostSource` | `"admost_sdk"` | +| `AdjustAdRevenueSourceUnity` | `"unity_sdk"` | +| `AdjustAdRevenueSourceHeliumChartboost` | `"helium_chartboost_sdk"` | +| `AdjustAdRevenueSourceAdx` | `"adx_sdk"` | +| `AdjustAdRevenueSourcePublisher` | `"publisher_sdk"` | +| `AdjustAdRevenueSourceTopOn` | `"topon_sdk"` | | `AdjustAdRevenueSourceMopub` | No longer supported | ### Disable SKAdNetwork communication {% #disable-skan %} @@ -501,9 +501,9 @@ Adjust2dx::updatePostbackConversionValue(6, "low", false, [](std::string error) To update conversion values in SDK v5, use the `updateSkanConversionValue` method with the following arguments: -- `conversionValue` (`Number`): The updated conversion value -- `coarseValue` (`string`): The updated [coarse conversion value](https://developer.apple.com/documentation/storekit/skadnetwork/coarseconversionvalue) -- `lockWindow` (`boolean`): Whether to send the postback before the conversion window ends +- `conversionValue` (`int`): The updated conversion value +- `coarseValue` (`std::string`): The updated [coarse conversion value](https://developer.apple.com/documentation/storekit/skadnetwork/coarseconversionvalue) +- `lockWindow` (`bool`): Whether to send the postback before the conversion window ends ```cpp Adjust2dx::updateSkanConversionValue(6, "low", true, [](std::string error) { @@ -618,7 +618,7 @@ This setting has been removed in SDK v5. ### Custom user agent string {% #custom-user-agent %} -SDK v4 supports setting a custom User Agent by calling `adjustConfig.setUserAgent()` with a user agent string. +SDK v4 supports setting a custom User Agent by calling `adjustConfig.setUserAgent` with a user agent string. ```cpp adjustConfig.setUserAgent("custom-user-agent"); @@ -628,7 +628,7 @@ This setting has been removed in SDK v5. ### Set whether a device is known {% #set-device-known %} -In SDK v4, you can call the `adjustConfig.setDeviceKnown()` method to manually inform the SDK whether a device is known. +In SDK v4, you can call the `adjustConfig.setDeviceKnown` method to manually inform the SDK whether a device is known. ```cpp adjustConfig.setDeviceKnown(true); @@ -638,7 +638,7 @@ This setting has been removed in SDK v5. ### Delay SDK start {% #delay-sdk-start %} -SDK v4 supports delaying the start of the SDK by calling `adjustConfig.setDelayStart()` with up to **10 seconds** of delay. +SDK v4 supports delaying the start of the SDK by calling `adjustConfig.setDelayStart` with up to **10 seconds** of delay. ```cpp adjustConfig.setDelayStart(10); @@ -648,13 +648,13 @@ This method has been removed in SDK v5. The `Adjust2dx::sendFirstPackages()` met ### Disable third party sharing globally {% #disable-sharing-globally %} -In SDK v4, you can call the `Adjust2dx::disableThirdPartySharing()` method to globally disable sharing information with third parties globally. +In SDK v4, you can call the `Adjust2dx::disableThirdPartySharing` method to globally disable sharing information with third parties globally. ```cpp -Adjust2dx::disableThirdPartySharing() +Adjust2dx::disableThirdPartySharing(); ``` -This feature has been removed from SDK v5. In SDK v5, use the `Adjust2dx::trackThirdPartySharing()` method to enable or disable third party sharing. +This feature has been removed from SDK v5. In SDK v5, use the `Adjust2dx::trackThirdPartySharing` method to enable or disable third party sharing. ```cpp AdjustThirdPartySharing2dx thirdPartySharing = AdjustThirdPartySharing2dx(false); From 9133501a73df0186b237f67d9d5c27f221563987 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Ainsworth?= Date: Fri, 27 Sep 2024 16:29:08 +0200 Subject: [PATCH 08/11] Add suggestions from feedback --- .../docs/sdk/migration/cocos2dx/v4-to-v5.mdoc | 67 ++++++++++++++----- 1 file changed, 50 insertions(+), 17 deletions(-) diff --git a/src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdoc b/src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdoc index f9dcf3156..954f6cff6 100644 --- a/src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdoc +++ b/src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdoc @@ -9,8 +9,6 @@ sidebar-position: 1 Here's what you need to do before updating to SDK v5: -1. SDK v5 supports [SDK signature verification](https://help.adjust.com/en/article/sdk-signature) natively. If you currently use the SDK signature library, you need to remove the signature library from your app first. - 1. The minimum supported API versions for SDK v5 have been updated. If your app targets a lower version, you need to update it first. - iOS: **12.0** @@ -46,13 +44,52 @@ To start using SDK v5, you need to add it as a dependency in your project. To do $(LOCAL_PATH)/../../../Classes/Adjust/AdjustPurchaseVerificationResult2dx.cpp \ ``` -1. (**Android only**): add the Adjust Android SDK to your project using Maven. - - ```groovy - dependencies { - implementation 'com.adjust.sdk:adjust-android:5.0.0' - } - ``` + If you're using CMake, add the following list of sources and headers to your `CMakeLists.txt` file: + + ```cmake + # add cross-platforms source files and header files + list(APPEND GAME_SOURCE + Classes/Adjust/AdjustConfig2dx.cpp + Classes/Adjust/AdjustAttribution2dx.cpp + Classes/Adjust/AdjustProxy2dx.cpp + Classes/Adjust/AdjustEvent2dx.cpp + Classes/Adjust/AdjustAdRevenue2dx.cpp + Classes/Adjust/AdjustAppStoreSubscription2dx.cpp + Classes/Adjust/AdjustPlayStoreSubscription2dx.cpp + Classes/Adjust/AdjustAppStorePurchase2dx.cpp + Classes/Adjust/AdjustPlayStorePurchase2dx.cpp + Classes/Adjust/Adjust2dx.cpp + Classes/Adjust/AdjustEventFailure2dx.cpp + Classes/Adjust/AdjustEventSuccess2dx.cpp + Classes/Adjust/AdjustSessionFailure2dx.cpp + Classes/Adjust/AdjustSessionSuccess2dx.cpp + Classes/Adjust/AdjustThirdPartySharing2dx.cpp + Classes/Adjust/AdjustDeeplink2dx.cpp + Classes/Adjust/AdjustPurchaseVerificationResult2dx.cpp + ) + list(APPEND GAME_HEADER + Classes/Adjust/AdjustConfig2dx.h + Classes/Adjust/AdjustAttribution2dx.h + Classes/Adjust/AdjustProxy2dx.h + Classes/Adjust/AdjustEvent2dx.h + Classes/Adjust/AdjustAdRevenue2dx.h + Classes/Adjust/AdjustAppStoreSubscription2dx.h + Classes/Adjust/AdjustPlayStoreSubscription2dx.h + Classes/Adjust/AdjustAppStorePurchase2dx.h + Classes/Adjust/AdjustPlayStorePurchase2dx.h + Classes/Adjust/Adjust2dx.h + Classes/Adjust/AdjustEventFailure2dx.h + Classes/Adjust/AdjustEventSuccess2dx.h + Classes/Adjust/AdjustSessionFailure2dx.h + Classes/Adjust/AdjustSessionSuccess2dx.h + Classes/Adjust/AdjustThirdPartySharing2dx.h + Classes/Adjust/AdjustDeeplink2dx.h + Classes/Adjust/AdjustPurchaseVerificationResult2dx.h + ) + ``` + +1. (**Android only**): download the latest `adjust-android.aar` from [the GitHub releases page](https://github.com/adjust/cocos2dx_sdk/releases/latest) and import it into your Android Studio project. +1. (**iOS only**): download the latest `AdjustSdk.xcframework` from [the GitHub releases page](https://github.com/adjust/cocos2dx_sdk/releases/latest) and link it in your Xcode project. ## Update the initialization method {% #update-the-init-method %} @@ -516,7 +553,7 @@ Adjust2dx::updateSkanConversionValue(6, "low", true, [](std::string error) { In SDK v4, you can handle changes to a user's ATT authorization status using the `Adjust2dx::requestTrackingAuthorizationWithCompletionHandler` method. ```cpp -static void authorizationStatusCallback(int status) { +Adjust2dx::requestTrackingAuthorizationWithCompletionHandler([] (int status) { switch (status) { case 0: // ATTrackingManagerAuthorizationStatusNotDetermined case @@ -531,15 +568,13 @@ static void authorizationStatusCallback(int status) { // ATTrackingManagerAuthorizationStatusAuthorized case break; } -} - -Adjust2dx::requestTrackingAuthorizationWithCompletionHandler(authorizationStatusCallback); +}); ``` This has been renamed to `Adjust2dx::requestAppTrackingAuthorization` in SDK v5 for clarity. ```cpp -static void authorizationStatusCallback(int status) { +Adjust2dx::requestAppTrackingAuthorization([] (int status) { switch (status) { case 0: // ATTrackingManagerAuthorizationStatusNotDetermined case @@ -554,9 +589,7 @@ static void authorizationStatusCallback(int status) { // ATTrackingManagerAuthorizationStatusAuthorized case break; } -} - -Adjust2dx::requestAppTrackingAuthorization(authorizationStatusCallback); +}); ``` ### Get device information {% #device-info %} From 7bf23135fad412e7df03236fd4dd42b4f8275b81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Ainsworth?= Date: Wed, 2 Oct 2024 10:52:43 +0200 Subject: [PATCH 09/11] Update src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdoc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Uglješa Erceg --- src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdoc b/src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdoc index 954f6cff6..47ec7daf1 100644 --- a/src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdoc +++ b/src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdoc @@ -89,7 +89,7 @@ To start using SDK v5, you need to add it as a dependency in your project. To do ``` 1. (**Android only**): download the latest `adjust-android.aar` from [the GitHub releases page](https://github.com/adjust/cocos2dx_sdk/releases/latest) and import it into your Android Studio project. -1. (**iOS only**): download the latest `AdjustSdk.xcframework` from [the GitHub releases page](https://github.com/adjust/cocos2dx_sdk/releases/latest) and link it in your Xcode project. +1. (**iOS only**): download the latest `AdjustSdk.framework` from [the GitHub releases page](https://github.com/adjust/cocos2dx_sdk/releases/latest) and link it in your Xcode project. ## Update the initialization method {% #update-the-init-method %} From 61e314e8fffa970179b8de887ca5a7de31a2bc70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Ainsworth?= Date: Wed, 2 Oct 2024 11:18:39 +0200 Subject: [PATCH 10/11] Add signature library integration steps --- .../docs/sdk/migration/cocos2dx/v4-to-v5.mdoc | 36 +++++++++++++++---- 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdoc b/src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdoc index 47ec7daf1..748a59b80 100644 --- a/src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdoc +++ b/src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdoc @@ -86,11 +86,35 @@ To start using SDK v5, you need to add it as a dependency in your project. To do Classes/Adjust/AdjustDeeplink2dx.h Classes/Adjust/AdjustPurchaseVerificationResult2dx.h ) - ``` + ``` 1. (**Android only**): download the latest `adjust-android.aar` from [the GitHub releases page](https://github.com/adjust/cocos2dx_sdk/releases/latest) and import it into your Android Studio project. + 1. (**iOS only**): download the latest `AdjustSdk.framework` from [the GitHub releases page](https://github.com/adjust/cocos2dx_sdk/releases/latest) and link it in your Xcode project. +## Set up the Signature library {% #signature-setup %} + +To use the [SDK signature library](https://help.adjust.com/en/article/sdk-signature) in Cocos2dx, you need to add the Adjust Signature library to your project. + +### Android apps + +1. Download the latest `adjust-android-signature.aar` from [the Adjust Signature library GitHub repository](https://github.com/adjust/adjust_signature_sdk/releases/latest). +1. Add the `.aar` to your Android Studio project. +1. [Enforce signature validation](https://help.adjust.com/en/article/sdk-signature#enforce-signature-validation) in Adjust. +1. [Provide your app's SHA-1 fingerprints](https://help.adjust.com/en/article/sdk-signature#manage-your-certificate-fingerprints) prior to testing. + +### iOS apps + +1. Download the latest `AdjustSigSdk-iOS-Static.a` from [the Adjust Signature library GitHub repository](https://github.com/adjust/adjust_signature_sdk/releases/latest). +1. Link the `.a` in your Xcode project. +1. [Enforce signature validation](https://help.adjust.com/en/article/sdk-signature#enforce-signature-validation) in Adjust. + +## Update your app's privacy manifest (iOS only) {% #update-privacy-manifest %} + +To inform the App Store of the Adjust SDK's privacy requirements, you need to add Adjust's privacy manifest properties to your app's privacy manifest. + +Adjust's privacy manifest is available [on GitHub](https://github.com/adjust/ios_sdk/blob/master/Adjust/PrivacyInfo.xcprivacy). + ## Update the initialization method {% #update-the-init-method %} {% minorversion changed="v5" size="large" /%} @@ -118,7 +142,7 @@ The following APIs have been changed in SDK v5. ### Disable and enable the SDK {% #disable-enable-sdk %} -In SDK v4, you can enable and disable the SDK by calling `Adjust2dx::setEnabled` with a `boolean` value. +In SDK v4, you can enable and disable the SDK by calling `Adjust2dx::setEnabled` with a `bool` value. ```cpp Adjust2dx::setEnabled(false); // disable SDK @@ -235,7 +259,7 @@ adjustConfig.enableDeviceIdsReadingOnce(); ### Offline mode {% #offline-mode %} -In SDK v4, you can enable and disable offline mode the SDK by calling `Adjust2dx::setOfflineMode` with a `boolean` argument. +In SDK v4, you can enable and disable offline mode the SDK by calling `Adjust2dx::setOfflineMode` with a `bool` argument. ```cpp Adjust2dx::setOfflineMode(true); @@ -453,13 +477,13 @@ AdjustAdRevenue2dx adRevenue = AdjustAdRevenue2dx("applovin_max_sdk") | v4 | v5 | | --------------------------------------- | --------------------------------------- | -| `AdjustAdRevenueSourceAppLovinMAX` | `"applovin_max_sdk"` | +| `AdjustAdRevenueSourceAppLovinMAX` | `"applovin_max_sdk"` | | `AdjustAdRevenueSourceAdMob` | `"admob_sdk"` | | `AdjustAdRevenueSourceIronSource` | `"ironsource_sdk"` | -| `AdjustAdRevenueSourceAdMostSource` | `"admost_sdk"` | +| `AdjustAdRevenueSourceAdMostSource` | `"admost_sdk"` | | `AdjustAdRevenueSourceUnity` | `"unity_sdk"` | | `AdjustAdRevenueSourceHeliumChartboost` | `"helium_chartboost_sdk"` | -| `AdjustAdRevenueSourceAdx` | `"adx_sdk"` | +| `AdjustAdRevenueSourceAdx` | `"adx_sdk"` | | `AdjustAdRevenueSourcePublisher` | `"publisher_sdk"` | | `AdjustAdRevenueSourceTopOn` | `"topon_sdk"` | | `AdjustAdRevenueSourceMopub` | No longer supported | From e1fd7cd384e45e125b6ce0aab6e018008c8a695b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Ainsworth?= Date: Wed, 2 Oct 2024 14:41:44 +0200 Subject: [PATCH 11/11] Add signature privacy manifest link --- src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdoc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdoc b/src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdoc index 748a59b80..aca0c895d 100644 --- a/src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdoc +++ b/src/content/docs/sdk/migration/cocos2dx/v4-to-v5.mdoc @@ -100,14 +100,13 @@ To use the [SDK signature library](https://help.adjust.com/en/article/sdk-signat 1. Download the latest `adjust-android-signature.aar` from [the Adjust Signature library GitHub repository](https://github.com/adjust/adjust_signature_sdk/releases/latest). 1. Add the `.aar` to your Android Studio project. -1. [Enforce signature validation](https://help.adjust.com/en/article/sdk-signature#enforce-signature-validation) in Adjust. 1. [Provide your app's SHA-1 fingerprints](https://help.adjust.com/en/article/sdk-signature#manage-your-certificate-fingerprints) prior to testing. ### iOS apps 1. Download the latest `AdjustSigSdk-iOS-Static.a` from [the Adjust Signature library GitHub repository](https://github.com/adjust/adjust_signature_sdk/releases/latest). 1. Link the `.a` in your Xcode project. -1. [Enforce signature validation](https://help.adjust.com/en/article/sdk-signature#enforce-signature-validation) in Adjust. +1. Add the [Signature library privacy manifest](https://github.com/adjust/adjust_signature_sdk/blob/main/Resources/iOS/PrivacyInfo.xcprivacy) properties to your app's privacy manifest. ## Update your app's privacy manifest (iOS only) {% #update-privacy-manifest %}