diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5609db38..1c7ee9a9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,20 @@
+### Version 4.23.0 (26th August 2020)
+#### Added
+- Added communication with SKAdNetwork framework by default on iOS 14.
+- Added method `deactivateSKAdNetworkHandling` method to `AdjustConfig2dx` to switch off default communication with SKAdNetwork framework in iOS 14.
+- Added wrapper method `requestTrackingAuthorizationWithCompletionHandler` to `Adjust2dx` to allow asking for user's consent to be tracked in iOS 14 and immediate propagation of user's choice to backend.
+- Added handling of new iAd framework error codes introduced in iOS 14.
+- Added sending of value of user's consent to be tracked with each package.
+- Added `setUrlStrategy` method to `AdjustConfig2dx` class to allow selection of URL strategy for specific market.
+
+⚠️ **Note**: iOS 14 beta versions prior to 5 appear to have an issue when trying to use iAd framework API like described in [here](https://github.com/adjust/ios_sdk/issues/452). For testing of v4.23.0 version of SDK in iOS, please make sure you're using **iOS 14 beta 5 or later**.
+
+#### Native SDKs
+- [iOS@v4.23.0][ios_sdk_v4.23.0]
+- [Android@v4.24.0][android_sdk_v4.24.0]
+
+---
+
### Version 4.22.0 (17th June 2020)
#### Added
- Added subscription tracking feature.
@@ -311,6 +328,7 @@
[ios_sdk_v4.17.2]: https://github.com/adjust/ios_sdk/tree/v4.17.2
[ios_sdk_v4.18.0]: https://github.com/adjust/ios_sdk/tree/v4.18.0
[ios_sdk_v4.22.1]: https://github.com/adjust/ios_sdk/tree/v4.22.1
+[ios_sdk_v4.23.0]: https://github.com/adjust/ios_sdk/tree/v4.23.0
[android_sdk_v4.0.8]: https://github.com/adjust/android_sdk/tree/v4.0.8
[android_sdk_v4.1.0]: https://github.com/adjust/android_sdk/tree/v4.1.0
@@ -329,5 +347,6 @@
[android_sdk_v4.17.0]: https://github.com/adjust/android_sdk/tree/v4.17.0
[android_sdk_v4.18.0]: https://github.com/adjust/android_sdk/tree/v4.18.0
[android_sdk_v4.22.0]: https://github.com/adjust/android_sdk/tree/v4.22.0
+[android_sdk_v4.24.0]: https://github.com/adjust/android_sdk/tree/v4.24.0
[windows_sdk_v4.0.3]: https://github.com/adjust/windows_sdk/tree/v4.0.3
diff --git a/README.md b/README.md
index 8786d489..b4d33261 100644
--- a/README.md
+++ b/README.md
@@ -15,6 +15,7 @@ This is the Cocos2d-x SDK of Adjust™. You can read more about Adjust™ at [Ad
* [[Android] Install referrer](#android-referrer)
* [Google Play Referrer API](#android-referrer-gpr-api)
* [Google Play Store intent](#android-referrer-gps-intent)
+ * [Huawei Referrer API](#android-huawei-referrer-api)
* [[iOS] Frameworks](#ios-frameworks)
* [[iOS] Additional linker flags](#ios-linker-flags)
* [Integrate the SDK into your app](#sdk-integrate)
@@ -22,6 +23,9 @@ This is the Cocos2d-x SDK of Adjust™. You can read more about Adjust™ at [Ad
* [Android session tracking](#sdk-android-session-tracking)
* [Build your app](#sdk-build)
* [Additional features](#additional-features)
+ * [AppTrackingTransparency framework](#att-framework)
+ * [App-tracking authorisation wrapper](#ata-wrapper)
+ * [SKAdNetwork framework](#skadn-framework)
* [Event tracking](#event-tracking)
* [Revenue tracking](#revenue-tracking)
* [Revenue deduplication](#revenue-deduplication)
@@ -80,7 +84,9 @@ $(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/AdjustSessionSuccess2dx.cpp \
+$(LOCAL_PATH)/../../../Classes/Adjust/AdjustAppStoreSubscription2dx.cpp \
+$(LOCAL_PATH)/../../../Classes/Adjust/AdjustPlayStoreSubscription2dx.cpp
```
### Adjust project settings
@@ -198,11 +204,22 @@ We use this broadcast receiver to retrieve the install referrer and pass it to o
Please bear in mind that, if you are using your own broadcast receiver which handles the `INSTALL_REFERRER` intent, you don't need the Adjust broadcast receiver to be added to your manifest file. You can remove it, but, inside your own receiver, add the call to the Adjust broadcast receiver as described in our [Android guide][broadcast-receiver-custom].
+#### Huawei Referrer API
+
+As of v4.22.0, the Adjust SDK supports install tracking on Huawei devices with Huawei App Gallery version 10.4 and higher. No additional integration steps are needed to start using the Huawei Referrer API.
+
### [iOS] Frameworks
-You need to add the **AdjustSdk**, **AdSupport**, **iAd** and **CoreTelephony** frameworks to your project. Before adding the `AdjustSdk.framework` to your project, ensure that you first copy it into the `proj.ios_mac/ios` folder of your project.
+You need to add following frameworks to your app's Xcode project:
-If you are not running any iAd campaigns, feel free to remove the `iAd.framework` dependency.
+* `iAd.framework` - in case you are running iAd campaigns
+* `AdSupport.framework` - for reading iOS Advertising Id (IDFA)
+* `CoreTelephony.framework` - for reading MCC and MNC information
+* `StoreKit.framework` - for communication with SKAdNetwork framework
+* `AppTrackingTransparency.framework` - to ask for user's consent to be tracked and obtain status of that consent
+* `AdjustSdk.framework` - our native iOS SDK framework
+
+If you are not running any iAd campaigns, you can feel free to remove the `iAd.framework` dependency. If you don't use SKAdNetwork framework, feel free to remove `StoreKit.framework` dependency (unless you need it for something else).
### [iOS] Additional linker flags
@@ -304,6 +321,73 @@ Build and run your app. If the build is successful, carefully read through the S
Once you integrate the Adjust SDK into your project, you can take advantage of the following features.
+### AppTrackingTransparency framework
+
+**Note**: This feature exists only in iOS platform.
+
+For each package sent, the Adjust backend receives one of the following four (4) states of consent for access to app-related data that can be used for tracking the user or the device:
+
+- Authorized
+- Denied
+- Not Determined
+- Restricted
+
+After a device receives an authorization request to approve access to app-related data, which is used for user device tracking, the returned status will either be Authorized or Denied.
+
+Before a device receives an authorization request for access to app-related data, which is used for tracking the user or device, the returned status will be Not Determined.
+
+If authorization to use app tracking data is restricted, the returned status will be Restricted.
+
+The SDK has a built-in mechanism to receive an updated status after a user responds to the pop-up dialog, in case you don't want to customize your displayed dialog pop-up. To conveniently and efficiently communicate the new state of consent to the backend, Adjust SDK offers a wrapper around the app tracking authorization method described in the following chapter, App-tracking authorization wrapper.
+
+### App-tracking authorisation wrapper
+
+**Note**: This feature exists only in iOS platform.
+
+Adjust SDK offers the possibility to use it for requesting user authorization in accessing their app-related data. Adjust SDK has a wrapper built on top of the [requestTrackingAuthorizationWithCompletionHandler:](https://developer.apple.com/documentation/apptrackingtransparency/attrackingmanager/3547037-requesttrackingauthorizationwith?language=objc) method, where you can as well define the callback method to get information about a user's choice. Also, with the use of this wrapper, as soon as a user responds to the pop-up dialog, it's then communicated back using your callback method. The SDK will also inform the backend of the user's choice. Integer value will be delivered via your callback method with the following meaning:
+
+- 0: `ATTrackingManagerAuthorizationStatusNotDetermined`
+- 1: `ATTrackingManagerAuthorizationStatusRestricted`
+- 2: `ATTrackingManagerAuthorizationStatusDenied`
+- 3: `ATTrackingManagerAuthorizationStatusAuthorized`
+
+To use this wrapper, you can call it as such:
+
+```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);
+```
+
+### SKAdNetwork framework
+
+**Note**: This feature exists only in iOS platform.
+
+If you have implemented the Adjust iOS SDK v4.23.0 or above and your app is running on iOS 14, the communication with SKAdNetwork will be set on by default, although you can choose to turn it off. When set on, Adjust automatically registers for SKAdNetwork attribution when the SDK is initialized. If events are set up in the Adjust dashboard to receive conversion values, the Adjust backend sends the conversion value data to the SDK. The SDK then sets the conversion value. After Adjust receives the SKAdNetwork callback data, it is then displayed in the dashboard.
+
+In case you don't want the Adjust SDK to automatically communicate with SKAdNetwork, you can disable that by calling the following method on configuration object:
+
+```cpp
+adjustConfig.deactivateSKAdNetworkHandling();
+```
+
### Event tracking
With Adjust, you can track any event that you want.
diff --git a/VERSION b/VERSION
index 7c6be317..58fe3522 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-4.21.0
+4.23.0
diff --git a/dist/ADJAdjust2dx.h b/dist/ADJAdjust2dx.h
index d837a817..e7b861ab 100755
--- a/dist/ADJAdjust2dx.h
+++ b/dist/ADJAdjust2dx.h
@@ -45,6 +45,7 @@ class ADJAdjust2dx {
static std::string getAdid();
static std::string getSdkVersion();
static AdjustAttribution2dx getAttribution();
+ static void requestTrackingAuthorizationWithCompletionHandler(void (*trackingStatusCallback)(int status));
// For testing purposes only.
static void setTestOptions(std::map testOptionsMap);
static void teardown();
diff --git a/dist/ADJAdjust2dx.mm b/dist/ADJAdjust2dx.mm
index e71f9ead..790377ce 100755
--- a/dist/ADJAdjust2dx.mm
+++ b/dist/ADJAdjust2dx.mm
@@ -192,6 +192,12 @@
return attribution2dx;
}
+void ADJAdjust2dx::requestTrackingAuthorizationWithCompletionHandler(void (*trackingStatusCallback)(int status)) {
+ [Adjust requestTrackingAuthorizationWithCompletionHandler:^(NSUInteger status) {
+ trackingStatusCallback((int)status);
+ }];
+}
+
void ADJAdjust2dx::setTestOptions(std::map testOptionsMap) {
AdjustTestOptions *testOptions = [[AdjustTestOptions alloc] init];
testOptions.baseUrl = [NSString stringWithUTF8String:testOptionsMap["baseUrl"].c_str()];
diff --git a/dist/ADJConfig2dx.h b/dist/ADJConfig2dx.h
index e14dbede..959aed4f 100755
--- a/dist/ADJConfig2dx.h
+++ b/dist/ADJConfig2dx.h
@@ -56,6 +56,8 @@ class ADJConfig2dx {
void setExternalDeviceId(std::string externalDeviceId);
void setAppSecret(long secretId, long info1, long info2, long info3, long info4);
void setIsDeviceKnown(bool isDeviceKnown);
+ void setUrlStrategy(std::string urlStrategy);
+ void deactivateSKAdNetworkHandling();
void setAttributionCallback(void(*callbackMethod)(AdjustAttribution2dx attribution));
void setEventSuccessCallback(void(*callbackMethod)(AdjustEventSuccess2dx eventSuccess));
void setEventFailureCallback(void(*callbackMethod)(AdjustEventFailure2dx eventFailure));
diff --git a/dist/ADJConfig2dx.mm b/dist/ADJConfig2dx.mm
index 61a3a5fc..14b2fda5 100755
--- a/dist/ADJConfig2dx.mm
+++ b/dist/ADJConfig2dx.mm
@@ -53,6 +53,19 @@
((ADJConfig *)config).externalDeviceId = [NSString stringWithUTF8String:externalDeviceId.c_str()];
}
+void ADJConfig2dx::setUrlStrategy(std::string urlStrategy) {
+ NSString *strUrlStrategy = [NSString stringWithUTF8String:urlStrategy.c_str()];
+ if ([strUrlStrategy isEqualToString:@"china"]) {
+ ((ADJConfig *)config).urlStrategy = ADJUrlStrategyChina;
+ } else if ([strUrlStrategy isEqualToString:@"india"]) {
+ ((ADJConfig *)config).urlStrategy = ADJUrlStrategyIndia;
+ }
+}
+
+void ADJConfig2dx::deactivateSKAdNetworkHandling() {
+ [((ADJConfig *)config) deactivateSKAdNetworkHandling];
+}
+
void ADJConfig2dx::setAttributionCallback(void (*callbackMethod)(AdjustAttribution2dx attribution)) {
attributionCallback = callbackMethod;
}
diff --git a/dist/Adjust2dx.cpp b/dist/Adjust2dx.cpp
index 4a1d79d4..6f508292 100755
--- a/dist/Adjust2dx.cpp
+++ b/dist/Adjust2dx.cpp
@@ -573,6 +573,12 @@ std::string Adjust2dx::getIdfa() {
#endif
}
+void Adjust2dx::requestTrackingAuthorizationWithCompletionHandler(void (*trackingStatusCallback)(int status)) {
+#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
+ ADJAdjust2dx::requestTrackingAuthorizationWithCompletionHandler(trackingStatusCallback);
+#endif
+}
+
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
jobject getTestOptions(std::map testOptions) {
cocos2d::JniMethodInfo jmiInit;
diff --git a/dist/Adjust2dx.h b/dist/Adjust2dx.h
index 04e1d757..6900addd 100755
--- a/dist/Adjust2dx.h
+++ b/dist/Adjust2dx.h
@@ -52,6 +52,7 @@ class Adjust2dx {
// iOS specific methods.
static std::string getIdfa();
static void trackAppStoreSubscription(AdjustAppStoreSubscription2dx subscription);
+ static void requestTrackingAuthorizationWithCompletionHandler(void (*trackingStatusCallback)(int status));
// For testing purposes only.
static void setTestOptions(std::map testOptions);
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
diff --git a/dist/AdjustConfig2dx.cpp b/dist/AdjustConfig2dx.cpp
index 0ae327fe..fb45708e 100755
--- a/dist/AdjustConfig2dx.cpp
+++ b/dist/AdjustConfig2dx.cpp
@@ -1,4 +1,3 @@
-
// AdjustConfig2dx.cpp
// Adjust SDK
//
@@ -16,7 +15,9 @@
#include "AdjustConfig2dx.h"
USING_NS_CC;
-const std::string AdjustSdkPrefix2dx = "cocos2d-x4.21.0";
+const std::string AdjustSdkPrefix2dx = "cocos2d-x4.23.0";
+const std::string AdjustUrlStrategyChina = "china";
+const std::string AdjustUrlStrategyIndia = "india";
void AdjustConfig2dx::initConfig(std::string appToken, std::string environment, bool allowSuppressLogLevel) {
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
@@ -242,6 +243,36 @@ void AdjustConfig2dx::setExternalDeviceId(std::string externalDeviceId) {
#endif
}
+void AdjustConfig2dx::setUrlStrategy(std::string urlStrategy) {
+#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
+ if (config == NULL) {
+ return;
+ }
+ cocos2d::JniMethodInfo jmiSetUrlStrategy;
+ if (!cocos2d::JniHelper::getMethodInfo(jmiSetUrlStrategy, "com/adjust/sdk/AdjustConfig", "setUrlStrategy", "(Ljava/lang/String;)V")) {
+ return;
+ }
+
+ if (urlStrategy.compare(AdjustUrlStrategyChina) == 0) {
+ jclass jclsAdjustConfig = jmiSetUrlStrategy.env->FindClass("com/adjust/sdk/AdjustConfig");
+ jfieldID jfidUrlStrategyChina = jmiSetUrlStrategy.env->GetStaticFieldID(jclsAdjustConfig, "URL_STRATEGY_CHINA", "Ljava/lang/String;");
+ jstring jUrlStrategyChina = (jstring)jmiSetUrlStrategy.env->GetStaticObjectField(jclsAdjustConfig, jfidUrlStrategyChina);
+ jmiSetUrlStrategy.env->CallVoidMethod(config, jmiSetUrlStrategy.methodID, jUrlStrategyChina);
+ jmiSetUrlStrategy.env->DeleteLocalRef(jUrlStrategyChina);
+ } else if (urlStrategy.compare(AdjustUrlStrategyIndia) == 0) {
+ jclass jclsAdjustConfig = jmiSetUrlStrategy.env->FindClass("com/adjust/sdk/AdjustConfig");
+ jfieldID jfidUrlStrategyIndia = jmiSetUrlStrategy.env->GetStaticFieldID(jclsAdjustConfig, "URL_STRATEGY_INDIA", "Ljava/lang/String;");
+ jstring jUrlStrategyIndia = (jstring)jmiSetUrlStrategy.env->GetStaticObjectField(jclsAdjustConfig, jfidUrlStrategyIndia);
+ jmiSetUrlStrategy.env->CallVoidMethod(config, jmiSetUrlStrategy.methodID, jUrlStrategyIndia);
+ jmiSetUrlStrategy.env->DeleteLocalRef(jUrlStrategyIndia);
+ }
+#elif (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
+ if (isConfigSet) {
+ config.setUrlStrategy(urlStrategy);
+ }
+#endif
+}
+
void AdjustConfig2dx::setAppSecret(unsigned long long secretId, unsigned long long info1, unsigned long long info2, unsigned long long info3, unsigned long long info4) {
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
if (config == NULL) {
@@ -276,6 +307,14 @@ void AdjustConfig2dx::setDeviceKnown(bool isDeviceKnown) {
#endif
}
+void AdjustConfig2dx::deactivateSKAdNetworkHandling() {
+#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
+ if (isConfigSet) {
+ config.deactivateSKAdNetworkHandling();
+ }
+#endif
+}
+
void AdjustConfig2dx::setReadMobileEquipmentIdentity(bool readMobileEquipmentIdentity) {
// #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
// if (config == NULL) {
diff --git a/dist/AdjustConfig2dx.h b/dist/AdjustConfig2dx.h
index 480a44cf..81b353fd 100755
--- a/dist/AdjustConfig2dx.h
+++ b/dist/AdjustConfig2dx.h
@@ -23,6 +23,8 @@
#include "AdjustSessionFailure2dx.h"
extern const std::string AdjustSdkPrefix2dx;
+extern const std::string AdjustUrlStrategyChina;
+extern const std::string AdjustUrlStrategyIndia;
enum AdjustLogLevel2dx {
AdjustLogLevel2dxVerbose = 1,
@@ -31,7 +33,8 @@ enum AdjustLogLevel2dx {
AdjustLogLevel2dxWarn = 4,
AdjustLogLevel2dxError = 5,
AdjustLogLevel2dxAssert = 6,
- AdjustLogLevel2dxSuppress = 7 };
+ AdjustLogLevel2dxSuppress = 7
+};
class AdjustConfig2dx {
private:
@@ -74,9 +77,11 @@ class AdjustConfig2dx {
void setProcessName(std::string processName);
void setDefaultTracker(std::string defaultTracker);
void setExternalDeviceId(std::string externalDeviceId);
+ void setUrlStrategy(std::string urlStrategy);
void setDelayStart(double delayStart);
void setLogLevel(AdjustLogLevel2dx logLevel, void(*logCallback)(const char* log) = NULL);
void setAppSecret(unsigned long long secretId, unsigned long long info1, unsigned long long info2, unsigned long long info3, unsigned long long info4);
+ void deactivateSKAdNetworkHandling();
void setAttributionCallback(void(*attributionCallback)(AdjustAttribution2dx attribution));
void setEventSuccessCallback(void(*eventSuccessCallback)(AdjustEventSuccess2dx eventSuccess));
void setEventFailureCallback(void(*eventFailureCallback)(AdjustEventFailure2dx eventFailure));
diff --git a/doc/migrate.md b/doc/migrate.md
index a76e3daa..f1cb1fe7 100644
--- a/doc/migrate.md
+++ b/doc/migrate.md
@@ -1,4 +1,4 @@
-## Migrate your Adjust SDK for Cocos2d-x to 4.21.0 from 4.0.x
+## Migrate your Adjust SDK for Cocos2d-x to 4.23.0 from 4.0.x
### SDK initialization
diff --git a/ext/android/proxy/adjust-android.jar b/ext/android/proxy/adjust-android.jar
index 18a17a78..edee3927 100644
Binary files a/ext/android/proxy/adjust-android.jar and b/ext/android/proxy/adjust-android.jar differ
diff --git a/ext/android/sdk b/ext/android/sdk
index 79a92a56..21355ae9 160000
--- a/ext/android/sdk
+++ b/ext/android/sdk
@@ -1 +1 @@
-Subproject commit 79a92a56f641ea0f6286a4b9ddf43e50561a95a9
+Subproject commit 21355ae9a2b802bbc82dfb3582ea2142c5739d1b
diff --git a/ext/ios/sdk b/ext/ios/sdk
index ba8e973e..25628b31 160000
--- a/ext/ios/sdk
+++ b/ext/ios/sdk
@@ -1 +1 @@
-Subproject commit ba8e973e97825bf18733970045108314ceae28fa
+Subproject commit 25628b3177ff1fa4aff9b6a4ac90f8bb4eb34038
diff --git a/libs/android/adjust-android.jar b/libs/android/adjust-android.jar
index 18a17a78..edee3927 100644
Binary files a/libs/android/adjust-android.jar and b/libs/android/adjust-android.jar differ
diff --git a/libs/ios/AdjustSdk.framework/Versions/A/AdjustSdk b/libs/ios/AdjustSdk.framework/Versions/A/AdjustSdk
index c3e6e7af..4c376fbf 100644
Binary files a/libs/ios/AdjustSdk.framework/Versions/A/AdjustSdk and b/libs/ios/AdjustSdk.framework/Versions/A/AdjustSdk differ
diff --git a/libs/ios/AdjustSdk.framework/Versions/A/Headers/ADJConfig.h b/libs/ios/AdjustSdk.framework/Versions/A/Headers/ADJConfig.h
index 1bcccf9a..4e8458ad 100644
--- a/libs/ios/AdjustSdk.framework/Versions/A/Headers/ADJConfig.h
+++ b/libs/ios/AdjustSdk.framework/Versions/A/Headers/ADJConfig.h
@@ -187,6 +187,16 @@
info3:(NSUInteger)info3
info4:(NSUInteger)info4;
+
+@property (nonatomic, assign, readonly) BOOL isSKAdNetworkHandlingActive;
+
+- (void)deactivateSKAdNetworkHandling;
+
+/**
+ * @brief Adjust url strategy.
+ */
+@property (nonatomic, copy, readwrite, nullable) NSString *urlStrategy;
+
/**
* @brief Get configuration object for the initialization of the Adjust SDK.
*
diff --git a/libs/ios/AdjustSdk.framework/Versions/A/Headers/Adjust.h b/libs/ios/AdjustSdk.framework/Versions/A/Headers/Adjust.h
index 34833a0f..4e194259 100644
--- a/libs/ios/AdjustSdk.framework/Versions/A/Headers/Adjust.h
+++ b/libs/ios/AdjustSdk.framework/Versions/A/Headers/Adjust.h
@@ -2,7 +2,7 @@
// Adjust.h
// Adjust
//
-// V4.22.1
+// V4.23.0
// Created by Christian Wellenbrock (wellle) on 23rd July 2013.
// Copyright © 2012-2017 Adjust GmbH. All rights reserved.
//
@@ -59,6 +59,12 @@ extern NSString * __nonnull const ADJAdRevenueSourceUnityads;
extern NSString * __nonnull const ADJAdRevenueSourceAdtoapp;
extern NSString * __nonnull const ADJAdRevenueSourceTapdaq;
+/**
+ * Constants for country apps url strategies.
+ */
+extern NSString * __nonnull const ADJUrlStrategyIndia;
+extern NSString * __nonnull const ADJUrlStrategyChina;
+
/**
* @brief The main interface to Adjust.
*
@@ -274,6 +280,8 @@ extern NSString * __nonnull const ADJAdRevenueSourceTapdaq;
*/
+ (void)trackSubscription:(nonnull ADJSubscription *)subscription;
++ (void)requestTrackingAuthorizationWithCompletionHandler:(void (^_Nullable)(NSUInteger status))completion;
+
/**
* Obtain singleton Adjust object.
*/
@@ -333,4 +341,6 @@ extern NSString * __nonnull const ADJAdRevenueSourceTapdaq;
- (nullable NSURL *)convertUniversalLink:(nonnull NSURL *)url scheme:(nonnull NSString *)scheme;
+- (void)requestTrackingAuthorizationWithCompletionHandler:(void (^_Nullable)(NSUInteger status))completion;
+
@end
diff --git a/src/ADJAdjust2dx.h b/src/ADJAdjust2dx.h
index d837a817..e7b861ab 100755
--- a/src/ADJAdjust2dx.h
+++ b/src/ADJAdjust2dx.h
@@ -45,6 +45,7 @@ class ADJAdjust2dx {
static std::string getAdid();
static std::string getSdkVersion();
static AdjustAttribution2dx getAttribution();
+ static void requestTrackingAuthorizationWithCompletionHandler(void (*trackingStatusCallback)(int status));
// For testing purposes only.
static void setTestOptions(std::map testOptionsMap);
static void teardown();
diff --git a/src/ADJAdjust2dx.mm b/src/ADJAdjust2dx.mm
index e71f9ead..790377ce 100755
--- a/src/ADJAdjust2dx.mm
+++ b/src/ADJAdjust2dx.mm
@@ -192,6 +192,12 @@
return attribution2dx;
}
+void ADJAdjust2dx::requestTrackingAuthorizationWithCompletionHandler(void (*trackingStatusCallback)(int status)) {
+ [Adjust requestTrackingAuthorizationWithCompletionHandler:^(NSUInteger status) {
+ trackingStatusCallback((int)status);
+ }];
+}
+
void ADJAdjust2dx::setTestOptions(std::map testOptionsMap) {
AdjustTestOptions *testOptions = [[AdjustTestOptions alloc] init];
testOptions.baseUrl = [NSString stringWithUTF8String:testOptionsMap["baseUrl"].c_str()];
diff --git a/src/ADJConfig2dx.h b/src/ADJConfig2dx.h
index e14dbede..959aed4f 100755
--- a/src/ADJConfig2dx.h
+++ b/src/ADJConfig2dx.h
@@ -56,6 +56,8 @@ class ADJConfig2dx {
void setExternalDeviceId(std::string externalDeviceId);
void setAppSecret(long secretId, long info1, long info2, long info3, long info4);
void setIsDeviceKnown(bool isDeviceKnown);
+ void setUrlStrategy(std::string urlStrategy);
+ void deactivateSKAdNetworkHandling();
void setAttributionCallback(void(*callbackMethod)(AdjustAttribution2dx attribution));
void setEventSuccessCallback(void(*callbackMethod)(AdjustEventSuccess2dx eventSuccess));
void setEventFailureCallback(void(*callbackMethod)(AdjustEventFailure2dx eventFailure));
diff --git a/src/ADJConfig2dx.mm b/src/ADJConfig2dx.mm
index 61a3a5fc..14b2fda5 100755
--- a/src/ADJConfig2dx.mm
+++ b/src/ADJConfig2dx.mm
@@ -53,6 +53,19 @@
((ADJConfig *)config).externalDeviceId = [NSString stringWithUTF8String:externalDeviceId.c_str()];
}
+void ADJConfig2dx::setUrlStrategy(std::string urlStrategy) {
+ NSString *strUrlStrategy = [NSString stringWithUTF8String:urlStrategy.c_str()];
+ if ([strUrlStrategy isEqualToString:@"china"]) {
+ ((ADJConfig *)config).urlStrategy = ADJUrlStrategyChina;
+ } else if ([strUrlStrategy isEqualToString:@"india"]) {
+ ((ADJConfig *)config).urlStrategy = ADJUrlStrategyIndia;
+ }
+}
+
+void ADJConfig2dx::deactivateSKAdNetworkHandling() {
+ [((ADJConfig *)config) deactivateSKAdNetworkHandling];
+}
+
void ADJConfig2dx::setAttributionCallback(void (*callbackMethod)(AdjustAttribution2dx attribution)) {
attributionCallback = callbackMethod;
}
diff --git a/src/Adjust2dx.cpp b/src/Adjust2dx.cpp
index 4a1d79d4..6f508292 100755
--- a/src/Adjust2dx.cpp
+++ b/src/Adjust2dx.cpp
@@ -573,6 +573,12 @@ std::string Adjust2dx::getIdfa() {
#endif
}
+void Adjust2dx::requestTrackingAuthorizationWithCompletionHandler(void (*trackingStatusCallback)(int status)) {
+#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
+ ADJAdjust2dx::requestTrackingAuthorizationWithCompletionHandler(trackingStatusCallback);
+#endif
+}
+
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
jobject getTestOptions(std::map testOptions) {
cocos2d::JniMethodInfo jmiInit;
diff --git a/src/Adjust2dx.h b/src/Adjust2dx.h
index 04e1d757..6900addd 100755
--- a/src/Adjust2dx.h
+++ b/src/Adjust2dx.h
@@ -52,6 +52,7 @@ class Adjust2dx {
// iOS specific methods.
static std::string getIdfa();
static void trackAppStoreSubscription(AdjustAppStoreSubscription2dx subscription);
+ static void requestTrackingAuthorizationWithCompletionHandler(void (*trackingStatusCallback)(int status));
// For testing purposes only.
static void setTestOptions(std::map testOptions);
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
diff --git a/src/AdjustConfig2dx.cpp b/src/AdjustConfig2dx.cpp
index 0ae327fe..fb45708e 100755
--- a/src/AdjustConfig2dx.cpp
+++ b/src/AdjustConfig2dx.cpp
@@ -1,4 +1,3 @@
-
// AdjustConfig2dx.cpp
// Adjust SDK
//
@@ -16,7 +15,9 @@
#include "AdjustConfig2dx.h"
USING_NS_CC;
-const std::string AdjustSdkPrefix2dx = "cocos2d-x4.21.0";
+const std::string AdjustSdkPrefix2dx = "cocos2d-x4.23.0";
+const std::string AdjustUrlStrategyChina = "china";
+const std::string AdjustUrlStrategyIndia = "india";
void AdjustConfig2dx::initConfig(std::string appToken, std::string environment, bool allowSuppressLogLevel) {
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
@@ -242,6 +243,36 @@ void AdjustConfig2dx::setExternalDeviceId(std::string externalDeviceId) {
#endif
}
+void AdjustConfig2dx::setUrlStrategy(std::string urlStrategy) {
+#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
+ if (config == NULL) {
+ return;
+ }
+ cocos2d::JniMethodInfo jmiSetUrlStrategy;
+ if (!cocos2d::JniHelper::getMethodInfo(jmiSetUrlStrategy, "com/adjust/sdk/AdjustConfig", "setUrlStrategy", "(Ljava/lang/String;)V")) {
+ return;
+ }
+
+ if (urlStrategy.compare(AdjustUrlStrategyChina) == 0) {
+ jclass jclsAdjustConfig = jmiSetUrlStrategy.env->FindClass("com/adjust/sdk/AdjustConfig");
+ jfieldID jfidUrlStrategyChina = jmiSetUrlStrategy.env->GetStaticFieldID(jclsAdjustConfig, "URL_STRATEGY_CHINA", "Ljava/lang/String;");
+ jstring jUrlStrategyChina = (jstring)jmiSetUrlStrategy.env->GetStaticObjectField(jclsAdjustConfig, jfidUrlStrategyChina);
+ jmiSetUrlStrategy.env->CallVoidMethod(config, jmiSetUrlStrategy.methodID, jUrlStrategyChina);
+ jmiSetUrlStrategy.env->DeleteLocalRef(jUrlStrategyChina);
+ } else if (urlStrategy.compare(AdjustUrlStrategyIndia) == 0) {
+ jclass jclsAdjustConfig = jmiSetUrlStrategy.env->FindClass("com/adjust/sdk/AdjustConfig");
+ jfieldID jfidUrlStrategyIndia = jmiSetUrlStrategy.env->GetStaticFieldID(jclsAdjustConfig, "URL_STRATEGY_INDIA", "Ljava/lang/String;");
+ jstring jUrlStrategyIndia = (jstring)jmiSetUrlStrategy.env->GetStaticObjectField(jclsAdjustConfig, jfidUrlStrategyIndia);
+ jmiSetUrlStrategy.env->CallVoidMethod(config, jmiSetUrlStrategy.methodID, jUrlStrategyIndia);
+ jmiSetUrlStrategy.env->DeleteLocalRef(jUrlStrategyIndia);
+ }
+#elif (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
+ if (isConfigSet) {
+ config.setUrlStrategy(urlStrategy);
+ }
+#endif
+}
+
void AdjustConfig2dx::setAppSecret(unsigned long long secretId, unsigned long long info1, unsigned long long info2, unsigned long long info3, unsigned long long info4) {
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
if (config == NULL) {
@@ -276,6 +307,14 @@ void AdjustConfig2dx::setDeviceKnown(bool isDeviceKnown) {
#endif
}
+void AdjustConfig2dx::deactivateSKAdNetworkHandling() {
+#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
+ if (isConfigSet) {
+ config.deactivateSKAdNetworkHandling();
+ }
+#endif
+}
+
void AdjustConfig2dx::setReadMobileEquipmentIdentity(bool readMobileEquipmentIdentity) {
// #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
// if (config == NULL) {
diff --git a/src/AdjustConfig2dx.h b/src/AdjustConfig2dx.h
index 480a44cf..81b353fd 100755
--- a/src/AdjustConfig2dx.h
+++ b/src/AdjustConfig2dx.h
@@ -23,6 +23,8 @@
#include "AdjustSessionFailure2dx.h"
extern const std::string AdjustSdkPrefix2dx;
+extern const std::string AdjustUrlStrategyChina;
+extern const std::string AdjustUrlStrategyIndia;
enum AdjustLogLevel2dx {
AdjustLogLevel2dxVerbose = 1,
@@ -31,7 +33,8 @@ enum AdjustLogLevel2dx {
AdjustLogLevel2dxWarn = 4,
AdjustLogLevel2dxError = 5,
AdjustLogLevel2dxAssert = 6,
- AdjustLogLevel2dxSuppress = 7 };
+ AdjustLogLevel2dxSuppress = 7
+};
class AdjustConfig2dx {
private:
@@ -74,9 +77,11 @@ class AdjustConfig2dx {
void setProcessName(std::string processName);
void setDefaultTracker(std::string defaultTracker);
void setExternalDeviceId(std::string externalDeviceId);
+ void setUrlStrategy(std::string urlStrategy);
void setDelayStart(double delayStart);
void setLogLevel(AdjustLogLevel2dx logLevel, void(*logCallback)(const char* log) = NULL);
void setAppSecret(unsigned long long secretId, unsigned long long info1, unsigned long long info2, unsigned long long info3, unsigned long long info4);
+ void deactivateSKAdNetworkHandling();
void setAttributionCallback(void(*attributionCallback)(AdjustAttribution2dx attribution));
void setEventSuccessCallback(void(*eventSuccessCallback)(AdjustEventSuccess2dx eventSuccess));
void setEventFailureCallback(void(*eventFailureCallback)(AdjustEventFailure2dx eventFailure));