diff --git a/Assets/Plugins/Android/AndroidManifest.xml b/Assets/Plugins/Android/AndroidManifest.xml
new file mode 100644
index 0000000..83b372c
--- /dev/null
+++ b/Assets/Plugins/Android/AndroidManifest.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Assets/Plugins/Android/AndroidManifest.xml.meta b/Assets/Plugins/Android/AndroidManifest.xml.meta
new file mode 100644
index 0000000..1784b30
--- /dev/null
+++ b/Assets/Plugins/Android/AndroidManifest.xml.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 147d3bb1ca0da2b448667eec3a82bb26
+TextScriptImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scenes/GameScene.unity b/Assets/Scenes/GameScene.unity
index cfdaf42..61d4ecb 100644
--- a/Assets/Scenes/GameScene.unity
+++ b/Assets/Scenes/GameScene.unity
@@ -833,6 +833,8 @@ GameObject:
- component: {fileID: 2137923634}
- component: {fileID: 2137923635}
- component: {fileID: 2137923636}
+ - component: {fileID: 2137923637}
+ - component: {fileID: 2137923638}
m_Layer: 0
m_Name: '[SDKManager]'
m_TagString: Untagged
@@ -880,6 +882,30 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: a550f9677d329f940876ee3d139f8289, type: 3}
m_Name:
m_EditorClassIdentifier:
+--- !u!114 &2137923637
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 2137923633}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 5019ae7cf0c6d3d4c89b8921e4beab15, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+--- !u!114 &2137923638
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 2137923633}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: f925ec84be5d37d4ba2ee62fc7ffb464, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
--- !u!1660057539 &9223372036854775807
SceneRoots:
m_ObjectHideFlags: 0
diff --git a/Assets/Script/SDKManager/AdjustManager.meta b/Assets/Script/SDKManager/AdjustManager.meta
new file mode 100644
index 0000000..1e6df9a
--- /dev/null
+++ b/Assets/Script/SDKManager/AdjustManager.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 7612045c73134949a914f701ff109389
+timeCreated: 1756549078
\ No newline at end of file
diff --git a/Assets/Script/SDKManager/AdjustManager/AdjustManager.cs b/Assets/Script/SDKManager/AdjustManager/AdjustManager.cs
new file mode 100644
index 0000000..cab0086
--- /dev/null
+++ b/Assets/Script/SDKManager/AdjustManager/AdjustManager.cs
@@ -0,0 +1,40 @@
+using System.Collections;
+using System.Collections.Generic;
+using AdjustSdk;
+using Unity.VisualScripting;
+using UnityEngine;
+
+public class AdjustManager : MonoBehaviour
+{
+ private string appToken = "你的App Token"; // 替换为你的实际App Token
+ private AdjustEnvironment environment = AdjustEnvironment.Sandbox; // 测试用Sandbox,发布用Production
+
+
+
+ public void Awake()
+ {
+ AdjustConfig config = new AdjustConfig(appToken, environment);
+
+ // 设置归因变更回调函数
+ config.AttributionChangedDelegate = AttributionChangedDelegate;
+
+ // (可选)设置其他配置,如日志级别
+ config.LogLevel = AdjustLogLevel.Verbose;
+
+ // 初始化Adjust SDK
+ Adjust.InitSdk(config);
+ }
+
+ ///
+ /// 归因信息
+ ///
+ ///
+ private void AttributionChangedDelegate(AdjustAttribution attribution)
+ {
+ Debug.Log("Attribution changed");
+ AdjustNetwork.SetNetwork(attribution.Network);
+ }
+
+
+
+}
diff --git a/Assets/Script/SDKManager/AdjustManager/AdjustManager.cs.meta b/Assets/Script/SDKManager/AdjustManager/AdjustManager.cs.meta
new file mode 100644
index 0000000..6e69b71
--- /dev/null
+++ b/Assets/Script/SDKManager/AdjustManager/AdjustManager.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: f925ec84be5d37d4ba2ee62fc7ffb464
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Script/SDKManager/AdjustManager/AdjustNetwork.cs b/Assets/Script/SDKManager/AdjustManager/AdjustNetwork.cs
new file mode 100644
index 0000000..95a6707
--- /dev/null
+++ b/Assets/Script/SDKManager/AdjustManager/AdjustNetwork.cs
@@ -0,0 +1,48 @@
+using UnityEngine;
+
+public static class AdjustNetwork
+{
+ private const string KEY_USER_NETWORK = "KEY_USER_NETWORK";
+
+ public static void SetNetwork(string network)
+ {
+ if (string.IsNullOrEmpty(network))
+ {
+ return;
+ }
+
+ if (network.ToLower().Replace(" ", "") == "Organic".ToLower().Replace(" ", ""))
+ {
+ return;
+ }
+
+ string curNetwork = PlayerPrefs.GetString(KEY_USER_NETWORK, "");
+ if (string.IsNullOrEmpty(curNetwork))
+ {
+ PlayerPrefs.SetString(KEY_USER_NETWORK, network);
+ PlayerPrefs.Save();
+ }
+ }
+
+ ///
+ /// 是否是自然量用户
+ /// 默认买量用户
+ ///
+ ///
+ public static bool InOrganic()
+ {
+ string network = PlayerPrefs.GetString(KEY_USER_NETWORK, "");
+ if (string.IsNullOrEmpty(network))
+ {
+ return true;
+ }
+
+ //去除大小写和空格之后再对比
+ if (network.ToLower().Replace(" ", "") == "Untrusted Devices".ToLower().Replace(" ", "") || network.ToLower().Replace(" ", "") == "Google Organic Search".ToLower().Replace(" ", ""))
+ {
+ return true;
+ }
+
+ return false;
+ }
+}
\ No newline at end of file
diff --git a/Assets/Script/SDKManager/AdjustManager/AdjustNetwork.cs.meta b/Assets/Script/SDKManager/AdjustManager/AdjustNetwork.cs.meta
new file mode 100644
index 0000000..c27c93a
--- /dev/null
+++ b/Assets/Script/SDKManager/AdjustManager/AdjustNetwork.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 9292edbac2294418af38b6f95a185127
+timeCreated: 1756550070
\ No newline at end of file
diff --git a/Assets/rd3/Adjust.meta b/Assets/rd3/Adjust.meta
new file mode 100644
index 0000000..51f40ca
--- /dev/null
+++ b/Assets/rd3/Adjust.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: b7941c48bfc3e44aea0300ced4d12b47
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/rd3/Adjust/Native.meta b/Assets/rd3/Adjust/Native.meta
new file mode 100644
index 0000000..de5dab9
--- /dev/null
+++ b/Assets/rd3/Adjust/Native.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 48d8fb88fe43540d48dd33b18a151507
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/rd3/Adjust/Native/Android.meta b/Assets/rd3/Adjust/Native/Android.meta
new file mode 100644
index 0000000..bc71354
--- /dev/null
+++ b/Assets/rd3/Adjust/Native/Android.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 99903aebed26d46a2aa9f9aa2b17a339
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/rd3/Adjust/Native/Android/AdjustAndroidManifest.xml b/Assets/rd3/Adjust/Native/Android/AdjustAndroidManifest.xml
new file mode 100644
index 0000000..d0471ae
--- /dev/null
+++ b/Assets/rd3/Adjust/Native/Android/AdjustAndroidManifest.xml
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Assets/rd3/Adjust/Native/Android/AdjustAndroidManifest.xml.meta b/Assets/rd3/Adjust/Native/Android/AdjustAndroidManifest.xml.meta
new file mode 100644
index 0000000..58af3b4
--- /dev/null
+++ b/Assets/rd3/Adjust/Native/Android/AdjustAndroidManifest.xml.meta
@@ -0,0 +1,4 @@
+fileFormatVersion: 2
+guid: a13ef442648c346a79f9ff24875c037a
+TextScriptImporter:
+ userData:
diff --git a/Assets/rd3/Adjust/Native/Editor.meta b/Assets/rd3/Adjust/Native/Editor.meta
new file mode 100644
index 0000000..c29b1d4
--- /dev/null
+++ b/Assets/rd3/Adjust/Native/Editor.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: c11a8a7fc7bfd4937bac95b31f1fb273
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/rd3/Adjust/Native/Editor/Dependencies.xml b/Assets/rd3/Adjust/Native/Editor/Dependencies.xml
new file mode 100644
index 0000000..941e5b9
--- /dev/null
+++ b/Assets/rd3/Adjust/Native/Editor/Dependencies.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Assets/rd3/Adjust/Native/Editor/Dependencies.xml.meta b/Assets/rd3/Adjust/Native/Editor/Dependencies.xml.meta
new file mode 100644
index 0000000..1574ab1
--- /dev/null
+++ b/Assets/rd3/Adjust/Native/Editor/Dependencies.xml.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: d4241857b233d46ee874c8f80bb65fdb
+TextScriptImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/rd3/Adjust/Native/iOS.meta b/Assets/rd3/Adjust/Native/iOS.meta
new file mode 100644
index 0000000..9d5773a
--- /dev/null
+++ b/Assets/rd3/Adjust/Native/iOS.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: c8400ff077d6c4583b0f85a46cd1d50b
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/rd3/Adjust/Native/iOS/AdjustUnity.h b/Assets/rd3/Adjust/Native/iOS/AdjustUnity.h
new file mode 100644
index 0000000..d845be0
--- /dev/null
+++ b/Assets/rd3/Adjust/Native/iOS/AdjustUnity.h
@@ -0,0 +1,37 @@
+//
+// AdjustUnity.h
+// Adjust SDK
+//
+// Created by Pedro Silva (@nonelse) on 27th March 2014.
+// Copyright © 2012-2018 Adjust GmbH. All rights reserved.
+//
+
+/**
+ * @brief The main interface to Adjust Unity bridge.
+ */
+@interface AdjustUnity : NSObject
+
+// app callbacks as method parameters
+typedef void (*AdjustDelegateIsEnabledGetter)(bool isEnabled);
+typedef void (*AdjustDelegateAttributionGetter)(const char* attribution);
+typedef void (*AdjustDelegateAdidGetter)(const char* adid);
+typedef void (*AdjustDelegateIdfaGetter)(const char* idfa);
+typedef void (*AdjustDelegateIdfvGetter)(const char* idfv);
+typedef void (*AdjustDelegateLastDeeplinkGetter)(const char* lastDeeplink);
+typedef void (*AdjustDelegateSdkVersionGetter)(const char* sdkVersion);
+typedef void (*AdjustDelegateAttCallback)(int status);
+typedef void (*AdjustDelegatePurchaseVerificationCallback)(const char* verificationResult, int callbackId);
+typedef void (*AdjustDelegateVerifyAndTrackCallback)(const char* verificationResult, int callbackId);
+typedef void (*AdjustDelegateResolvedDeeplinkCallback)(const char* deeplink);
+typedef void (*AdjustDelegateSkanErrorCallback)(const char* error);
+
+// app callbacks as subscriptions
+typedef void (*AdjustDelegateAttributionCallback)(const char* attribution);
+typedef void (*AdjustDelegateSessionSuccessCallback)(const char* sessionSuccess);
+typedef void (*AdjustDelegateSessionFailureCallback)(const char* sessionFailure);
+typedef void (*AdjustDelegateEventSuccessCallback)(const char* eventSuccess);
+typedef void (*AdjustDelegateEventFailureCallback)(const char* eventFailure);
+typedef void (*AdjustDelegateDeferredDeeplinkCallback)(const char* deeplink);
+typedef void (*AdjustDelegateSkanUpdatedCallback)(const char* skanData);
+
+@end
diff --git a/Assets/rd3/Adjust/Native/iOS/AdjustUnity.h.meta b/Assets/rd3/Adjust/Native/iOS/AdjustUnity.h.meta
new file mode 100644
index 0000000..0d8a566
--- /dev/null
+++ b/Assets/rd3/Adjust/Native/iOS/AdjustUnity.h.meta
@@ -0,0 +1,110 @@
+fileFormatVersion: 2
+guid: 9ffff8839c6ab418b983add4c597fb87
+PluginImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ iconMap: {}
+ executionOrder: {}
+ isPreloaded: 0
+ isOverridable: 0
+ platformData:
+ - first:
+ '': Any
+ second:
+ enabled: 0
+ settings:
+ Exclude Android: 1
+ Exclude Editor: 1
+ Exclude Linux: 1
+ Exclude Linux64: 1
+ Exclude LinuxUniversal: 1
+ Exclude OSXUniversal: 1
+ Exclude WebGL: 1
+ Exclude Win: 1
+ Exclude Win64: 1
+ Exclude iOS: 0
+ Exclude tvOS: 1
+ - first:
+ Android: Android
+ second:
+ enabled: 0
+ settings:
+ CPU: ARMv7
+ - first:
+ Any:
+ second:
+ enabled: 0
+ settings: {}
+ - first:
+ Editor: Editor
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ DefaultValueInitialized: true
+ OS: AnyOS
+ - first:
+ Facebook: Win
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Facebook: Win64
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: Linux
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: Linux64
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: LinuxUniversal
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: OSXUniversal
+ second:
+ enabled: 0
+ settings:
+ CPU: x86
+ - first:
+ Standalone: Win
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: Win64
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ iPhone: iOS
+ second:
+ enabled: 1
+ settings:
+ CompileFlags:
+ FrameworkDependencies:
+ - first:
+ tvOS: tvOS
+ second:
+ enabled: 0
+ settings:
+ CompileFlags:
+ FrameworkDependencies:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/rd3/Adjust/Native/iOS/AdjustUnity.mm b/Assets/rd3/Adjust/Native/iOS/AdjustUnity.mm
new file mode 100644
index 0000000..841327a
--- /dev/null
+++ b/Assets/rd3/Adjust/Native/iOS/AdjustUnity.mm
@@ -0,0 +1,929 @@
+//
+// AdjustUnity.mm
+// Adjust SDK
+//
+// Created by Pedro Silva (@nonelse) on 27th March 2014.
+// Copyright © 2012-2018 Adjust GmbH. All rights reserved.
+//
+
+#import
+#import "AdjustUnity.h"
+#import "AdjustUnityDelegate.h"
+#import "AdjustUnityAppDelegate.h"
+
+@implementation AdjustUnity
+
+#pragma mark - Object lifecycle methods
+
++ (void)load {
+ // swizzle AppDelegate on the load
+ // it should be done as early as possible
+ [AdjustUnityAppDelegate swizzleAppDelegateCallbacks];
+}
+
+@end
+
+#pragma mark - Helper C methods
+
+// method for converting JSON stirng parameters into NSArray object
+NSArray* convertArrayParameters(const char* cStringJsonArrayParameters) {
+ if (cStringJsonArrayParameters == NULL) {
+ return nil;
+ }
+
+ NSError *error = nil;
+ NSArray *arrayParameters = nil;
+ NSString *stringJsonArrayParameters = [NSString stringWithUTF8String:cStringJsonArrayParameters];
+
+ if (stringJsonArrayParameters != nil) {
+ NSData *dataJson = [stringJsonArrayParameters dataUsingEncoding:NSUTF8StringEncoding];
+ arrayParameters = [NSJSONSerialization JSONObjectWithData:dataJson options:0 error:&error];
+ }
+ if (error != nil) {
+ NSString *errorMessage = @"Failed to parse json parameters!";
+ NSLog(@"%@", errorMessage);
+ }
+
+ return arrayParameters;
+}
+
+BOOL isStringValid(const char* cString) {
+ if (cString == NULL) {
+ return false;
+ }
+
+ NSString *objcString = [NSString stringWithUTF8String:cString];
+ if (objcString == nil) {
+ return false;
+ }
+ if ([objcString isEqualToString:@"ADJ_INVALID"]) {
+ return false;
+ }
+
+ return true;
+}
+
+void addValueOrEmpty(NSMutableDictionary *dictionary, NSString *key, NSObject *value) {
+ if (nil != value) {
+ if ([value isKindOfClass:[NSString class]]) {
+ [dictionary setObject:[NSString stringWithFormat:@"%@", value] forKey:key];
+ } else if ([value isKindOfClass:[NSNumber class]]) {
+ [dictionary setObject:[NSString stringWithFormat:@"%@", [((NSNumber *)value) stringValue]] forKey:key];
+ } else {
+ [dictionary setObject:@"" forKey:key];
+ }
+ } else {
+ [dictionary setObject:@"" forKey:key];
+ }
+}
+
+#pragma mark - Publicly available C methods
+
+extern "C"
+{
+ void _AdjustInitSdk(
+ const char* appToken,
+ const char* environment,
+ const char* sdkPrefix,
+ const char* defaultTracker,
+ const char* externalDeviceId,
+ const char* jsonUrlStrategyDomains,
+ const char* storeName,
+ const char* storeAppId,
+ int allowSuppressLogLevel,
+ int logLevel,
+ int attConsentWaitingInterval,
+ int eventDeduplicationIdsMaxSize,
+ int shouldUseSubdomains,
+ int isCoppaComplianceEnabled,
+ int isDataResidency,
+ int isSendingInBackgroundEnabled,
+ int isAdServicesEnabled,
+ int isIdfaReadingEnabled,
+ int isIdfvReadingEnabled,
+ int isSkanAttributionEnabled,
+ int isLinkMeEnabled,
+ int isCostDataInAttributionEnabled,
+ int isDeviceIdsReadingOnceEnabled,
+ int isAppTrackingTransparencyUsageEnabled,
+ int isFirstSessionDelayEnabled,
+ int isDeferredDeeplinkOpeningEnabled,
+ AdjustDelegateAttributionCallback attributionCallback,
+ AdjustDelegateEventSuccessCallback eventSuccessCallback,
+ AdjustDelegateEventFailureCallback eventFailureCallback,
+ AdjustDelegateSessionSuccessCallback sessionSuccessCallback,
+ AdjustDelegateSessionFailureCallback sessionFailureCallback,
+ AdjustDelegateDeferredDeeplinkCallback deferredDeeplinkCallback,
+ AdjustDelegateSkanUpdatedCallback skanUpdatedCallback) {
+ NSString *strAppToken = isStringValid(appToken) == true ? [NSString stringWithUTF8String:appToken] : nil;
+ NSString *strEnvironment = isStringValid(environment) == true ? [NSString stringWithUTF8String:environment] : nil;
+ NSString *strSdkPrefix = isStringValid(sdkPrefix) == true ? [NSString stringWithUTF8String:sdkPrefix] : nil;
+ NSString *strDefaultTracker = isStringValid(defaultTracker) == true ? [NSString stringWithUTF8String:defaultTracker] : nil;
+ NSString *strExternalDeviceId = isStringValid(externalDeviceId) == true ? [NSString stringWithUTF8String:externalDeviceId] : nil;
+ NSString *strStoreName = isStringValid(storeName) == true ? [NSString stringWithUTF8String:storeName] : nil;
+ NSString *strStoreAppId = isStringValid(storeAppId) == true ? [NSString stringWithUTF8String:storeAppId] : nil;
+
+ ADJConfig *adjustConfig;
+
+ if (allowSuppressLogLevel != -1) {
+ adjustConfig = [[ADJConfig alloc] initWithAppToken:strAppToken
+ environment:strEnvironment
+ suppressLogLevel:(BOOL)allowSuppressLogLevel];
+ } else {
+ adjustConfig = [[ADJConfig alloc] initWithAppToken:strAppToken
+ environment:strEnvironment];
+ }
+
+ // set SDK prefix
+ [adjustConfig setSdkPrefix:strSdkPrefix];
+
+ // check if user has selected to implement any of the callbacks
+ if (attributionCallback != nil ||
+ sessionSuccessCallback != nil ||
+ sessionFailureCallback != nil ||
+ eventSuccessCallback != nil ||
+ eventFailureCallback != nil ||
+ deferredDeeplinkCallback != nil ||
+ skanUpdatedCallback != nil) {
+ [adjustConfig setDelegate:
+ [AdjustUnityDelegate getInstanceWithAttributionCallback:attributionCallback
+ eventSuccessCallback:eventSuccessCallback
+ eventFailureCallback:eventFailureCallback
+ sessionSuccessCallback:sessionSuccessCallback
+ sessionFailureCallback:sessionFailureCallback
+ deferredDeeplinkCallback:deferredDeeplinkCallback
+ skanUpdatedCallback:skanUpdatedCallback
+ shouldLaunchDeferredDeeplink:isDeferredDeeplinkOpeningEnabled]];
+ }
+
+ // log level
+ if (logLevel != -1) {
+ [adjustConfig setLogLevel:(ADJLogLevel)logLevel];
+ }
+
+ // COPPA compliance.
+ if (isCoppaComplianceEnabled != -1) {
+ if ((BOOL)isCoppaComplianceEnabled == YES) {
+ [adjustConfig enableCoppaCompliance];
+ }
+ }
+
+ // Send in background.
+ if (isSendingInBackgroundEnabled != -1) {
+ if ((BOOL)isSendingInBackgroundEnabled == YES) {
+ [adjustConfig enableSendingInBackground];
+ }
+ }
+
+ // AdServices.framework handling
+ if (isAdServicesEnabled != -1) {
+ if ((BOOL)isAdServicesEnabled == NO) {
+ [adjustConfig disableAdServices];
+ }
+ }
+
+ // SKAN attribution
+ if (isSkanAttributionEnabled != -1) {
+ if ((BOOL)isSkanAttributionEnabled == NO) {
+ [adjustConfig disableSkanAttribution];
+ }
+ }
+
+ // IDFA reading
+ if (isIdfaReadingEnabled != -1) {
+ if ((BOOL)isIdfaReadingEnabled == NO) {
+ [adjustConfig disableIdfaReading];
+ }
+ }
+
+ // IDFV reading
+ if (isIdfvReadingEnabled != -1) {
+ if ((BOOL)isIdfvReadingEnabled == NO) {
+ [adjustConfig disableIdfvReading];
+ }
+ }
+
+ // LinkMe
+ if (isLinkMeEnabled != -1) {
+ if ((BOOL)isLinkMeEnabled == YES) {
+ [adjustConfig enableLinkMe];
+ }
+ }
+
+ // ATT dialog delay
+ if (attConsentWaitingInterval != -1) {
+ [adjustConfig setAttConsentWaitingInterval:attConsentWaitingInterval];
+ }
+
+ // disable AppTrackingTransparency.framework interaction
+ if (isAppTrackingTransparencyUsageEnabled != -1) {
+ if ((BOOL)isAppTrackingTransparencyUsageEnabled == NO) {
+ [adjustConfig disableAppTrackingTransparencyUsage];
+ }
+ }
+
+ // first session delay
+ if (isFirstSessionDelayEnabled != -1) {
+ if ((BOOL)isFirstSessionDelayEnabled == YES) {
+ [adjustConfig enableFirstSessionDelay];
+ }
+ }
+
+ // deduplication IDs max number
+ if (eventDeduplicationIdsMaxSize != -1) {
+ [adjustConfig setEventDeduplicationIdsMaxSize:eventDeduplicationIdsMaxSize];
+ }
+
+ // cost data in attribution callback
+ if (isCostDataInAttributionEnabled != -1) {
+ if ((BOOL)isCostDataInAttributionEnabled == YES) {
+ [adjustConfig enableCostDataInAttribution];
+ }
+ }
+
+ // read device info only once
+ if (isDeviceIdsReadingOnceEnabled != -1) {
+ if ((BOOL)isDeviceIdsReadingOnceEnabled == YES) {
+ [adjustConfig enableDeviceIdsReadingOnce];
+ }
+ }
+
+ // default tracker
+ if (strDefaultTracker != nil) {
+ [adjustConfig setDefaultTracker:strDefaultTracker];
+ }
+
+ // external device identifier
+ if (strExternalDeviceId != nil) {
+ [adjustConfig setExternalDeviceId:strExternalDeviceId];
+ }
+
+ // URL strategy
+ if (shouldUseSubdomains != -1 && isDataResidency != -1) {
+ NSArray *urlStrategyDomains = convertArrayParameters(jsonUrlStrategyDomains);
+ if (urlStrategyDomains != nil) {
+ [adjustConfig setUrlStrategy:urlStrategyDomains
+ useSubdomains:(BOOL)shouldUseSubdomains
+ isDataResidency:(BOOL)isDataResidency];
+ }
+ }
+
+ // custom store
+ if (strStoreName != nil) {
+ ADJStoreInfo *storeInfo = [[ADJStoreInfo alloc] initWithStoreName:strStoreName];
+ if (strStoreAppId != nil) {
+ [storeInfo setStoreAppId:strStoreAppId];
+ }
+ [adjustConfig setStoreInfo:storeInfo];
+ }
+
+ // initialize the SDK
+ [Adjust initSdk:adjustConfig];
+ }
+
+ void _AdjustTrackEvent(const char* eventToken,
+ double revenue,
+ const char* currency,
+ const char* productId,
+ const char* transactionId,
+ const char* callbackId,
+ const char* deduplicationId,
+ const char* jsonCallbackParameters,
+ const char* jsonPartnerParameters) {
+ NSString *strEventToken = isStringValid(eventToken) == true ? [NSString stringWithUTF8String:eventToken] : nil;
+ ADJEvent *event = [[ADJEvent alloc] initWithEventToken:strEventToken];
+
+ // revenue and currency
+ if (revenue != -1 && currency != NULL) {
+ NSString *stringCurrency = [NSString stringWithUTF8String:currency];
+ [event setRevenue:revenue currency:stringCurrency];
+ }
+
+ // callback parameters
+ NSArray *arrayCallbackParameters = convertArrayParameters(jsonCallbackParameters);
+ if (arrayCallbackParameters != nil) {
+ NSUInteger count = [arrayCallbackParameters count];
+ for (int i = 0; i < count;) {
+ NSString *key = arrayCallbackParameters[i++];
+ NSString *value = arrayCallbackParameters[i++];
+ [event addCallbackParameter:key value:value];
+ }
+ }
+
+ // partner parameters
+ NSArray *arrayPartnerParameters = convertArrayParameters(jsonPartnerParameters);
+ if (arrayPartnerParameters != nil) {
+ NSUInteger count = [arrayPartnerParameters count];
+ for (int i = 0; i < count;) {
+ NSString *key = arrayPartnerParameters[i++];
+ NSString *value = arrayPartnerParameters[i++];
+ [event addPartnerParameter:key value:value];
+ }
+ }
+
+ // transaction ID
+ if (transactionId != NULL) {
+ NSString *strTransactionId = [NSString stringWithUTF8String:transactionId];
+ [event setTransactionId:strTransactionId];
+ }
+
+ // product ID
+ if (productId != NULL) {
+ NSString *strProductId = [NSString stringWithUTF8String:productId];
+ [event setProductId:strProductId];
+ }
+
+ // callback ID
+ if (callbackId != NULL) {
+ NSString *strCallbackId = [NSString stringWithUTF8String:callbackId];
+ [event setCallbackId:strCallbackId];
+ }
+
+ // deduplication ID
+ if (deduplicationId != NULL) {
+ NSString *strDeduplicationId = [NSString stringWithUTF8String:deduplicationId];
+ [event setDeduplicationId:strDeduplicationId];
+ }
+
+ // track event
+ [Adjust trackEvent:event];
+ }
+
+ void _AdjustTrackSubsessionStart() {
+ [Adjust trackSubsessionStart];
+ }
+
+ void _AdjustTrackSubsessionEnd() {
+ [Adjust trackSubsessionEnd];
+ }
+
+ void _AdjustEnable() {
+ [Adjust enable];
+ }
+
+ void _AdjustDisable() {
+ [Adjust disable];
+ }
+
+ void _AdjustSwitchToOfflineMode() {
+ [Adjust switchToOfflineMode];
+ }
+
+ void _AdjustSwitchBackToOnlineMode() {
+ [Adjust switchBackToOnlineMode];
+ }
+
+ void _AdjustSetPushToken(const char* pushToken) {
+ if (pushToken != NULL) {
+ NSString *strPushToken = [NSString stringWithUTF8String:pushToken];
+ [Adjust setPushTokenAsString:strPushToken];
+ }
+ }
+
+ void _AdjustProcessDeeplink(const char* deeplink, const char* referrer) {
+ if (deeplink != NULL) {
+ NSString *strDeeplink = [NSString stringWithUTF8String:deeplink];
+ NSURL *urlDeeplink = [NSURL URLWithString:strDeeplink];
+ ADJDeeplink *adjustDeeplink = [[ADJDeeplink alloc] initWithDeeplink:urlDeeplink];
+
+ if (referrer != NULL) {
+ NSString *strReferrer = [NSString stringWithUTF8String:referrer];
+ NSURL *urlReferrer = [NSURL URLWithString:strReferrer];
+ [adjustDeeplink setReferrer:urlReferrer];
+ }
+ [Adjust processDeeplink:adjustDeeplink];
+ }
+ }
+
+ void _AdjustIsEnabled(AdjustDelegateIsEnabledGetter callback) {
+ [Adjust isEnabledWithCompletionHandler:^(BOOL isEnabled) {
+ callback(isEnabled);
+ }];
+ }
+
+ void _AdjustGetAttribution(AdjustDelegateAttributionGetter callback) {
+ [Adjust attributionWithCompletionHandler:^(ADJAttribution * _Nullable attribution) {
+ // TODO: nil checks
+ NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
+ addValueOrEmpty(dictionary, @"trackerToken", attribution.trackerToken);
+ addValueOrEmpty(dictionary, @"trackerName", attribution.trackerName);
+ addValueOrEmpty(dictionary, @"network", attribution.network);
+ addValueOrEmpty(dictionary, @"campaign", attribution.campaign);
+ addValueOrEmpty(dictionary, @"creative", attribution.creative);
+ addValueOrEmpty(dictionary, @"adgroup", attribution.adgroup);
+ addValueOrEmpty(dictionary, @"clickLabel", attribution.clickLabel);
+ addValueOrEmpty(dictionary, @"costType", attribution.costType);
+ addValueOrEmpty(dictionary, @"costAmount", attribution.costAmount);
+ addValueOrEmpty(dictionary, @"costCurrency", attribution.costCurrency);
+ if (attribution.jsonResponse != nil) {
+ NSData *jsonData = [NSJSONSerialization dataWithJSONObject:attribution.jsonResponse
+ options:0
+ error:nil];
+ NSString *strJsonResponse = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
+ addValueOrEmpty(dictionary, @"jsonResponse", strJsonResponse);
+ }
+
+ NSData *dataAttribution = [NSJSONSerialization dataWithJSONObject:dictionary
+ options:0
+ error:nil];
+ NSString *stringAttribution = [[NSString alloc] initWithBytes:[dataAttribution bytes]
+ length:[dataAttribution length]
+ encoding:NSUTF8StringEncoding];
+ const char* attributionCString = [stringAttribution UTF8String];
+ callback(attributionCString);
+ }];
+ }
+
+ void _AdjustGetAdid(AdjustDelegateAdidGetter callback) {
+ [Adjust adidWithCompletionHandler:^(NSString * _Nullable adid) {
+ // TODO: nil checks
+ callback([adid UTF8String]);
+ }];
+ }
+
+ void _AdjustGetIdfa(AdjustDelegateIdfaGetter callback) {
+ [Adjust idfaWithCompletionHandler:^(NSString * _Nullable idfa) {
+ // TODO: nil checks
+ callback([idfa UTF8String]);
+ }];
+ }
+
+ void _AdjustGetIdfv(AdjustDelegateIdfvGetter callback) {
+ [Adjust idfvWithCompletionHandler:^(NSString * _Nullable idfv) {
+ // TODO: nil checks
+ callback([idfv UTF8String]);
+ }];
+ }
+
+ void _AdjustGetLastDeeplink(AdjustDelegateLastDeeplinkGetter callback) {
+ [Adjust lastDeeplinkWithCompletionHandler:^(NSURL * _Nullable lastDeeplink) {
+ // TODO: nil checks
+ NSString *strLastDeeplink = [lastDeeplink absoluteString];
+ callback([strLastDeeplink UTF8String]);
+ }];
+ }
+
+ void _AdjustGetSdkVersion(AdjustDelegateSdkVersionGetter callback) {
+ [Adjust sdkVersionWithCompletionHandler:^(NSString * _Nullable sdkVersion) {
+ // TODO: nil checks
+ callback([sdkVersion UTF8String]);
+ }];
+ }
+
+ void _AdjustGdprForgetMe() {
+ [Adjust gdprForgetMe];
+ }
+
+ void _AdjustAddGlobalPartnerParameter(const char* key, const char* value) {
+ if (key != NULL && value != NULL) {
+ NSString *strKey = [NSString stringWithUTF8String:key];
+ NSString *strValue = [NSString stringWithUTF8String:value];
+ [Adjust addGlobalPartnerParameter:strValue forKey:strKey];
+ }
+ }
+
+ void _AdjustAddGlobalCallbackParameter(const char* key, const char* value) {
+ if (key != NULL && value != NULL) {
+ NSString *strKey = [NSString stringWithUTF8String:key];
+ NSString *strValue = [NSString stringWithUTF8String:value];
+ [Adjust addGlobalCallbackParameter:strValue forKey:strKey];
+ }
+ }
+
+ void _AdjustRemoveGlobalPartnerParameter(const char* key) {
+ if (key != NULL) {
+ NSString *strKey = [NSString stringWithUTF8String:key];
+ [Adjust removeGlobalPartnerParameterForKey:strKey];
+ }
+ }
+
+ void _AdjustRemoveGlobalCallbackParameter(const char* key) {
+ if (key != NULL) {
+ NSString *strKey = [NSString stringWithUTF8String:key];
+ [Adjust removeGlobalCallbackParameterForKey:strKey];
+ }
+ }
+
+ void _AdjustRemoveGlobalPartnerParameters() {
+ [Adjust removeGlobalPartnerParameters];
+ }
+
+ void _AdjustRemoveGlobalCallbackParameters() {
+ [Adjust removeGlobalCallbackParameters];
+ }
+
+ void _AdjustTrackAdRevenue(const char* source,
+ double revenue,
+ const char* currency,
+ int adImpressionsCount,
+ const char* adRevenueNetwork,
+ const char* adRevenueUnit,
+ const char* adRevenuePlacement,
+ const char* jsonCallbackParameters,
+ const char* jsonPartnerParameters) {
+ NSString *stringSource = isStringValid(source) == true ? [NSString stringWithUTF8String:source] : nil;
+ ADJAdRevenue *adRevenue = [[ADJAdRevenue alloc] initWithSource:stringSource];
+
+ // revenue and currency
+ if (revenue != -1 && currency != NULL) {
+ NSString *stringCurrency = [NSString stringWithUTF8String:currency];
+ [adRevenue setRevenue:revenue currency:stringCurrency];
+ }
+
+ // ad impressions count
+ if (adImpressionsCount != -1) {
+ [adRevenue setAdImpressionsCount:adImpressionsCount];
+ }
+
+ // ad revenue network
+ if (adRevenueNetwork != NULL) {
+ NSString *stringAdRevenueNetwork = [NSString stringWithUTF8String:adRevenueNetwork];
+ [adRevenue setAdRevenueNetwork:stringAdRevenueNetwork];
+ }
+
+ // ad revenue unit
+ if (adRevenueUnit != NULL) {
+ NSString *stringAdRevenueUnit = [NSString stringWithUTF8String:adRevenueUnit];
+ [adRevenue setAdRevenueUnit:stringAdRevenueUnit];
+ }
+
+ // ad revenue placement
+ if (adRevenuePlacement != NULL) {
+ NSString *stringAdRevenuePlacement = [NSString stringWithUTF8String:adRevenuePlacement];
+ [adRevenue setAdRevenuePlacement:stringAdRevenuePlacement];
+ }
+
+ // callback parameters
+ NSArray *arrayCallbackParameters = convertArrayParameters(jsonCallbackParameters);
+ if (arrayCallbackParameters != nil) {
+ NSUInteger count = [arrayCallbackParameters count];
+ for (int i = 0; i < count;) {
+ NSString *key = arrayCallbackParameters[i++];
+ NSString *value = arrayCallbackParameters[i++];
+ [adRevenue addCallbackParameter:key value:value];
+ }
+ }
+
+ // partner parameters
+ NSArray *arrayPartnerParameters = convertArrayParameters(jsonPartnerParameters);
+ if (arrayPartnerParameters != nil) {
+ NSUInteger count = [arrayPartnerParameters count];
+ for (int i = 0; i < count;) {
+ NSString *key = arrayPartnerParameters[i++];
+ NSString *value = arrayPartnerParameters[i++];
+ [adRevenue addPartnerParameter:key value:value];
+ }
+ }
+
+ // track ad revenue
+ [Adjust trackAdRevenue:adRevenue];
+ }
+
+ // TODO: consider non-string types for some fields?
+ void _AdjustTrackAppStoreSubscription(const char* price,
+ const char* currency,
+ const char* transactionId,
+ const char* transactionDate,
+ const char* salesRegion,
+ const char* jsonCallbackParameters,
+ const char* jsonPartnerParameters) {
+ // mandatory fields
+ NSDecimalNumber *mPrice;
+ NSString *mCurrency;
+ NSString *mTransactionId;
+
+ // price
+ if (price != NULL) {
+ mPrice = [NSDecimalNumber decimalNumberWithString:[NSString stringWithUTF8String:price]];
+ }
+
+ // currency
+ if (currency != NULL) {
+ mCurrency = [NSString stringWithUTF8String:currency];
+ }
+
+ // transaction ID
+ if (transactionId != NULL) {
+ mTransactionId = [NSString stringWithUTF8String:transactionId];
+ }
+
+ ADJAppStoreSubscription *subscription =
+ [[ADJAppStoreSubscription alloc] initWithPrice:mPrice
+ currency:mCurrency
+ transactionId:mTransactionId];
+
+ // optional fields below
+
+ // transaction date
+ if (transactionDate != NULL) {
+ NSTimeInterval transactionDateInterval = [[NSString stringWithUTF8String:transactionDate] doubleValue] / 1000.0;
+ NSDate *oTransactionDate = [NSDate dateWithTimeIntervalSince1970:transactionDateInterval];
+ [subscription setTransactionDate:oTransactionDate];
+ }
+
+ // sales region
+ if (salesRegion != NULL) {
+ NSString *oSalesRegion = [NSString stringWithUTF8String:salesRegion];
+ [subscription setSalesRegion:oSalesRegion];
+ }
+
+ // callback parameters
+ NSArray *arrayCallbackParameters = convertArrayParameters(jsonCallbackParameters);
+ if (arrayCallbackParameters != nil) {
+ NSUInteger count = [arrayCallbackParameters count];
+ for (int i = 0; i < count;) {
+ NSString *key = arrayCallbackParameters[i++];
+ NSString *value = arrayCallbackParameters[i++];
+ [subscription addCallbackParameter:key value:value];
+ }
+ }
+
+ // partner parameters
+ NSArray *arrayPartnerParameters = convertArrayParameters(jsonPartnerParameters);
+ if (arrayPartnerParameters != nil) {
+ NSUInteger count = [arrayPartnerParameters count];
+ for (int i = 0; i < count;) {
+ NSString *key = arrayPartnerParameters[i++];
+ NSString *value = arrayPartnerParameters[i++];
+ [subscription addPartnerParameter:key value:value];
+ }
+ }
+
+ // track subscription
+ [Adjust trackAppStoreSubscription:subscription];
+ }
+
+ void _AdjustTrackThirdPartySharing(int enabled, const char* jsonGranularOptions, const char* jsonPartnerSharingSettings) {
+ NSNumber *nEnabled = enabled >= 0 ? [NSNumber numberWithInt:enabled] : nil;
+ ADJThirdPartySharing *adjustThirdPartySharing = [[ADJThirdPartySharing alloc] initWithIsEnabled:nEnabled];
+
+ NSArray *arrayGranularOptions = convertArrayParameters(jsonGranularOptions);
+ if (arrayGranularOptions != nil) {
+ for (int i = 0; i < [arrayGranularOptions count];) {
+ NSString *partnerName = arrayGranularOptions[i++];
+ NSString *key = arrayGranularOptions[i++];
+ NSString *value = arrayGranularOptions[i++];
+ [adjustThirdPartySharing addGranularOption:partnerName
+ key:key
+ value:value];
+ }
+ }
+
+ NSArray *arrayPartnerSharingSettings = convertArrayParameters(jsonPartnerSharingSettings);
+ if (arrayPartnerSharingSettings != nil) {
+ for (int i = 0; i < [arrayPartnerSharingSettings count];) {
+ NSString *partnerName = arrayPartnerSharingSettings[i++];
+ NSString *key = arrayPartnerSharingSettings[i++];
+ NSString *value = arrayPartnerSharingSettings[i++];
+ [adjustThirdPartySharing addPartnerSharingSetting:partnerName
+ key:key
+ value:[value boolValue]];
+ }
+ }
+
+ [Adjust trackThirdPartySharing:adjustThirdPartySharing];
+ }
+
+ void _AdjustTrackMeasurementConsent(int enabled) {
+ BOOL bEnabled = (BOOL)enabled;
+ [Adjust trackMeasurementConsent:bEnabled];
+ }
+
+ void _AdjustRequestAppTrackingAuthorization(AdjustDelegateAttCallback callback) {
+ [Adjust requestAppTrackingAuthorizationWithCompletionHandler:^(NSUInteger status) {
+ callback((int)status);
+ }];
+ }
+
+ void _AdjustUpdateSkanConversionValue(int conversionValue,
+ const char* coarseValue,
+ int lockWindow,
+ AdjustDelegateSkanErrorCallback callback) {
+ if (coarseValue != NULL) {
+ NSString *strCoarseValue = [NSString stringWithUTF8String:coarseValue];
+ BOOL bLockWindow = (BOOL)lockWindow;
+ [Adjust updateSkanConversionValue:conversionValue
+ coarseValue:strCoarseValue
+ lockWindow:[NSNumber numberWithBool:bLockWindow]
+ withCompletionHandler:^(NSError * _Nullable error) {
+ // TODO: nil checks
+ NSString *errorString = [error localizedDescription];
+ const char* errorChar = [errorString UTF8String];
+ callback(errorChar);
+ }];
+ }
+ }
+
+ int _AdjustGetAppTrackingAuthorizationStatus() {
+ return [Adjust appTrackingAuthorizationStatus];
+ }
+
+ void _AdjustVerifyAppStorePurchase(const char* transactionId,
+ const char* productId,
+ int callbackId,
+ AdjustDelegatePurchaseVerificationCallback callback) {
+ NSString *strTransactionId;
+ NSString *strProductId;
+
+ // transaction ID
+ if (transactionId != NULL) {
+ strTransactionId = [NSString stringWithUTF8String:transactionId];
+ }
+
+ // product ID
+ if (productId != NULL) {
+ strProductId = [NSString stringWithUTF8String:productId];
+ }
+
+ // verify the purchase
+ ADJAppStorePurchase *purchase =
+ [[ADJAppStorePurchase alloc] initWithTransactionId:strTransactionId
+ productId:strProductId];
+
+ [Adjust verifyAppStorePurchase:purchase
+ withCompletionHandler:^(ADJPurchaseVerificationResult * _Nonnull verificationResult) {
+ // TODO: nil checks
+ NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
+ addValueOrEmpty(dictionary, @"verificationStatus", verificationResult.verificationStatus);
+ addValueOrEmpty(dictionary, @"code", [NSString stringWithFormat:@"%d", verificationResult.code]);
+ addValueOrEmpty(dictionary, @"message", verificationResult.message);
+
+ NSData *dataVerificationInfo = [NSJSONSerialization dataWithJSONObject:dictionary
+ options:0
+ error:nil];
+ NSString *strVerificationInfo = [[NSString alloc] initWithBytes:[dataVerificationInfo bytes]
+ length:[dataVerificationInfo length]
+ encoding:NSUTF8StringEncoding];
+ const char* verificationInfoCString = [strVerificationInfo UTF8String];
+ callback(verificationInfoCString, callbackId);
+ }];
+ }
+
+ void _AdjustProcessAndResolveDeeplink(const char* deeplink, AdjustDelegateResolvedDeeplinkCallback callback) {
+ if (deeplink != NULL) {
+ NSString *strDeeplink = [NSString stringWithUTF8String:deeplink];
+ NSURL *urlDeeplink = [NSURL URLWithString:strDeeplink];
+ ADJDeeplink *deeplink = [[ADJDeeplink alloc] initWithDeeplink:urlDeeplink];
+ [Adjust processAndResolveDeeplink:deeplink withCompletionHandler:^(NSString * _Nullable resolvedLink) {
+ // TODO: nil checks
+ const char* resolvedLinkCString = [resolvedLink UTF8String];
+ callback(resolvedLinkCString);
+ }];
+ }
+ }
+
+ void _AdjustVerifyAndTrackAppStorePurchase(
+ const char* eventToken,
+ double revenue,
+ const char* currency,
+ const char* productId,
+ const char* transactionId,
+ const char* callbackId,
+ const char* deduplicationId,
+ const char* jsonCallbackParameters,
+ const char* jsonPartnerParameters,
+ int verificationCallbackId,
+ AdjustDelegateVerifyAndTrackCallback callback) {
+ NSString *strEventToken = isStringValid(eventToken) == true ? [NSString stringWithUTF8String:eventToken] : nil;
+ ADJEvent *event = [[ADJEvent alloc] initWithEventToken:strEventToken];
+
+ // revenue and currency
+ if (revenue != -1 && currency != NULL) {
+ NSString *stringCurrency = [NSString stringWithUTF8String:currency];
+ [event setRevenue:revenue currency:stringCurrency];
+ }
+
+ // callback parameters
+ NSArray *arrayCallbackParameters = convertArrayParameters(jsonCallbackParameters);
+ if (arrayCallbackParameters != nil) {
+ NSUInteger count = [arrayCallbackParameters count];
+ for (int i = 0; i < count;) {
+ NSString *key = arrayCallbackParameters[i++];
+ NSString *value = arrayCallbackParameters[i++];
+ [event addCallbackParameter:key value:value];
+ }
+ }
+
+ // partner parameters
+ NSArray *arrayPartnerParameters = convertArrayParameters(jsonPartnerParameters);
+ if (arrayPartnerParameters != nil) {
+ NSUInteger count = [arrayPartnerParameters count];
+ for (int i = 0; i < count;) {
+ NSString *key = arrayPartnerParameters[i++];
+ NSString *value = arrayPartnerParameters[i++];
+ [event addPartnerParameter:key value:value];
+ }
+ }
+
+ // transaction ID
+ if (transactionId != NULL) {
+ NSString *strTransactionId = [NSString stringWithUTF8String:transactionId];
+ [event setTransactionId:strTransactionId];
+ }
+
+ // product ID
+ if (productId != NULL) {
+ NSString *strProductId = [NSString stringWithUTF8String:productId];
+ [event setProductId:strProductId];
+ }
+
+ // callback ID
+ if (callbackId != NULL) {
+ NSString *strCallbackId = [NSString stringWithUTF8String:callbackId];
+ [event setCallbackId:strCallbackId];
+ }
+
+ // deduplication ID
+ if (deduplicationId != NULL) {
+ NSString *strDeduplicationId = [NSString stringWithUTF8String:deduplicationId];
+ [event setDeduplicationId:strDeduplicationId];
+ }
+
+ [Adjust verifyAndTrackAppStorePurchase:event
+ withCompletionHandler:^(ADJPurchaseVerificationResult * _Nonnull verificationResult) {
+ // TODO: nil checks
+ NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
+ addValueOrEmpty(dictionary, @"verificationStatus", verificationResult.verificationStatus);
+ addValueOrEmpty(dictionary, @"code", [NSString stringWithFormat:@"%d", verificationResult.code]);
+ addValueOrEmpty(dictionary, @"message", verificationResult.message);
+
+ NSData *dataVerificationInfo = [NSJSONSerialization dataWithJSONObject:dictionary
+ options:0
+ error:nil];
+ NSString *strVerificationInfo = [[NSString alloc] initWithBytes:[dataVerificationInfo bytes]
+ length:[dataVerificationInfo length]
+ encoding:NSUTF8StringEncoding];
+ const char* verificationInfoCString = [strVerificationInfo UTF8String];
+ callback(verificationInfoCString, verificationCallbackId);
+ }];
+ }
+
+ void _AdjustEndFirstSessionDelay() {
+ [Adjust endFirstSessionDelay];
+ }
+
+ void _AdjustEnableCoppaComplianceInDelay() {
+ [Adjust enableCoppaComplianceInDelay];
+ }
+
+ void _AdjustDisableCoppaComplianceInDelay() {
+ [Adjust disableCoppaComplianceInDelay];
+ }
+
+ void _AdjustSetExternalDeviceIdInDelay(const char* externalDeviceId) {
+ if (externalDeviceId != NULL) {
+ NSString *strExternalDeviceId = [NSString stringWithUTF8String:externalDeviceId];
+ [Adjust setExternalDeviceIdInDelay:strExternalDeviceId];
+ }
+ }
+
+ void _AdjustSetTestOptions(const char* overwriteUrl,
+ const char* extraPath,
+ long timerIntervalInMilliseconds,
+ long timerStartInMilliseconds,
+ long sessionIntervalInMilliseconds,
+ long subsessionIntervalInMilliseconds,
+ int teardown,
+ int deleteState,
+ int noBackoffWait,
+ int adServicesFrameworkEnabled,
+ int attStatus,
+ const char *idfa) {
+ NSMutableDictionary *testOptions = [NSMutableDictionary dictionary];
+
+ NSString *strOverwriteUrl = isStringValid(overwriteUrl) == true ? [NSString stringWithUTF8String:overwriteUrl] : nil;
+ if (strOverwriteUrl != nil) {
+ testOptions[@"testUrlOverwrite"] = strOverwriteUrl;
+ }
+ NSString *strExtraPath = isStringValid(extraPath) == true ? [NSString stringWithUTF8String:extraPath] : nil;
+ if (strExtraPath != nil && [strExtraPath length] > 0) {
+ testOptions[@"extraPath"] = strExtraPath;
+ }
+ NSString *strIdfa = isStringValid(idfa) == true ? [NSString stringWithUTF8String:idfa] : nil;
+ if (strIdfa != nil && [strIdfa length] > 0) {
+ testOptions[@"idfa"] = strIdfa;
+ }
+
+ testOptions[@"timerIntervalInMilliseconds"] = [NSNumber numberWithLong:timerIntervalInMilliseconds];
+ testOptions[@"timerStartInMilliseconds"] = [NSNumber numberWithLong:timerStartInMilliseconds];
+ testOptions[@"sessionIntervalInMilliseconds"] = [NSNumber numberWithLong:sessionIntervalInMilliseconds];
+ testOptions[@"subsessionIntervalInMilliseconds"] = [NSNumber numberWithLong:subsessionIntervalInMilliseconds];
+ testOptions[@"attStatusInt"] = [NSNumber numberWithInt:attStatus];
+
+ if (teardown != -1) {
+ [AdjustUnityDelegate teardown];
+ testOptions[@"teardown"] = [NSNumber numberWithInt:teardown];
+ }
+ if (deleteState != -1) {
+ testOptions[@"deleteState"] = [NSNumber numberWithInt:deleteState];
+ }
+ if (noBackoffWait != -1) {
+ testOptions[@"noBackoffWait"] = [NSNumber numberWithInt:noBackoffWait];
+ }
+ if (adServicesFrameworkEnabled != -1) {
+ testOptions[@"adServicesFrameworkEnabled"] = [NSNumber numberWithInt:adServicesFrameworkEnabled];
+ }
+
+ [Adjust setTestOptions:testOptions];
+ }
+}
diff --git a/Assets/rd3/Adjust/Native/iOS/AdjustUnity.mm.meta b/Assets/rd3/Adjust/Native/iOS/AdjustUnity.mm.meta
new file mode 100644
index 0000000..4651ffe
--- /dev/null
+++ b/Assets/rd3/Adjust/Native/iOS/AdjustUnity.mm.meta
@@ -0,0 +1,131 @@
+fileFormatVersion: 2
+guid: 3e17e20d987e4449489d9e3accbd8602
+PluginImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ iconMap: {}
+ executionOrder: {}
+ isPreloaded: 0
+ isOverridable: 0
+ platformData:
+ - first:
+ '': Any
+ second:
+ enabled: 0
+ settings:
+ Exclude Android: 1
+ Exclude Editor: 1
+ Exclude Linux: 1
+ Exclude Linux64: 1
+ Exclude LinuxUniversal: 1
+ Exclude OSXIntel: 1
+ Exclude OSXIntel64: 1
+ Exclude OSXUniversal: 1
+ Exclude WebGL: 1
+ Exclude Win: 1
+ Exclude Win64: 1
+ Exclude iOS: 0
+ Exclude tvOS: 1
+ - first:
+ '': Editor
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ OS: AnyOS
+ - first:
+ Android: Android
+ second:
+ enabled: 0
+ settings:
+ CPU: ARMv7
+ - first:
+ Any:
+ second:
+ enabled: 0
+ settings: {}
+ - first:
+ Editor: Editor
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ DefaultValueInitialized: true
+ OS: AnyOS
+ - first:
+ Facebook: Win
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Facebook: Win64
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: Linux
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: Linux64
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: LinuxUniversal
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: OSXIntel
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ - first:
+ Standalone: OSXIntel64
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ - first:
+ Standalone: OSXUniversal
+ second:
+ enabled: 0
+ settings:
+ CPU: x86
+ - first:
+ Standalone: Win
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: Win64
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ iPhone: iOS
+ second:
+ enabled: 1
+ settings:
+ CompileFlags:
+ FrameworkDependencies:
+ - first:
+ tvOS: tvOS
+ second:
+ enabled: 0
+ settings:
+ CompileFlags:
+ FrameworkDependencies:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/rd3/Adjust/Native/iOS/AdjustUnityAppDelegate.h b/Assets/rd3/Adjust/Native/iOS/AdjustUnityAppDelegate.h
new file mode 100644
index 0000000..25d1c2a
--- /dev/null
+++ b/Assets/rd3/Adjust/Native/iOS/AdjustUnityAppDelegate.h
@@ -0,0 +1,18 @@
+//
+// AdjustUnityAppDelegate.h
+// Adjust SDK
+//
+// Copyright © 2012-2021 Adjust GmbH. All rights reserved.
+//
+
+/**
+ * @brief The interface to Adjust App Delegate. Used to do callback methods swizzling for deep linking.
+ */
+@interface AdjustUnityAppDelegate : NSObject
+
+/**
+ * @brief Swizzle AppDelegate deep linking callbacks.
+ */
++ (void)swizzleAppDelegateCallbacks;
+
+@end
diff --git a/Assets/rd3/Adjust/Native/iOS/AdjustUnityAppDelegate.h.meta b/Assets/rd3/Adjust/Native/iOS/AdjustUnityAppDelegate.h.meta
new file mode 100644
index 0000000..e1c7c3c
--- /dev/null
+++ b/Assets/rd3/Adjust/Native/iOS/AdjustUnityAppDelegate.h.meta
@@ -0,0 +1,115 @@
+fileFormatVersion: 2
+guid: ac4b0b80967dd499b94e6bd430ac6662
+PluginImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ iconMap: {}
+ executionOrder: {}
+ isPreloaded: 0
+ isOverridable: 0
+ platformData:
+ - first:
+ '': Any
+ second:
+ enabled: 0
+ settings:
+ Exclude Android: 1
+ Exclude Editor: 1
+ Exclude Linux: 1
+ Exclude Linux64: 1
+ Exclude LinuxUniversal: 1
+ Exclude OSXUniversal: 1
+ Exclude WebGL: 1
+ Exclude Win: 1
+ Exclude Win64: 1
+ Exclude iOS: 0
+ Exclude tvOS: 1
+ - first:
+ Android: Android
+ second:
+ enabled: 0
+ settings:
+ CPU: ARMv7
+ - first:
+ Any:
+ second:
+ enabled: 0
+ settings: {}
+ - first:
+ Editor: Editor
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ DefaultValueInitialized: true
+ OS: AnyOS
+ - first:
+ Facebook: Win
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Facebook: Win64
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: Linux
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: Linux64
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: LinuxUniversal
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: OSXUniversal
+ second:
+ enabled: 0
+ settings:
+ CPU: x86
+ - first:
+ Standalone: Win
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: Win64
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ WebGL: WebGL
+ second:
+ enabled: 0
+ settings: {}
+ - first:
+ iPhone: iOS
+ second:
+ enabled: 1
+ settings:
+ CompileFlags:
+ FrameworkDependencies:
+ - first:
+ tvOS: tvOS
+ second:
+ enabled: 0
+ settings:
+ CompileFlags:
+ FrameworkDependencies:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/rd3/Adjust/Native/iOS/AdjustUnityAppDelegate.m b/Assets/rd3/Adjust/Native/iOS/AdjustUnityAppDelegate.m
new file mode 100644
index 0000000..7ed977b
--- /dev/null
+++ b/Assets/rd3/Adjust/Native/iOS/AdjustUnityAppDelegate.m
@@ -0,0 +1,75 @@
+//
+// AdjustUnityAppDelegate.mm
+// Adjust SDK
+//
+// Copyright © 2012-2021 Adjust GmbH. All rights reserved.
+//
+
+#import
+#import
+#import "AdjustUnityAppDelegate.h"
+
+typedef BOOL (*openURL_t)(id, SEL, UIApplication *, NSURL *, NSDictionary *);
+typedef BOOL (*continueUserActivity_t)(id, SEL, UIApplication *, NSUserActivity *, void (^)(NSArray *restorableObjects));
+static openURL_t original_openURL = NULL;
+static continueUserActivity_t original_continueUserActivity = NULL;
+
+@implementation AdjustUnityAppDelegate
+
++ (void)swizzleAppDelegateCallbacks {
+ NSLog(@"[Adjust] Swizzling AppDelegate callbacks...");
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ original_openURL = (openURL_t)[self swizzleOriginalSelector:@selector(application:openURL:options:)
+ withSelector:@selector(adjust_application:openURL:options:)];
+ original_continueUserActivity = (continueUserActivity_t)[self swizzleOriginalSelector:@selector(application:continueUserActivity:restorationHandler:)
+ withSelector:@selector(adjust_application:continueUserActivity:restorationHandler:)];
+ });
+}
+
++ (IMP)swizzleOriginalSelector:(SEL)originalSelector
+ withSelector:(SEL)swizzledSelector {
+ // The Unity base app controller class name.
+ extern const char* AppControllerClassName;
+ Class originalClass = NSClassFromString([NSString stringWithUTF8String:AppControllerClassName]);
+ Class swizzledClass = [self class];
+ IMP originalImp = NULL;
+ IMP swizzledImp = class_getMethodImplementation(swizzledClass, swizzledSelector);
+
+ // Replace original implementation by the custom one.
+ Method originalMethod = class_getInstanceMethod(originalClass, originalSelector);
+ if (originalMethod) {
+ originalImp = method_setImplementation(originalMethod, swizzledImp);
+ } else if (![originalClass instancesRespondToSelector:originalSelector]) {
+ // Add the method to the original class if it doesn't implement the selector.
+ Method swizzledMethod = class_getInstanceMethod(swizzledClass, swizzledSelector);
+ BOOL methodAdded = class_addMethod(originalClass, originalSelector, swizzledImp, method_getTypeEncoding(swizzledMethod));
+ if (!methodAdded) {
+ NSLog(@"[Adjust] Cannot swizzle selector '%@' of class '%@'.", NSStringFromSelector(originalSelector), originalClass);
+ return NULL;
+ }
+ }
+ NSLog(@"[Adjust] Selector '%@' of class '%@' is swizzled.", NSStringFromSelector(originalSelector), originalClass);
+ return originalImp;
+}
+
+- (BOOL)adjust_application:(UIApplication *)application
+ openURL:(NSURL *)url
+ options:(NSDictionary *)options {
+ ADJDeeplink *deeplink = [[ADJDeeplink alloc] initWithDeeplink:url];
+ [Adjust processDeeplink:deeplink];
+ return original_openURL ? original_openURL(self, _cmd, application, url, options) : YES;
+}
+
+- (BOOL)adjust_application:(UIApplication *)application
+ continueUserActivity:(NSUserActivity *)userActivity
+ restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler {
+ if ([[userActivity activityType] isEqualToString:NSUserActivityTypeBrowsingWeb]) {
+ NSURL *url = [userActivity webpageURL];
+ ADJDeeplink *deeplink = [[ADJDeeplink alloc] initWithDeeplink:url];
+ [Adjust processDeeplink:deeplink];
+ }
+ return original_continueUserActivity ? original_continueUserActivity(self, _cmd, application, userActivity, restorationHandler) : YES;
+}
+
+@end
diff --git a/Assets/rd3/Adjust/Native/iOS/AdjustUnityAppDelegate.m.meta b/Assets/rd3/Adjust/Native/iOS/AdjustUnityAppDelegate.m.meta
new file mode 100644
index 0000000..a15a43e
--- /dev/null
+++ b/Assets/rd3/Adjust/Native/iOS/AdjustUnityAppDelegate.m.meta
@@ -0,0 +1,98 @@
+fileFormatVersion: 2
+guid: ea1bc374f78b747f8a81fcc82cd77d96
+PluginImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ iconMap: {}
+ executionOrder: {}
+ isPreloaded: 0
+ isOverridable: 0
+ platformData:
+ - first:
+ '': Any
+ second:
+ enabled: 0
+ settings:
+ Exclude Android: 1
+ Exclude Editor: 1
+ Exclude Linux: 1
+ Exclude Linux64: 1
+ Exclude LinuxUniversal: 1
+ Exclude OSXUniversal: 1
+ Exclude WebGL: 1
+ Exclude Win: 1
+ Exclude Win64: 1
+ Exclude iOS: 0
+ Exclude tvOS: 1
+ - first:
+ Any:
+ second:
+ enabled: 0
+ settings: {}
+ - first:
+ Editor: Editor
+ second:
+ enabled: 0
+ settings:
+ DefaultValueInitialized: true
+ - first:
+ Facebook: Win
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Facebook: Win64
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: Linux
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: Linux64
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: LinuxUniversal
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: OSXUniversal
+ second:
+ enabled: 0
+ settings:
+ CPU: x86
+ - first:
+ Standalone: Win
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: Win64
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ iPhone: iOS
+ second:
+ enabled: 1
+ settings: {}
+ - first:
+ tvOS: tvOS
+ second:
+ enabled: 0
+ settings: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/rd3/Adjust/Native/iOS/AdjustUnityDelegate.h b/Assets/rd3/Adjust/Native/iOS/AdjustUnityDelegate.h
new file mode 100644
index 0000000..7d3a861
--- /dev/null
+++ b/Assets/rd3/Adjust/Native/iOS/AdjustUnityDelegate.h
@@ -0,0 +1,60 @@
+//
+// AdjustUnityDelegate.h
+// Adjust SDK
+//
+// Created by Uglješa Erceg (@uerceg) on 5th December 2016.
+// Copyright © 2012-Present Adjust GmbH. All rights reserved.
+//
+
+#import
+#import "AdjustUnity.h"
+
+/**
+ * @brief The main interface to Adjust Unity delegate. Used to do callback methods swizzling where needed.
+ */
+@interface AdjustUnityDelegate : NSObject
+
+/**
+ * @brief Boolean indicating whether deferred deep link should be launched by SDK or not.
+ */
+@property (nonatomic) BOOL shouldLaunchDeferredDeeplink;
+
+@property (nonatomic) AdjustDelegateAttributionCallback attributionCallback;
+@property (nonatomic) AdjustDelegateEventSuccessCallback eventSuccessCallback;
+@property (nonatomic) AdjustDelegateEventFailureCallback eventFailureCallback;
+@property (nonatomic) AdjustDelegateSessionSuccessCallback sessionSuccessCallback;
+@property (nonatomic) AdjustDelegateSessionFailureCallback sessionFailureCallback;
+@property (nonatomic) AdjustDelegateDeferredDeeplinkCallback deferredDeeplinkCallback;
+@property (nonatomic) AdjustDelegateSkanUpdatedCallback skanUpdatedCallback;
+
+/**
+ * @brief Get instance of the AdjustUnityDelegate with properly swizzled callback methods.
+ *
+ * @param swizzleAttributionCallback Indicator whether attribution callback should be swizzled or not.
+ * @param swizzleEventSuccessCallback Indicator whether event success callback should be swizzled or not.
+ * @param swizzleEventFailureCallback Indicator whether event failure callback should be swizzled or not.
+ * @param swizzleSessionSuccessCallback Indicator whether session success callback should be swizzled or not.
+ * @param swizzleSessionFailureCallback Indicator whether session failure callback should be swizzled or not.
+ * @param swizzleDeferredDeeplinkCallback Indicator whether deferred deep link callback should be swizzled or not.
+ * @param swizzleSkanUpdatedCallback Indicator whether SKAD conversion value update callback should be swizzled or not.
+ * @param shouldLaunchDeferredDeeplink Indicator whether SDK should launch deferred deep link by default or not.
+ * @param adjustUnityGameObjectName Name of the Unity game object that loads Adjust script.
+ *
+ * @return AdjustUnityDelegate object instance with properly swizzled callback methods.
+ */
++ (id)getInstanceWithAttributionCallback:(AdjustDelegateAttributionCallback)attributionCallback
+ eventSuccessCallback:(AdjustDelegateEventSuccessCallback)eventSuccessCallback
+ eventFailureCallback:(AdjustDelegateEventFailureCallback)eventFailureCallback
+ sessionSuccessCallback:(AdjustDelegateSessionSuccessCallback)sessionSuccessCallback
+ sessionFailureCallback:(AdjustDelegateSessionFailureCallback)sessionFailureCallback
+ deferredDeeplinkCallback:(AdjustDelegateDeferredDeeplinkCallback)deferredDeeplinkCallback
+ skanUpdatedCallback:(AdjustDelegateSkanUpdatedCallback)skanUpdatedCallback
+ shouldLaunchDeferredDeeplink:(BOOL)shouldLaunchDeferredDeeplink;
+
+/**
+ * @brief Teardown method used to reset static AdjustUnityDelegate instance.
+ * Used for testing purposes only.
+ */
++ (void)teardown;
+
+@end
diff --git a/Assets/rd3/Adjust/Native/iOS/AdjustUnityDelegate.h.meta b/Assets/rd3/Adjust/Native/iOS/AdjustUnityDelegate.h.meta
new file mode 100644
index 0000000..fd52fe4
--- /dev/null
+++ b/Assets/rd3/Adjust/Native/iOS/AdjustUnityDelegate.h.meta
@@ -0,0 +1,131 @@
+fileFormatVersion: 2
+guid: 5d2beef19c617f74fbca612cc97e3c60
+PluginImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ iconMap: {}
+ executionOrder: {}
+ isPreloaded: 0
+ isOverridable: 0
+ platformData:
+ - first:
+ '': Any
+ second:
+ enabled: 0
+ settings:
+ Exclude Android: 1
+ Exclude Editor: 1
+ Exclude Linux: 1
+ Exclude Linux64: 1
+ Exclude LinuxUniversal: 1
+ Exclude OSXIntel: 1
+ Exclude OSXIntel64: 1
+ Exclude OSXUniversal: 1
+ Exclude WebGL: 1
+ Exclude Win: 1
+ Exclude Win64: 1
+ Exclude iOS: 0
+ Exclude tvOS: 1
+ - first:
+ '': Editor
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ OS: AnyOS
+ - first:
+ Android: Android
+ second:
+ enabled: 0
+ settings:
+ CPU: ARMv7
+ - first:
+ Any:
+ second:
+ enabled: 0
+ settings: {}
+ - first:
+ Editor: Editor
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ DefaultValueInitialized: true
+ OS: AnyOS
+ - first:
+ Facebook: Win
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Facebook: Win64
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: Linux
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: Linux64
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: LinuxUniversal
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: OSXIntel
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ - first:
+ Standalone: OSXIntel64
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ - first:
+ Standalone: OSXUniversal
+ second:
+ enabled: 0
+ settings:
+ CPU: x86
+ - first:
+ Standalone: Win
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: Win64
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ iPhone: iOS
+ second:
+ enabled: 1
+ settings:
+ CompileFlags:
+ FrameworkDependencies:
+ - first:
+ tvOS: tvOS
+ second:
+ enabled: 0
+ settings:
+ CompileFlags:
+ FrameworkDependencies:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/rd3/Adjust/Native/iOS/AdjustUnityDelegate.mm b/Assets/rd3/Adjust/Native/iOS/AdjustUnityDelegate.mm
new file mode 100644
index 0000000..c8427eb
--- /dev/null
+++ b/Assets/rd3/Adjust/Native/iOS/AdjustUnityDelegate.mm
@@ -0,0 +1,345 @@
+//
+// AdjustUnityDelegate.mm
+// Adjust SDK
+//
+// Created by Uglješa Erceg (@uerceg) on 5th December 2016.
+// Copyright © 2012-2018 Adjust GmbH. All rights reserved.
+//
+
+#import
+#import "AdjustUnityDelegate.h"
+
+static dispatch_once_t onceToken;
+static AdjustUnityDelegate *defaultInstance = nil;
+
+@implementation AdjustUnityDelegate
+
+#pragma mark - Object lifecycle methods
+
+- (id)init {
+ self = [super init];
+ if (nil == self) {
+ return nil;
+ }
+ return self;
+}
+
+#pragma mark - Public methods
+
++ (id)getInstanceWithAttributionCallback:(AdjustDelegateAttributionCallback)attributionCallback
+ eventSuccessCallback:(AdjustDelegateEventSuccessCallback)eventSuccessCallback
+ eventFailureCallback:(AdjustDelegateEventFailureCallback)eventFailureCallback
+ sessionSuccessCallback:(AdjustDelegateSessionSuccessCallback)sessionSuccessCallback
+ sessionFailureCallback:(AdjustDelegateSessionFailureCallback)sessionFailureCallback
+ deferredDeeplinkCallback:(AdjustDelegateDeferredDeeplinkCallback)deferredDeeplinkCallback
+ skanUpdatedCallback:(AdjustDelegateSkanUpdatedCallback)skanUpdatedCallback
+ shouldLaunchDeferredDeeplink:(BOOL)shouldLaunchDeferredDeeplink {
+ dispatch_once(&onceToken, ^{
+ defaultInstance = [[AdjustUnityDelegate alloc] init];
+
+ // Do the swizzling where and if needed.
+ if (attributionCallback != nil) {
+ [defaultInstance swizzleOriginalSelector:@selector(adjustAttributionChanged:)
+ withSelector:@selector(adjustAttributionChangedWannabe:)];
+ }
+ if (eventSuccessCallback != nil) {
+ [defaultInstance swizzleOriginalSelector:@selector(adjustEventTrackingSucceeded:)
+ withSelector:@selector(adjustEventTrackingSucceededWannabe:)];
+ }
+ if (eventFailureCallback != nil) {
+ [defaultInstance swizzleOriginalSelector:@selector(adjustEventTrackingFailed:)
+ withSelector:@selector(adjustEventTrackingFailedWannabe:)];
+ }
+ if (sessionSuccessCallback != nil) {
+ [defaultInstance swizzleOriginalSelector:@selector(adjustSessionTrackingSucceeded:)
+ withSelector:@selector(adjustSessionTrackingSucceededWannabe:)];
+ }
+ if (sessionFailureCallback != nil) {
+ [defaultInstance swizzleOriginalSelector:@selector(adjustSessionTrackingFailed:)
+ withSelector:@selector(adjustSessionTrackingFailedWannabe:)];
+ }
+ if (deferredDeeplinkCallback != nil) {
+ [defaultInstance swizzleOriginalSelector:@selector(adjustDeferredDeeplinkReceived:)
+ withSelector:@selector(adjustDeferredDeeplinkReceivedWannabe:)];
+ }
+ if (skanUpdatedCallback != nil) {
+ [defaultInstance swizzleOriginalSelector:@selector(adjustSkanUpdatedWithConversionData:)
+ withSelector:@selector(adjustSkanUpdatedWithConversionDataWannabe:)];
+ }
+
+ [defaultInstance setAttributionCallback:attributionCallback];
+ [defaultInstance setEventSuccessCallback:eventSuccessCallback];
+ [defaultInstance setEventFailureCallback:eventFailureCallback];
+ [defaultInstance setSessionSuccessCallback:sessionSuccessCallback];
+ [defaultInstance setSessionFailureCallback:sessionFailureCallback];
+ [defaultInstance setDeferredDeeplinkCallback:deferredDeeplinkCallback];
+ [defaultInstance setSkanUpdatedCallback:skanUpdatedCallback];
+ [defaultInstance setShouldLaunchDeferredDeeplink:shouldLaunchDeferredDeeplink];
+ });
+
+ return defaultInstance;
+}
+
++ (void)teardown {
+ defaultInstance = nil;
+ onceToken = 0;
+}
+
+#pragma mark - Private & helper methods
+
+- (void)adjustAttributionChangedWannabe:(ADJAttribution *)attribution {
+ if (attribution == nil || _attributionCallback == nil) {
+ return;
+ }
+
+ NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
+ [self addValueOrEmpty:attribution.trackerToken
+ forKey:@"trackerToken"
+ toDictionary:dictionary];
+ [self addValueOrEmpty:attribution.trackerName
+ forKey:@"trackerName"
+ toDictionary:dictionary];
+ [self addValueOrEmpty:attribution.network
+ forKey:@"network"
+ toDictionary:dictionary];
+ [self addValueOrEmpty:attribution.campaign
+ forKey:@"campaign"
+ toDictionary:dictionary];
+ [self addValueOrEmpty:attribution.creative
+ forKey:@"creative"
+ toDictionary:dictionary];
+ [self addValueOrEmpty:attribution.adgroup
+ forKey:@"adgroup"
+ toDictionary:dictionary];
+ [self addValueOrEmpty:attribution.clickLabel
+ forKey:@"clickLabel"
+ toDictionary:dictionary];
+ [self addValueOrEmpty:attribution.costType
+ forKey:@"costType"
+ toDictionary:dictionary];
+ [self addValueOrEmpty:attribution.costAmount
+ forKey:@"costAmount"
+ toDictionary:dictionary];
+ [self addValueOrEmpty:attribution.costCurrency
+ forKey:@"costCurrency"
+ toDictionary:dictionary];
+
+ if (attribution.jsonResponse != nil) {
+ NSData *jsonData = [NSJSONSerialization dataWithJSONObject:attribution.jsonResponse
+ options:0
+ error:nil];
+ NSString *strJsonResponse = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
+ [self addValueOrEmpty:strJsonResponse
+ forKey:@"jsonResponse"
+ toDictionary:dictionary];
+ }
+
+ NSData *dataAttribution = [NSJSONSerialization dataWithJSONObject:dictionary
+ options:0
+ error:nil];
+ NSString *stringAttribution = [[NSString alloc] initWithBytes:[dataAttribution bytes]
+ length:[dataAttribution length]
+ encoding:NSUTF8StringEncoding];
+ const char* charArrayAttribution = [stringAttribution UTF8String];
+ _attributionCallback(charArrayAttribution);
+}
+
+- (void)adjustEventTrackingSucceededWannabe:(ADJEventSuccess *)eventSuccessResponseData {
+ if (nil == eventSuccessResponseData || _eventSuccessCallback == nil) {
+ return;
+ }
+
+ NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
+ [self addValueOrEmpty:eventSuccessResponseData.message
+ forKey:@"message"
+ toDictionary:dictionary];
+ [self addValueOrEmpty:eventSuccessResponseData.timestamp
+ forKey:@"timestamp"
+ toDictionary:dictionary];
+ [self addValueOrEmpty:eventSuccessResponseData.adid
+ forKey:@"adid"
+ toDictionary:dictionary];
+ [self addValueOrEmpty:eventSuccessResponseData.eventToken
+ forKey:@"eventToken"
+ toDictionary:dictionary];
+ [self addValueOrEmpty:eventSuccessResponseData.callbackId
+ forKey:@"callbackId"
+ toDictionary:dictionary];
+ if (eventSuccessResponseData.jsonResponse != nil) {
+ [dictionary setObject:eventSuccessResponseData.jsonResponse
+ forKey:@"jsonResponse"];
+ }
+
+ NSData *dataEventSuccess = [NSJSONSerialization dataWithJSONObject:dictionary
+ options:0
+ error:nil];
+ NSString *stringEventSuccess = [[NSString alloc] initWithBytes:[dataEventSuccess bytes]
+ length:[dataEventSuccess length]
+ encoding:NSUTF8StringEncoding];
+ const char* charArrayEventSuccess = [stringEventSuccess UTF8String];
+ _eventSuccessCallback(charArrayEventSuccess);
+}
+
+- (void)adjustEventTrackingFailedWannabe:(ADJEventFailure *)eventFailureResponseData {
+ if (nil == eventFailureResponseData || _eventFailureCallback == nil) {
+ return;
+ }
+
+ NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
+ [self addValueOrEmpty:eventFailureResponseData.message
+ forKey:@"message"
+ toDictionary:dictionary];
+ [self addValueOrEmpty:eventFailureResponseData.timestamp
+ forKey:@"timestamp"
+ toDictionary:dictionary];
+ [self addValueOrEmpty:eventFailureResponseData.adid
+ forKey:@"adid"
+ toDictionary:dictionary];
+ [self addValueOrEmpty:eventFailureResponseData.eventToken
+ forKey:@"eventToken"
+ toDictionary:dictionary];
+ [self addValueOrEmpty:eventFailureResponseData.callbackId
+ forKey:@"callbackId"
+ toDictionary:dictionary];
+ [dictionary setObject:(eventFailureResponseData.willRetry ? @"true" : @"false")
+ forKey:@"willRetry"];
+ if (eventFailureResponseData.jsonResponse != nil) {
+ [dictionary setObject:eventFailureResponseData.jsonResponse
+ forKey:@"jsonResponse"];
+ }
+
+ NSData *dataEventFailure = [NSJSONSerialization dataWithJSONObject:dictionary
+ options:0
+ error:nil];
+ NSString *stringEventFailure = [[NSString alloc] initWithBytes:[dataEventFailure bytes]
+ length:[dataEventFailure length]
+ encoding:NSUTF8StringEncoding];
+ const char* charArrayEventFailure = [stringEventFailure UTF8String];
+ _eventFailureCallback(charArrayEventFailure);
+}
+
+- (void)adjustSessionTrackingSucceededWannabe:(ADJSessionSuccess *)sessionSuccessResponseData {
+ if (nil == sessionSuccessResponseData || _sessionSuccessCallback == nil) {
+ return;
+ }
+
+ NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
+ [self addValueOrEmpty:sessionSuccessResponseData.message
+ forKey:@"message"
+ toDictionary:dictionary];
+ [self addValueOrEmpty:sessionSuccessResponseData.timestamp
+ forKey:@"timestamp"
+ toDictionary:dictionary];
+ [self addValueOrEmpty:sessionSuccessResponseData.adid
+ forKey:@"adid"
+ toDictionary:dictionary];
+ if (sessionSuccessResponseData.jsonResponse != nil) {
+ [dictionary setObject:sessionSuccessResponseData.jsonResponse
+ forKey:@"jsonResponse"];
+ }
+
+ NSData *dataSessionSuccess = [NSJSONSerialization dataWithJSONObject:dictionary
+ options:0
+ error:nil];
+ NSString *stringSessionSuccess = [[NSString alloc] initWithBytes:[dataSessionSuccess bytes]
+ length:[dataSessionSuccess length]
+ encoding:NSUTF8StringEncoding];
+ const char* charArraySessionSuccess = [stringSessionSuccess UTF8String];
+ _sessionSuccessCallback(charArraySessionSuccess);
+}
+
+- (void)adjustSessionTrackingFailedWannabe:(ADJSessionFailure *)sessionFailureResponseData {
+ if (nil == sessionFailureResponseData || _sessionFailureCallback == nil) {
+ return;
+ }
+
+ NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
+ [self addValueOrEmpty:sessionFailureResponseData.message
+ forKey:@"message"
+ toDictionary:dictionary];
+ [self addValueOrEmpty:sessionFailureResponseData.timestamp
+ forKey:@"timestamp"
+ toDictionary:dictionary];
+ [self addValueOrEmpty:sessionFailureResponseData.adid
+ forKey:@"adid"
+ toDictionary:dictionary];
+ [dictionary setObject:(sessionFailureResponseData.willRetry ? @"true" : @"false")
+ forKey:@"willRetry"];
+ if (sessionFailureResponseData.jsonResponse != nil) {
+ [dictionary setObject:sessionFailureResponseData.jsonResponse
+ forKey:@"jsonResponse"];
+ }
+
+ NSData *dataSessionFailure = [NSJSONSerialization dataWithJSONObject:dictionary
+ options:0
+ error:nil];
+ NSString *stringSessionFailure = [[NSString alloc] initWithBytes:[dataSessionFailure bytes]
+ length:[dataSessionFailure length]
+ encoding:NSUTF8StringEncoding];
+ const char* charArraySessionFailure = [stringSessionFailure UTF8String];
+ _sessionFailureCallback(charArraySessionFailure);
+}
+
+- (BOOL)adjustDeferredDeeplinkReceivedWannabe:(NSURL *)deeplink {
+ if (_deferredDeeplinkCallback != nil) {
+ NSString *stringDeeplink = [deeplink absoluteString];
+ const char* charDeeplink = [stringDeeplink UTF8String];
+ _deferredDeeplinkCallback(charDeeplink);
+ }
+ return _shouldLaunchDeferredDeeplink;
+}
+
+- (void)adjustSkanUpdatedWithConversionDataWannabe:(NSDictionary *)data {
+ if (data == nil || _skanUpdatedCallback == nil) {
+ return;
+ }
+
+ NSData *dataSkanUpdatedData = [NSJSONSerialization dataWithJSONObject:data
+ options:0
+ error:nil];
+ NSString *strSkanUpdatedData = [[NSString alloc] initWithBytes:[dataSkanUpdatedData bytes]
+ length:[dataSkanUpdatedData length]
+ encoding:NSUTF8StringEncoding];
+ const char* charSkanUpdatedData = [strSkanUpdatedData UTF8String];
+ _skanUpdatedCallback(charSkanUpdatedData);
+}
+
+- (void)swizzleOriginalSelector:(SEL)originalSelector
+ withSelector:(SEL)swizzledSelector {
+ Class className = [self class];
+ Method originalMethod = class_getInstanceMethod(className, originalSelector);
+ Method swizzledMethod = class_getInstanceMethod(className, swizzledSelector);
+
+ BOOL didAddMethod = class_addMethod(className,
+ originalSelector,
+ method_getImplementation(swizzledMethod),
+ method_getTypeEncoding(swizzledMethod));
+ if (didAddMethod) {
+ class_replaceMethod(className,
+ swizzledSelector,
+ method_getImplementation(originalMethod),
+ method_getTypeEncoding(originalMethod));
+ } else {
+ method_exchangeImplementations(originalMethod, swizzledMethod);
+ }
+}
+
+- (void)addValueOrEmpty:(NSObject *)value
+ forKey:(NSString *)key
+ toDictionary:(NSMutableDictionary *)dictionary {
+ if (nil != value) {
+ if ([value isKindOfClass:[NSString class]]) {
+ [dictionary setObject:[NSString stringWithFormat:@"%@", value]
+ forKey:key];
+ } else if ([value isKindOfClass:[NSNumber class]]) {
+ [dictionary setObject:[NSString stringWithFormat:@"%@", [((NSNumber *)value) stringValue]]
+ forKey:key];
+ } else {
+ [dictionary setObject:@"" forKey:key];
+ }
+ } else {
+ [dictionary setObject:@"" forKey:key];
+ }
+}
+
+@end
diff --git a/Assets/rd3/Adjust/Native/iOS/AdjustUnityDelegate.mm.meta b/Assets/rd3/Adjust/Native/iOS/AdjustUnityDelegate.mm.meta
new file mode 100644
index 0000000..4d65f99
--- /dev/null
+++ b/Assets/rd3/Adjust/Native/iOS/AdjustUnityDelegate.mm.meta
@@ -0,0 +1,129 @@
+fileFormatVersion: 2
+guid: 81438eed05b2e4b489f13efc94d5476a
+PluginImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ iconMap: {}
+ executionOrder: {}
+ isPreloaded: 0
+ isOverridable: 0
+ platformData:
+ - first:
+ '': Any
+ second:
+ enabled: 0
+ settings:
+ Exclude Android: 1
+ Exclude Editor: 1
+ Exclude Linux: 1
+ Exclude Linux64: 1
+ Exclude LinuxUniversal: 1
+ Exclude OSXIntel: 1
+ Exclude OSXIntel64: 1
+ Exclude OSXUniversal: 1
+ Exclude WebGL: 1
+ Exclude Win: 1
+ Exclude Win64: 1
+ Exclude iOS: 0
+ Exclude tvOS: 1
+ - first:
+ '': Editor
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ OS: AnyOS
+ - first:
+ Android: Android
+ second:
+ enabled: 0
+ settings:
+ CPU: ARMv7
+ - first:
+ Any:
+ second:
+ enabled: 0
+ settings: {}
+ - first:
+ Editor: Editor
+ second:
+ enabled: 0
+ settings:
+ DefaultValueInitialized: true
+ - first:
+ Facebook: Win
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Facebook: Win64
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: Linux
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: Linux64
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: LinuxUniversal
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: OSXIntel
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ - first:
+ Standalone: OSXIntel64
+ second:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
+ - first:
+ Standalone: OSXUniversal
+ second:
+ enabled: 0
+ settings:
+ CPU: x86
+ - first:
+ Standalone: Win
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ Standalone: Win64
+ second:
+ enabled: 0
+ settings:
+ CPU: None
+ - first:
+ iPhone: iOS
+ second:
+ enabled: 1
+ settings:
+ CompileFlags:
+ FrameworkDependencies:
+ - first:
+ tvOS: tvOS
+ second:
+ enabled: 0
+ settings:
+ CompileFlags:
+ FrameworkDependencies:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/rd3/Adjust/Prefab.meta b/Assets/rd3/Adjust/Prefab.meta
new file mode 100644
index 0000000..6bc38d1
--- /dev/null
+++ b/Assets/rd3/Adjust/Prefab.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 0acdd227ad1b8d147ade044242671e15
+folderAsset: yes
+timeCreated: 1578652549
+licenseType: Pro
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/rd3/Adjust/Prefab/Adjust.prefab b/Assets/rd3/Adjust/Prefab/Adjust.prefab
new file mode 100644
index 0000000..394a83f
--- /dev/null
+++ b/Assets/rd3/Adjust/Prefab/Adjust.prefab
@@ -0,0 +1,77 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!1 &115478
+GameObject:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ serializedVersion: 5
+ m_Component:
+ - component: {fileID: 415478}
+ - component: {fileID: 114179903453641630}
+ m_Layer: 0
+ m_Name: Adjust
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!4 &415478
+Transform:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 115478}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children: []
+ m_Father: {fileID: 0}
+ m_RootOrder: 0
+ m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!1001 &100100000
+Prefab:
+ m_ObjectHideFlags: 1
+ serializedVersion: 2
+ m_Modification:
+ m_TransformParent: {fileID: 0}
+ m_Modifications: []
+ m_RemovedComponents: []
+ m_ParentPrefab: {fileID: 0}
+ m_RootGameObject: {fileID: 115478}
+ m_IsPrefabParent: 1
+--- !u!114 &114179903453641630
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 115478}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 525ece82a472e4dea837e1ef938fd15d, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ startManually: 1
+ appToken:
+ environment: 0
+ logLevel: 3
+ eventBuffering: 0
+ sendInBackground: 0
+ launchDeferredDeeplink: 1
+ needsCost: 0
+ coppaCompliant: 0
+ linkMe: 0
+ defaultTracker:
+ urlStrategy: 0
+ startDelay: 0
+ secretId: 0
+ info1: 0
+ info2: 0
+ info3: 0
+ info4: 0
+ preinstallTracking: 0
+ preinstallFilePath:
+ playStoreKidsApp: 0
+ adServicesInfoReading: 1
+ idfaInfoReading: 1
+ skAdNetworkHandling: 1
diff --git a/Assets/rd3/Adjust/Prefab/Adjust.prefab.meta b/Assets/rd3/Adjust/Prefab/Adjust.prefab.meta
new file mode 100644
index 0000000..ca66937
--- /dev/null
+++ b/Assets/rd3/Adjust/Prefab/Adjust.prefab.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: a3267720e82aa41c1a05ab29824902b4
+NativeFormatImporter:
+ mainObjectFileID: -1
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/rd3/Adjust/Resources.meta b/Assets/rd3/Adjust/Resources.meta
new file mode 100644
index 0000000..89ce266
--- /dev/null
+++ b/Assets/rd3/Adjust/Resources.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: e9688945324d3a44699534d71c3e55cb
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/rd3/Adjust/Resources/AdjustSettings.asset b/Assets/rd3/Adjust/Resources/AdjustSettings.asset
new file mode 100644
index 0000000..9b4f2a8
--- /dev/null
+++ b/Assets/rd3/Adjust/Resources/AdjustSettings.asset
@@ -0,0 +1,28 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!114 &11400000
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: ea4d495dc6d5ba64b90db7afda6a48a4, type: 3}
+ m_Name: AdjustSettings
+ m_EditorClassIdentifier:
+ _iOSFrameworkAdSupport: 1
+ _iOSFrameworkAdServices: 0
+ _iOSFrameworkAppTrackingTransparency: 0
+ _iOSFrameworkStoreKit: 0
+ _androidPermissionInternet: 1
+ _androidPermissionInstallReferrerService: 1
+ _androidPermissionAdId: 1
+ _androidPermissionAccessNetworkState: 0
+ _iOSUserTrackingUsageDescription:
+ _iOSUrlIdentifier:
+ _iOSUrlSchemes: []
+ _iOSUniversalLinksDomains: []
+ androidUriSchemes: []
+ _androidCustomActivityName:
diff --git a/Assets/rd3/Adjust/Resources/AdjustSettings.asset.meta b/Assets/rd3/Adjust/Resources/AdjustSettings.asset.meta
new file mode 100644
index 0000000..905dd6b
--- /dev/null
+++ b/Assets/rd3/Adjust/Resources/AdjustSettings.asset.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 998d67a1c15bc8b4ea727ddd95230724
+NativeFormatImporter:
+ externalObjects: {}
+ mainObjectFileID: 11400000
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/rd3/Adjust/Scripts.meta b/Assets/rd3/Adjust/Scripts.meta
new file mode 100644
index 0000000..dc956eb
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 0e5ecfef4e691483199f0cdae3eebff2
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/rd3/Adjust/Scripts/Adjust.cs b/Assets/rd3/Adjust/Scripts/Adjust.cs
new file mode 100644
index 0000000..77f4716
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/Adjust.cs
@@ -0,0 +1,839 @@
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace AdjustSdk
+{
+ public class Adjust : MonoBehaviour
+ {
+ private const string errorMsgEditor = "[Adjust]: SDK can not be used in Editor.";
+ private const string errorMsgStart = "[Adjust]: SDK not started. Start it manually using the 'start' method.";
+ private const string errorMsgPlatform = "[Adjust]: SDK can only be used in Android and iOS apps.";
+
+ // [Header("SDK SETTINGS:")]
+ // [Space(5)]
+ // [Tooltip("If selected, it is expected from you to initialize Adjust SDK from your app code. " +
+ // "Any SDK configuration settings from prefab will be ignored in that case.")]
+ [HideInInspector]
+ public bool startManually = true;
+ [HideInInspector]
+ public string appToken;
+ [HideInInspector]
+ public AdjustEnvironment environment = AdjustEnvironment.Sandbox;
+ [HideInInspector]
+ public AdjustLogLevel logLevel = AdjustLogLevel.Info;
+ [HideInInspector]
+ public bool coppaCompliance = false;
+ [HideInInspector]
+ public bool sendInBackground = false;
+ [HideInInspector]
+ public bool launchDeferredDeeplink = true;
+ [HideInInspector]
+ public bool costDataInAttribution = false;
+ [HideInInspector]
+ public bool linkMe = false;
+ [HideInInspector]
+ public string defaultTracker;
+
+ // [Header("ANDROID SPECIFIC FEATURES:")]
+ // [Space(5)]
+ [HideInInspector]
+ public bool preinstallTracking = false;
+ [HideInInspector]
+ public string preinstallFilePath;
+
+ // [Header("iOS SPECIFIC FEATURES:")]
+ // [Space(5)]
+ [HideInInspector]
+ public bool adServices = true;
+ [HideInInspector]
+ public bool idfaReading = true;
+ [HideInInspector]
+ public bool skanAttribution = true;
+
+ void Awake()
+ {
+ if (IsEditor())
+ {
+ return;
+ }
+
+ DontDestroyOnLoad(transform.gameObject);
+
+ // TODO: double-check the state of Unity on deep linking nowadays
+#if UNITY_ANDROID && UNITY_2019_2_OR_NEWER
+ Application.deepLinkActivated += (deeplink) =>
+ {
+ Adjust.ProcessDeeplink(new AdjustDeeplink(deeplink));
+ };
+ if (!string.IsNullOrEmpty(Application.absoluteURL))
+ {
+ // cold start and Application.absoluteURL not null so process deep link
+ Adjust.ProcessDeeplink(new AdjustDeeplink(Application.absoluteURL));
+ }
+#endif
+
+ if (!this.startManually)
+ {
+ AdjustConfig adjustConfig = new AdjustConfig(
+ this.appToken,
+ this.environment,
+ (this.logLevel == AdjustLogLevel.Suppress));
+ adjustConfig.LogLevel = this.logLevel;
+ adjustConfig.IsSendingInBackgroundEnabled = this.sendInBackground;
+ adjustConfig.IsDeferredDeeplinkOpeningEnabled = this.launchDeferredDeeplink;
+ adjustConfig.DefaultTracker = this.defaultTracker;
+ // TODO: URL strategy
+ adjustConfig.IsCoppaComplianceEnabled = this.coppaCompliance;
+ adjustConfig.IsCostDataInAttributionEnabled = this.costDataInAttribution;
+ adjustConfig.IsPreinstallTrackingEnabled = this.preinstallTracking;
+ adjustConfig.PreinstallFilePath = this.preinstallFilePath;
+ adjustConfig.IsAdServicesEnabled = this.adServices;
+ adjustConfig.IsIdfaReadingEnabled = this.idfaReading;
+ adjustConfig.IsLinkMeEnabled = this.linkMe;
+ adjustConfig.IsSkanAttributionEnabled = this.skanAttribution;
+ Adjust.InitSdk(adjustConfig);
+ }
+ }
+
+ public static void InitSdk(AdjustConfig adjustConfig)
+ {
+ if (IsEditor())
+ {
+ return;
+ }
+
+ if (adjustConfig == null)
+ {
+ Debug.Log("[Adjust]: Missing config to start.");
+ return;
+ }
+
+#if UNITY_IOS
+ AdjustiOS.InitSdk(adjustConfig);
+#elif UNITY_ANDROID
+ AdjustAndroid.InitSdk(adjustConfig);
+#else
+ Debug.Log(errorMsgPlatform);
+#endif
+ }
+
+ public static void TrackEvent(AdjustEvent adjustEvent)
+ {
+ if (IsEditor())
+ {
+ return;
+ }
+
+ if (adjustEvent == null)
+ {
+ Debug.Log("[Adjust]: Missing event to track.");
+ return;
+ }
+#if UNITY_IOS
+ AdjustiOS.TrackEvent(adjustEvent);
+#elif UNITY_ANDROID
+ AdjustAndroid.TrackEvent(adjustEvent);
+#else
+ Debug.Log(errorMsgPlatform);
+#endif
+ }
+
+ public static void Enable()
+ {
+ if (IsEditor())
+ {
+ return;
+ }
+
+#if UNITY_IOS
+ AdjustiOS.Enable();
+#elif UNITY_ANDROID
+ AdjustAndroid.Enable();
+#else
+ Debug.Log(errorMsgPlatform);
+#endif
+ }
+
+ public static void Disable()
+ {
+ if (IsEditor())
+ {
+ return;
+ }
+
+#if UNITY_IOS
+ AdjustiOS.Disable();
+#elif UNITY_ANDROID
+ AdjustAndroid.Disable();
+#else
+ Debug.Log(errorMsgPlatform);
+#endif
+ }
+
+ public static void IsEnabled(Action callback)
+ {
+ if (IsEditor())
+ {
+ return;
+ }
+
+#if UNITY_IOS
+ AdjustiOS.IsEnabled(callback);
+#elif UNITY_ANDROID
+ AdjustAndroid.IsEnabled(callback);
+#else
+ Debug.Log(errorMsgPlatform);
+ return;
+#endif
+ }
+
+ public static void SwitchToOfflineMode()
+ {
+ if (IsEditor())
+ {
+ return;
+ }
+
+#if UNITY_IOS
+ AdjustiOS.SwitchToOfflineMode();
+#elif UNITY_ANDROID
+ AdjustAndroid.SwitchToOfflineMode();
+#else
+ Debug.Log(errorMsgPlatform);
+#endif
+ }
+
+ public static void SwitchBackToOnlineMode()
+ {
+ if (IsEditor())
+ {
+ return;
+ }
+
+#if UNITY_IOS
+ AdjustiOS.SwitchBackToOnlineMode();
+#elif UNITY_ANDROID
+ AdjustAndroid.SwitchBackToOnlineMode();
+#else
+ Debug.Log(errorMsgPlatform);
+#endif
+ }
+
+ public static void SetPushToken(string pushToken)
+ {
+ if (IsEditor())
+ {
+ return;
+ }
+
+#if UNITY_IOS
+ AdjustiOS.SetPushToken(pushToken);
+#elif UNITY_ANDROID
+ AdjustAndroid.SetPushToken(pushToken);
+#else
+ Debug.Log(errorMsgPlatform);
+#endif
+ }
+
+ public static void GdprForgetMe()
+ {
+ if (IsEditor())
+ {
+ return;
+ }
+
+#if UNITY_IOS
+ AdjustiOS.GdprForgetMe();
+#elif UNITY_ANDROID
+ AdjustAndroid.GdprForgetMe();
+#else
+ Debug.Log(errorMsgPlatform);
+#endif
+ }
+
+ public static void ProcessDeeplink(AdjustDeeplink deeplink)
+ {
+ if (IsEditor())
+ {
+ return;
+ }
+
+#if UNITY_IOS
+ AdjustiOS.ProcessDeeplink(deeplink);
+#elif UNITY_ANDROID
+ AdjustAndroid.ProcessDeeplink(deeplink);
+#else
+ Debug.Log(errorMsgPlatform);
+#endif
+ }
+
+ public static void AddGlobalPartnerParameter(string key, string value)
+ {
+ if (IsEditor())
+ {
+ return;
+ }
+
+#if UNITY_IOS
+ AdjustiOS.AddGlobalPartnerParameter(key, value);
+#elif UNITY_ANDROID
+ AdjustAndroid.AddGlobalPartnerParameter(key, value);
+#else
+ Debug.Log(errorMsgPlatform);
+#endif
+ }
+
+ public static void AddGlobalCallbackParameter(string key, string value)
+ {
+ if (IsEditor())
+ {
+ return;
+ }
+
+#if UNITY_IOS
+ AdjustiOS.AddGlobalCallbackParameter(key, value);
+#elif UNITY_ANDROID
+ AdjustAndroid.AddGlobalCallbackParameter(key, value);
+#else
+ Debug.Log(errorMsgPlatform);
+#endif
+ }
+
+ public static void RemoveGlobalPartnerParameter(string key)
+ {
+ if (IsEditor())
+ {
+ return;
+ }
+
+#if UNITY_IOS
+ AdjustiOS.RemoveGlobalPartnerParameter(key);
+#elif UNITY_ANDROID
+ AdjustAndroid.RemoveGlobalPartnerParameter(key);
+#else
+ Debug.Log(errorMsgPlatform);
+#endif
+ }
+
+ public static void RemoveGlobalCallbackParameter(string key)
+ {
+ if (IsEditor())
+ {
+ return;
+ }
+
+#if UNITY_IOS
+ AdjustiOS.RemoveGlobalCallbackParameter(key);
+#elif UNITY_ANDROID
+ AdjustAndroid.RemoveGlobalCallbackParameter(key);
+#else
+ Debug.Log(errorMsgPlatform);
+#endif
+ }
+
+ public static void RemoveGlobalPartnerParameters()
+ {
+ if (IsEditor())
+ {
+ return;
+ }
+
+#if UNITY_IOS
+ AdjustiOS.RemoveGlobalPartnerParameters();
+#elif UNITY_ANDROID
+ AdjustAndroid.RemoveGlobalPartnerParameters();
+#else
+ Debug.Log(errorMsgPlatform);
+#endif
+ }
+
+ public static void RemoveGlobalCallbackParameters()
+ {
+ if (IsEditor())
+ {
+ return;
+ }
+
+#if UNITY_IOS
+ AdjustiOS.RemoveGlobalCallbackParameters();
+#elif UNITY_ANDROID
+ AdjustAndroid.RemoveGlobalCallbackParameters();
+#else
+ Debug.Log(errorMsgPlatform);
+#endif
+ }
+
+ public static void TrackAdRevenue(AdjustAdRevenue adRevenue)
+ {
+ if (IsEditor())
+ {
+ return;
+ }
+
+#if UNITY_IOS
+ AdjustiOS.TrackAdRevenue(adRevenue);
+#elif UNITY_ANDROID
+ AdjustAndroid.TrackAdRevenue(adRevenue);
+#else
+ Debug.Log(errorMsgPlatform);
+#endif
+ }
+
+ public static void TrackAppStoreSubscription(AdjustAppStoreSubscription subscription)
+ {
+ if (IsEditor())
+ {
+ return;
+ }
+
+#if UNITY_IOS
+ AdjustiOS.TrackAppStoreSubscription(subscription);
+#elif UNITY_ANDROID
+ Debug.Log("[Adjust]: App Store subscription tracking is only supported for iOS platform.");
+#else
+ Debug.Log(errorMsgPlatform);
+#endif
+ }
+
+ public static void TrackPlayStoreSubscription(AdjustPlayStoreSubscription subscription)
+ {
+ if (IsEditor())
+ {
+ return;
+ }
+
+#if UNITY_IOS
+ Debug.Log("[Adjust]: Play Store subscription tracking is only supported for Android platform.");
+#elif UNITY_ANDROID
+ AdjustAndroid.TrackPlayStoreSubscription(subscription);
+#else
+ Debug.Log(errorMsgPlatform);
+#endif
+ }
+
+ public static void TrackThirdPartySharing(AdjustThirdPartySharing thirdPartySharing)
+ {
+ if (IsEditor())
+ {
+ return;
+ }
+
+#if UNITY_IOS
+ AdjustiOS.TrackThirdPartySharing(thirdPartySharing);
+#elif UNITY_ANDROID
+ AdjustAndroid.TrackThirdPartySharing(thirdPartySharing);
+#else
+ Debug.Log(errorMsgPlatform);
+#endif
+ }
+
+ public static void TrackMeasurementConsent(bool measurementConsent)
+ {
+ if (IsEditor())
+ {
+ return;
+ }
+
+#if UNITY_IOS
+ AdjustiOS.TrackMeasurementConsent(measurementConsent);
+#elif UNITY_ANDROID
+ AdjustAndroid.TrackMeasurementConsent(measurementConsent);
+#else
+ Debug.Log(errorMsgPlatform);
+#endif
+ }
+
+ public static void RequestAppTrackingAuthorization(Action callback)
+ {
+ if (IsEditor())
+ {
+ return;
+ }
+
+#if UNITY_IOS
+ AdjustiOS.RequestAppTrackingAuthorization(callback);
+#elif UNITY_ANDROID
+ Debug.Log("[Adjust]: Requesting tracking authorization is only supported for iOS platform.");
+#else
+ Debug.Log(errorMsgPlatform);
+#endif
+ }
+
+ public static void UpdateSkanConversionValue(
+ int conversionValue,
+ string coarseValue,
+ bool lockWindow,
+ Action callback)
+ {
+ if (IsEditor())
+ {
+ return;
+ }
+
+#if UNITY_IOS
+ AdjustiOS.UpdateSkanConversionValue(conversionValue, coarseValue, lockWindow, callback);
+#elif UNITY_ANDROID
+ Debug.Log("[Adjust]: Updating SKAdNetwork conversion value is only supported for iOS platform.");
+#else
+ Debug.Log(errorMsgPlatform);
+#endif
+ }
+
+ public static int GetAppTrackingAuthorizationStatus()
+ {
+ if (IsEditor())
+ {
+ return -1;
+ }
+
+#if UNITY_IOS
+ return AdjustiOS.GetAppTrackingAuthorizationStatus();
+#elif UNITY_ANDROID
+ Debug.Log("[Adjust]: Error! App tracking authorization status is only supported for iOS platform.");
+ return -1;
+#else
+ Debug.Log(errorMsgPlatform);
+ return -1;
+#endif
+ }
+
+ public static void GetAdid(Action callback)
+ {
+ if (IsEditor())
+ {
+ return;
+ }
+
+#if UNITY_IOS
+ AdjustiOS.GetAdid(callback);
+#elif UNITY_ANDROID
+ AdjustAndroid.GetAdid(callback);
+#else
+ Debug.Log(errorMsgPlatform);
+#endif
+ }
+
+ public static void GetAttribution(Action callback)
+ {
+ if (IsEditor())
+ {
+ return;
+ }
+
+#if UNITY_IOS
+ AdjustiOS.GetAttribution(callback);
+#elif UNITY_ANDROID
+ AdjustAndroid.GetAttribution(callback);
+#else
+ Debug.Log(errorMsgPlatform);
+#endif
+ }
+
+ public static void GetIdfa(Action callback)
+ {
+ if (IsEditor())
+ {
+ return;
+ }
+
+#if UNITY_IOS
+ AdjustiOS.GetIdfa(callback);
+#elif UNITY_ANDROID
+ Debug.Log("[Adjust]: Error! IDFA is not available on Android platform.");
+#else
+ Debug.Log(errorMsgPlatform);
+#endif
+ }
+
+ public static void GetIdfv(Action callback)
+ {
+ if (IsEditor())
+ {
+ return;
+ }
+
+#if UNITY_IOS
+ AdjustiOS.GetIdfv(callback);
+#elif UNITY_ANDROID
+ Debug.Log("[Adjust]: Error! IDFV is not available on Android platform.");
+#else
+ Debug.Log(errorMsgPlatform);
+#endif
+ }
+
+ public static void GetGoogleAdId(Action callback)
+ {
+ if (IsEditor())
+ {
+ return;
+ }
+
+#if UNITY_IOS
+ Debug.Log("[Adjust]: Error! Google Advertising ID is not available on iOS platform.");
+#elif UNITY_ANDROID
+ AdjustAndroid.GetGoogleAdId(callback);
+#else
+ Debug.Log(errorMsgPlatform);
+#endif
+ }
+
+ public static void GetAmazonAdId(Action callback)
+ {
+ if (IsEditor())
+ {
+ return;
+ }
+
+#if UNITY_IOS
+ Debug.Log("[Adjust]: Error! Amazon Fire Advertising ID is not available on iOS platform.");
+#elif UNITY_ANDROID
+ AdjustAndroid.GetAmazonAdId(callback);
+#else
+ Debug.Log(errorMsgPlatform);
+#endif
+ }
+
+ public static void GetSdkVersion(Action callback)
+ {
+ if (IsEditor())
+ {
+ return;
+ }
+
+#if UNITY_IOS
+ AdjustiOS.GetSdkVersion(callback);
+#elif UNITY_ANDROID
+ AdjustAndroid.GetSdkVersion(callback);
+#else
+ Debug.Log(errorMsgPlatform);
+#endif
+ }
+
+ public static void GetLastDeeplink(Action callback)
+ {
+ if (IsEditor())
+ {
+ return;
+ }
+
+#if UNITY_IOS
+ AdjustiOS.GetLastDeeplink(callback);
+#elif UNITY_ANDROID
+ AdjustAndroid.GetLastDeeplink(callback);
+#else
+ Debug.Log(errorMsgPlatform);
+#endif
+ }
+
+ public static void VerifyAppStorePurchase(
+ AdjustAppStorePurchase purchase,
+ Action callback)
+ {
+ if (IsEditor())
+ {
+ return;
+ }
+
+#if UNITY_IOS
+ AdjustiOS.VerifyAppStorePurchase(purchase, callback);
+#elif UNITY_ANDROID
+ Debug.Log("[Adjust]: App Store purchase verification is only supported for iOS platform.");
+#else
+ Debug.Log(errorMsgPlatform);
+#endif
+ }
+
+ public static void VerifyPlayStorePurchase(
+ AdjustPlayStorePurchase purchase,
+ Action verificationResultCallback)
+ {
+ if (IsEditor())
+ {
+ return;
+ }
+
+#if UNITY_IOS
+ Debug.Log("[Adjust]: Play Store purchase verification is only supported for Android platform.");
+#elif UNITY_ANDROID
+ AdjustAndroid.VerifyPlayStorePurchase(purchase, verificationResultCallback);
+#else
+ Debug.Log(errorMsgPlatform);
+#endif
+ }
+
+ public static void ProcessAndResolveDeeplink(AdjustDeeplink deeplink, Action callback)
+ {
+ if (IsEditor())
+ {
+ return;
+ }
+
+#if UNITY_IOS
+ AdjustiOS.ProcessAndResolveDeeplink(deeplink, callback);
+#elif UNITY_ANDROID
+ AdjustAndroid.ProcessAndResolveDeeplink(deeplink, callback);
+#else
+ Debug.Log(errorMsgPlatform);
+#endif
+ }
+
+ public static void VerifyAndTrackAppStorePurchase(
+ AdjustEvent adjustEvent,
+ Action callback)
+ {
+ if (IsEditor())
+ {
+ return;
+ }
+
+#if UNITY_IOS
+ AdjustiOS.VerifyAndTrackAppStorePurchase(adjustEvent, callback);
+#elif UNITY_ANDROID
+ Debug.Log("[Adjust]: App Store purchase verification is only supported for iOS platform.");
+#else
+ Debug.Log(errorMsgPlatform);
+#endif
+ }
+
+ public static void VerifyAndTrackPlayStorePurchase(
+ AdjustEvent adjustEvent,
+ Action verificationResultCallback)
+ {
+ if (IsEditor())
+ {
+ return;
+ }
+
+#if UNITY_IOS
+ Debug.Log("[Adjust]: Play Store purchase verification is only supported for Android platform.");
+#elif UNITY_ANDROID
+ AdjustAndroid.VerifyAndTrackPlayStorePurchase(adjustEvent, verificationResultCallback);
+#else
+ Debug.Log(errorMsgPlatform);
+#endif
+ }
+
+ public static void EndFirstSessionDelay()
+ {
+ if (IsEditor())
+ {
+ return;
+ }
+
+#if UNITY_IOS
+ AdjustiOS.EndFirstSessionDelay();
+#elif UNITY_ANDROID
+ AdjustAndroid.EndFirstSessionDelay();
+#else
+ Debug.Log(errorMsgPlatform);
+#endif
+ }
+
+ public static void EnableCoppaComplianceInDelay()
+ {
+ if (IsEditor())
+ {
+ return;
+ }
+
+#if UNITY_IOS
+ AdjustiOS.EnableCoppaComplianceInDelay();
+#elif UNITY_ANDROID
+ AdjustAndroid.EnableCoppaComplianceInDelay();
+#else
+ Debug.Log(errorMsgPlatform);
+#endif
+ }
+
+ public static void DisableCoppaComplianceInDelay()
+ {
+ if (IsEditor())
+ {
+ return;
+ }
+
+#if UNITY_IOS
+ AdjustiOS.DisableCoppaComplianceInDelay();
+#elif UNITY_ANDROID
+ AdjustAndroid.DisableCoppaComplianceInDelay();
+#else
+ Debug.Log(errorMsgPlatform);
+#endif
+ }
+
+ public static void EnablePlayStoreKidsComplianceInDelay()
+ {
+ if (IsEditor())
+ {
+ return;
+ }
+
+#if UNITY_IOS
+ Debug.Log("[Adjust]: Play Store kids feature is only supported for Android platform.");
+#elif UNITY_ANDROID
+ AdjustAndroid.EnablePlayStoreKidsComplianceInDelay();
+#else
+ Debug.Log(errorMsgPlatform);
+#endif
+ }
+
+ public static void DisablePlayStoreKidsComplianceInDelay()
+ {
+ if (IsEditor())
+ {
+ return;
+ }
+
+#if UNITY_IOS
+ Debug.Log("[Adjust]: Play Store kids feature is only supported for Android platform.");
+#elif UNITY_ANDROID
+ AdjustAndroid.DisablePlayStoreKidsComplianceInDelay();
+#else
+ Debug.Log(errorMsgPlatform);
+#endif
+ }
+
+ public static void SetExternalDeviceIdInDelay(string externalDeviceId)
+ {
+ if (IsEditor())
+ {
+ return;
+ }
+
+#if UNITY_IOS
+ AdjustiOS.SetExternalDeviceIdInDelay(externalDeviceId);
+#elif UNITY_ANDROID
+ AdjustAndroid.SetExternalDeviceIdInDelay(externalDeviceId);
+#else
+ Debug.Log(errorMsgPlatform);
+#endif
+ }
+
+ private static bool IsEditor()
+ {
+#if UNITY_EDITOR
+ Debug.Log(errorMsgEditor);
+ return true;
+#else
+ return false;
+#endif
+ }
+
+ public static void SetTestOptions(Dictionary testOptions)
+ {
+ if (IsEditor())
+ {
+ return;
+ }
+
+#if UNITY_IOS
+ AdjustiOS.SetTestOptions(testOptions);
+#elif UNITY_ANDROID
+ AdjustAndroid.SetTestOptions(testOptions);
+#else
+ Debug.Log("[Adjust]: Cannot run integration tests. None of the supported platforms selected.");
+#endif
+ }
+ }
+}
diff --git a/Assets/rd3/Adjust/Scripts/Adjust.cs.meta b/Assets/rd3/Adjust/Scripts/Adjust.cs.meta
new file mode 100644
index 0000000..08f7cad
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/Adjust.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 525ece82a472e4dea837e1ef938fd15d
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Assets/rd3/Adjust/Scripts/AdjustAdRevenue.cs b/Assets/rd3/Adjust/Scripts/AdjustAdRevenue.cs
new file mode 100644
index 0000000..7c13bd0
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/AdjustAdRevenue.cs
@@ -0,0 +1,78 @@
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+
+namespace AdjustSdk
+{
+ public class AdjustAdRevenue
+ {
+ private List innerCallbackParameters;
+ private List innerPartnerParameters;
+
+ public string Source { get; private set; }
+ public double? Revenue { get; private set; }
+ public string Currency { get; private set; }
+ public int? AdImpressionsCount { get; set; }
+ public string AdRevenueNetwork { get; set; }
+ public string AdRevenueUnit { get; set; }
+ public string AdRevenuePlacement { get; set; }
+ public ReadOnlyCollection CallbackParameters
+ {
+ get
+ {
+ if (innerCallbackParameters == null)
+ {
+ return null;
+ }
+ else
+ {
+ return innerCallbackParameters.AsReadOnly();
+ }
+ }
+ }
+ public ReadOnlyCollection PartnerParameters
+ {
+ get
+ {
+ if (innerPartnerParameters == null)
+ {
+ return null;
+ }
+ else
+ {
+ return innerPartnerParameters.AsReadOnly();
+ }
+ }
+ }
+
+ public AdjustAdRevenue(string source)
+ {
+ this.Source = source;
+ }
+
+ public void SetRevenue(double revenue, string currency)
+ {
+ this.Revenue = revenue;
+ this.Currency = currency;
+ }
+
+ public void AddCallbackParameter(string key, string value)
+ {
+ if (this.innerCallbackParameters == null)
+ {
+ this.innerCallbackParameters = new List();
+ }
+ this.innerCallbackParameters.Add(key);
+ this.innerCallbackParameters.Add(value);
+ }
+
+ public void AddPartnerParameter(string key, string value)
+ {
+ if (this.innerPartnerParameters == null)
+ {
+ this.innerPartnerParameters = new List();
+ }
+ this.innerPartnerParameters.Add(key);
+ this.innerPartnerParameters.Add(value);
+ }
+ }
+}
diff --git a/Assets/rd3/Adjust/Scripts/AdjustAdRevenue.cs.meta b/Assets/rd3/Adjust/Scripts/AdjustAdRevenue.cs.meta
new file mode 100644
index 0000000..bb3834f
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/AdjustAdRevenue.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 776a9d4b715bc44c68724248a5a75cb9
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/rd3/Adjust/Scripts/AdjustAndroid.cs b/Assets/rd3/Adjust/Scripts/AdjustAndroid.cs
new file mode 100644
index 0000000..14a5e54
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/AdjustAndroid.cs
@@ -0,0 +1,1438 @@
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+using UnityEngine;
+
+namespace AdjustSdk
+{
+#if UNITY_ANDROID
+ public class AdjustAndroid
+ {
+ private const string sdkPrefix = "unity5.4.2";
+ private static bool isDeferredDeeplinkOpeningEnabled = true;
+ private static AndroidJavaClass ajcAdjust = new AndroidJavaClass("com.adjust.sdk.Adjust");
+ private static AndroidJavaObject ajoCurrentActivity = new AndroidJavaClass("com.unity3d.player.UnityPlayer").GetStatic("currentActivity");
+ private static DeferredDeeplinkListener onDeferredDeeplinkListener;
+ private static AttributionChangedListener onAttributionChangedListener;
+ private static EventTrackingFailedListener onEventTrackingFailedListener;
+ private static EventTrackingSucceededListener onEventTrackingSucceededListener;
+ private static SessionTrackingFailedListener onSessionTrackingFailedListener;
+ private static SessionTrackingSucceededListener onSessionTrackingSucceededListener;
+
+ private static DeeplinkResolutionListener onDeeplinkResolvedListener;
+
+ public static void InitSdk(AdjustConfig adjustConfig)
+ {
+ // thank you, Unity 2019.2.0, for breaking this
+ // AndroidJavaObject ajoEnvironment = adjustConfig.environment == AdjustEnvironment.Sandbox ?
+ // new AndroidJavaClass("com.adjust.sdk.AdjustConfig").GetStatic("ENVIRONMENT_SANDBOX") :
+ // new AndroidJavaClass("com.adjust.sdk.AdjustConfig").GetStatic("ENVIRONMENT_PRODUCTION");
+
+ // get environment variable
+ string environment = adjustConfig.Environment == AdjustEnvironment.Production ? "production" : "sandbox";
+
+ using (AndroidJavaObject ajoAdjustConfig = adjustConfig.AllowSuppressLogLevel != null ?
+ new AndroidJavaObject("com.adjust.sdk.AdjustConfig", ajoCurrentActivity, adjustConfig.AppToken, environment, adjustConfig.AllowSuppressLogLevel) :
+ new AndroidJavaObject("com.adjust.sdk.AdjustConfig", ajoCurrentActivity, adjustConfig.AppToken, environment))
+ {
+ // check if deferred deeplink should be launched by the SDK
+ if (adjustConfig.IsDeferredDeeplinkOpeningEnabled != null)
+ {
+ isDeferredDeeplinkOpeningEnabled = (bool)adjustConfig.IsDeferredDeeplinkOpeningEnabled;
+ }
+
+ // check log level
+ if (adjustConfig.LogLevel != null)
+ {
+ AndroidJavaObject ajoLogLevel;
+ if (adjustConfig.LogLevel.Value.ToUppercaseString().Equals("SUPPRESS"))
+ {
+ ajoLogLevel = new AndroidJavaClass("com.adjust.sdk.LogLevel").GetStatic("SUPPRESS");
+ }
+ else
+ {
+ ajoLogLevel = new AndroidJavaClass("com.adjust.sdk.LogLevel").GetStatic(adjustConfig.LogLevel.Value.ToUppercaseString());
+ }
+
+ if (ajoLogLevel != null)
+ {
+ ajoAdjustConfig.Call("setLogLevel", ajoLogLevel);
+ }
+ }
+
+ // set Unity SDK prefix
+ ajoAdjustConfig.Call("setSdkPrefix", sdkPrefix);
+
+ // check read device IDs only once
+ if (adjustConfig.IsDeviceIdsReadingOnceEnabled != null)
+ {
+ if (adjustConfig.IsDeviceIdsReadingOnceEnabled == true)
+ {
+ ajoAdjustConfig.Call("enableDeviceIdsReadingOnce");
+ }
+ }
+
+ // check if COPPA compliance is enabled
+ if (adjustConfig.IsCoppaComplianceEnabled != null)
+ {
+ if (adjustConfig.IsCoppaComplianceEnabled == true)
+ {
+ ajoAdjustConfig.Call("enableCoppaCompliance");
+ }
+ }
+
+ // check if Play Store Kids compliance is enabled
+ if (adjustConfig.IsPlayStoreKidsComplianceEnabled != null)
+ {
+ if (adjustConfig.IsPlayStoreKidsComplianceEnabled == true)
+ {
+ ajoAdjustConfig.Call("enablePlayStoreKidsCompliance");
+ }
+ }
+
+ // check if user enabled sening in the background
+ if (adjustConfig.IsSendingInBackgroundEnabled != null)
+ {
+ if (adjustConfig.IsSendingInBackgroundEnabled == true)
+ {
+ ajoAdjustConfig.Call("enableSendingInBackground");
+ }
+ }
+
+ // check if user wants to get cost data in attribution callback
+ if (adjustConfig.IsCostDataInAttributionEnabled != null)
+ {
+ if (adjustConfig.IsCostDataInAttributionEnabled == true)
+ {
+ ajoAdjustConfig.Call("enableCostDataInAttribution");
+ }
+ }
+
+ // check if user wants to run preinstall campaigns
+ if (adjustConfig.IsPreinstallTrackingEnabled != null)
+ {
+ if (adjustConfig.IsPreinstallTrackingEnabled == true)
+ {
+ ajoAdjustConfig.Call("enablePreinstallTracking");
+ }
+ }
+
+ // check if first session delay has been enabled
+ if (adjustConfig.IsFirstSessionDelayEnabled != null)
+ {
+ if (adjustConfig.IsFirstSessionDelayEnabled == true)
+ {
+ ajoAdjustConfig.Call("enableFirstSessionDelay");
+ }
+ }
+
+ // check if user has set custom preinstall file path
+ if (adjustConfig.PreinstallFilePath != null)
+ {
+ ajoAdjustConfig.Call("setPreinstallFilePath", adjustConfig.PreinstallFilePath);
+ }
+
+ // check if FB app ID has been set
+ if (adjustConfig.FbAppId != null)
+ {
+ ajoAdjustConfig.Call("setFbAppId", adjustConfig.FbAppId);
+ }
+
+ // check if user has set default tracker token
+ if (adjustConfig.DefaultTracker != null)
+ {
+ ajoAdjustConfig.Call("setDefaultTracker", adjustConfig.DefaultTracker);
+ }
+
+ // check if user has set external device identifier
+ if (adjustConfig.ExternalDeviceId != null)
+ {
+ ajoAdjustConfig.Call("setExternalDeviceId", adjustConfig.ExternalDeviceId);
+ }
+
+ // check if user has set max number of event deduplication IDs
+ if (adjustConfig.EventDeduplicationIdsMaxSize != null)
+ {
+ using (AndroidJavaObject ajoEventDeduplicationIdsMaxSize = new AndroidJavaObject("java.lang.Integer", adjustConfig.EventDeduplicationIdsMaxSize))
+ {
+ ajoAdjustConfig.Call("setEventDeduplicationIdsMaxSize", ajoEventDeduplicationIdsMaxSize);
+ }
+ }
+
+ // check if user has set custom URL strategy
+ if (adjustConfig.UrlStrategyDomains != null &&
+ adjustConfig.ShouldUseSubdomains != null &&
+ adjustConfig.IsDataResidency != null)
+ {
+ using (var ajoUrlStrategyDomains = new AndroidJavaObject("java.util.ArrayList"))
+ {
+ foreach (string domain in adjustConfig.UrlStrategyDomains)
+ {
+ ajoUrlStrategyDomains.Call("add", domain);
+ }
+ ajoAdjustConfig.Call("setUrlStrategy",
+ ajoUrlStrategyDomains,
+ adjustConfig.ShouldUseSubdomains,
+ adjustConfig.IsDataResidency);
+ }
+ }
+
+ // check if custom store info has been set
+ if (adjustConfig.StoreInfo != null)
+ {
+ if (adjustConfig.StoreInfo.StoreName != null)
+ {
+ using (AndroidJavaObject ajoAdjustStoreInfo =
+ new AndroidJavaObject("com.adjust.sdk.AdjustStoreInfo", adjustConfig.StoreInfo.StoreName))
+ {
+ if (adjustConfig.StoreInfo.StoreAppId != null)
+ {
+ ajoAdjustStoreInfo.Call("setStoreAppId", adjustConfig.StoreInfo.StoreAppId);
+ }
+ ajoAdjustConfig.Call("setStoreInfo", ajoAdjustStoreInfo);
+ }
+ }
+ }
+
+ // check attribution changed delagate
+ if (adjustConfig.AttributionChangedDelegate != null)
+ {
+ onAttributionChangedListener = new AttributionChangedListener(adjustConfig.AttributionChangedDelegate);
+ ajoAdjustConfig.Call("setOnAttributionChangedListener", onAttributionChangedListener);
+ }
+
+ // check event success delegate
+ if (adjustConfig.EventSuccessDelegate != null)
+ {
+ onEventTrackingSucceededListener = new EventTrackingSucceededListener(adjustConfig.EventSuccessDelegate);
+ ajoAdjustConfig.Call("setOnEventTrackingSucceededListener", onEventTrackingSucceededListener);
+ }
+
+ // check event failure delagate
+ if (adjustConfig.EventFailureDelegate != null)
+ {
+ onEventTrackingFailedListener = new EventTrackingFailedListener(adjustConfig.EventFailureDelegate);
+ ajoAdjustConfig.Call("setOnEventTrackingFailedListener", onEventTrackingFailedListener);
+ }
+
+ // check session success delegate
+ if (adjustConfig.SessionSuccessDelegate != null)
+ {
+ onSessionTrackingSucceededListener = new SessionTrackingSucceededListener(adjustConfig.SessionSuccessDelegate);
+ ajoAdjustConfig.Call("setOnSessionTrackingSucceededListener", onSessionTrackingSucceededListener);
+ }
+
+ // check session failure delegate
+ if (adjustConfig.SessionFailureDelegate != null)
+ {
+ onSessionTrackingFailedListener = new SessionTrackingFailedListener(adjustConfig.SessionFailureDelegate);
+ ajoAdjustConfig.Call("setOnSessionTrackingFailedListener", onSessionTrackingFailedListener);
+ }
+
+ // check deferred deeplink delegate
+ if (adjustConfig.DeferredDeeplinkDelegate != null)
+ {
+ onDeferredDeeplinkListener = new DeferredDeeplinkListener(adjustConfig.DeferredDeeplinkDelegate);
+ ajoAdjustConfig.Call("setOnDeferredDeeplinkResponseListener", onDeferredDeeplinkListener);
+ }
+
+ // initialise and start the SDK
+ ajcAdjust.CallStatic("initSdk", ajoAdjustConfig);
+ }
+ }
+
+ public static void TrackEvent(AdjustEvent adjustEvent)
+ {
+ using (AndroidJavaObject ajoAdjustEvent =
+ new AndroidJavaObject("com.adjust.sdk.AdjustEvent", adjustEvent.EventToken))
+ {
+ // check if user has set revenue for the event
+ if (adjustEvent.Revenue != null)
+ {
+ ajoAdjustEvent.Call("setRevenue", (double)adjustEvent.Revenue, adjustEvent.Currency);
+ }
+
+ // check if user has added any callback parameters to the event
+ if (adjustEvent.CallbackParameters != null)
+ {
+ for (int i = 0; i < adjustEvent.CallbackParameters.Count; i += 2)
+ {
+ string key = adjustEvent.CallbackParameters[i];
+ string value = adjustEvent.CallbackParameters[i + 1];
+ ajoAdjustEvent.Call("addCallbackParameter", key, value);
+ }
+ }
+
+ // check if user has added any partner parameters to the event
+ if (adjustEvent.PartnerParameters != null)
+ {
+ for (int i = 0; i < adjustEvent.PartnerParameters.Count; i += 2)
+ {
+ string key = adjustEvent.PartnerParameters[i];
+ string value = adjustEvent.PartnerParameters[i + 1];
+ ajoAdjustEvent.Call("addPartnerParameter", key, value);
+ }
+ }
+
+ // check if user has set deduplication ID for the event
+ if (adjustEvent.DeduplicationId != null)
+ {
+ ajoAdjustEvent.Call("setDeduplicationId", adjustEvent.DeduplicationId);
+ }
+
+ // check if user has added callback ID to the event
+ if (adjustEvent.CallbackId != null)
+ {
+ ajoAdjustEvent.Call("setCallbackId", adjustEvent.CallbackId);
+ }
+
+ // check if user has added product ID to the event
+ if (adjustEvent.ProductId != null)
+ {
+ ajoAdjustEvent.Call("setProductId", adjustEvent.ProductId);
+ }
+
+ // check if user has added purchase token to the event
+ if (adjustEvent.PurchaseToken != null)
+ {
+ ajoAdjustEvent.Call("setPurchaseToken", adjustEvent.PurchaseToken);
+ }
+
+ // track the event
+ ajcAdjust.CallStatic("trackEvent", ajoAdjustEvent);
+ }
+ }
+
+ public static void Enable()
+ {
+ ajcAdjust.CallStatic("enable");
+ }
+
+ public static void Disable()
+ {
+ ajcAdjust.CallStatic("disable");
+ }
+
+ public static void SwitchToOfflineMode()
+ {
+ ajcAdjust.CallStatic("switchToOfflineMode");
+ }
+
+ public static void SwitchBackToOnlineMode()
+ {
+ ajcAdjust.CallStatic("switchBackToOnlineMode");
+ }
+
+ public static void EnableCoppaCompliance()
+ {
+ ajcAdjust.CallStatic("enableCoppaCompliance", ajoCurrentActivity);
+ }
+
+ public static void DisableCoppaCompliance()
+ {
+ ajcAdjust.CallStatic("disableCoppaCompliance", ajoCurrentActivity);
+ }
+
+ public static void EnablePlayStoreKidsApp()
+ {
+ ajcAdjust.CallStatic("enablePlayStoreKidsApp", ajoCurrentActivity);
+ }
+
+ public static void DisablePlayStoreKidsApp()
+ {
+ ajcAdjust.CallStatic("disablePlayStoreKidsApp", ajoCurrentActivity);
+ }
+
+ public static void SetPushToken(string pushToken)
+ {
+ ajcAdjust.CallStatic("setPushToken", pushToken, ajoCurrentActivity);
+ }
+
+ public static void GdprForgetMe()
+ {
+ ajcAdjust.CallStatic("gdprForgetMe", ajoCurrentActivity);
+ }
+
+ public static void AddGlobalPartnerParameter(string key, string value)
+ {
+ if (ajcAdjust == null)
+ {
+ ajcAdjust = new AndroidJavaClass("com.adjust.sdk.Adjust");
+ }
+ ajcAdjust.CallStatic("addGlobalPartnerParameter", key, value);
+ }
+
+ public static void AddGlobalCallbackParameter(string key, string value)
+ {
+ if (ajcAdjust == null)
+ {
+ ajcAdjust = new AndroidJavaClass("com.adjust.sdk.Adjust");
+ }
+ ajcAdjust.CallStatic("addGlobalCallbackParameter", key, value);
+ }
+
+ public static void RemoveGlobalPartnerParameter(string key)
+ {
+ if (ajcAdjust == null)
+ {
+ ajcAdjust = new AndroidJavaClass("com.adjust.sdk.Adjust");
+ }
+ ajcAdjust.CallStatic("removeGlobalPartnerParameter", key);
+ }
+
+ public static void RemoveGlobalCallbackParameter(string key)
+ {
+ if (ajcAdjust == null)
+ {
+ ajcAdjust = new AndroidJavaClass("com.adjust.sdk.Adjust");
+ }
+ ajcAdjust.CallStatic("removeGlobalCallbackParameter", key);
+ }
+
+ public static void RemoveGlobalPartnerParameters()
+ {
+ if (ajcAdjust == null)
+ {
+ ajcAdjust = new AndroidJavaClass("com.adjust.sdk.Adjust");
+ }
+ ajcAdjust.CallStatic("removeGlobalPartnerParameters");
+ }
+
+ public static void RemoveGlobalCallbackParameters()
+ {
+ if (ajcAdjust == null)
+ {
+ ajcAdjust = new AndroidJavaClass("com.adjust.sdk.Adjust");
+ }
+ ajcAdjust.CallStatic("removeGlobalCallbackParameters");
+ }
+
+ public static void ProcessDeeplink(AdjustDeeplink deeplink)
+ {
+ using (AndroidJavaClass ajcUri = new AndroidJavaClass("android.net.Uri"))
+ using (AndroidJavaObject ajoUri = ajcUri.CallStatic("parse", deeplink.Deeplink))
+ using (AndroidJavaObject ajoAdjustDeeplink = new AndroidJavaObject("com.adjust.sdk.AdjustDeeplink", ajoUri))
+ {
+ if (deeplink.Referrer != null)
+ {
+ using (AndroidJavaObject ajoReferrer = ajcUri.CallStatic("parse", deeplink.Referrer))
+ {
+ ajoAdjustDeeplink.Call("setReferrer", ajoReferrer);
+ }
+ }
+
+ ajcAdjust.CallStatic("processDeeplink", ajoAdjustDeeplink, ajoCurrentActivity);
+ }
+ }
+
+ public static void TrackAdRevenue(AdjustAdRevenue adRevenue)
+ {
+ using (AndroidJavaObject ajoAdjustAdRevenue =
+ new AndroidJavaObject("com.adjust.sdk.AdjustAdRevenue", adRevenue.Source))
+ {
+ // check if user has set revenue
+ if (adRevenue.Revenue != null)
+ {
+ using (AndroidJavaObject ajoRevenue = new AndroidJavaObject("java.lang.Double", adRevenue.Revenue))
+ {
+ ajoAdjustAdRevenue.Call("setRevenue", ajoRevenue, adRevenue.Currency);
+ }
+ }
+
+ // check if user has set ad impressions count
+ if (adRevenue.AdImpressionsCount != null)
+ {
+ using (AndroidJavaObject ajoAdImpressionsCount =
+ new AndroidJavaObject("java.lang.Integer", adRevenue.AdImpressionsCount))
+ {
+ ajoAdjustAdRevenue.Call("setAdImpressionsCount", ajoAdImpressionsCount);
+ }
+ }
+
+ // check if user has set ad revenue network
+ if (adRevenue.AdRevenueNetwork != null)
+ {
+ ajoAdjustAdRevenue.Call("setAdRevenueNetwork", adRevenue.AdRevenueNetwork);
+ }
+
+ // check if user has set ad revenue unit
+ if (adRevenue.AdRevenueUnit != null)
+ {
+ ajoAdjustAdRevenue.Call("setAdRevenueUnit", adRevenue.AdRevenueUnit);
+ }
+
+ // check if user has set ad revenue placement
+ if (adRevenue.AdRevenuePlacement != null)
+ {
+ ajoAdjustAdRevenue.Call("setAdRevenuePlacement", adRevenue.AdRevenuePlacement);
+ }
+
+ // check if user has added any callback parameters
+ if (adRevenue.CallbackParameters != null)
+ {
+ for (int i = 0; i < adRevenue.CallbackParameters.Count; i += 2)
+ {
+ string key = adRevenue.CallbackParameters[i];
+ string value = adRevenue.CallbackParameters[i + 1];
+ ajoAdjustAdRevenue.Call("addCallbackParameter", key, value);
+ }
+ }
+
+ // check if user has added any partner parameters
+ if (adRevenue.PartnerParameters != null)
+ {
+ for (int i = 0; i < adRevenue.PartnerParameters.Count; i += 2)
+ {
+ string key = adRevenue.PartnerParameters[i];
+ string value = adRevenue.PartnerParameters[i + 1];
+ ajoAdjustAdRevenue.Call("addPartnerParameter", key, value);
+ }
+ }
+
+ // track ad revenue
+ ajcAdjust.CallStatic("trackAdRevenue", ajoAdjustAdRevenue);
+ }
+ }
+
+ public static void TrackPlayStoreSubscription(AdjustPlayStoreSubscription subscription)
+ {
+ using (AndroidJavaObject ajoSubscription = new AndroidJavaObject(
+ "com.adjust.sdk.AdjustPlayStoreSubscription",
+ Convert.ToInt64(subscription.Price),
+ subscription.Currency,
+ subscription.ProductId,
+ subscription.OrderId,
+ subscription.Signature,
+ subscription.PurchaseToken))
+ {
+ // check if user has set purchase time for subscription
+ if (subscription.PurchaseTime != null)
+ {
+ ajoSubscription.Call("setPurchaseTime", Convert.ToInt64(subscription.PurchaseTime));
+ }
+
+ // check if user has added any callback parameters to the subscription
+ if (subscription.CallbackParameters != null)
+ {
+ for (int i = 0; i < subscription.CallbackParameters.Count; i += 2)
+ {
+ string key = subscription.CallbackParameters[i];
+ string value = subscription.CallbackParameters[i + 1];
+ ajoSubscription.Call("addCallbackParameter", key, value);
+ }
+ }
+
+ // check if user has added any partner parameters to the subscription
+ if (subscription.PartnerParameters != null)
+ {
+ for (int i = 0; i < subscription.PartnerParameters.Count; i += 2)
+ {
+ string key = subscription.PartnerParameters[i];
+ string value = subscription.PartnerParameters[i + 1];
+ ajoSubscription.Call("addPartnerParameter", key, value);
+ }
+ }
+
+ // track the subscription
+ ajcAdjust.CallStatic("trackPlayStoreSubscription", ajoSubscription);
+ }
+ }
+
+ public static void TrackThirdPartySharing(AdjustThirdPartySharing thirdPartySharing)
+ {
+ using (var ajoAdjustThirdPartySharing =
+ thirdPartySharing.IsEnabled != null
+ ? new AndroidJavaObject("com.adjust.sdk.AdjustThirdPartySharing",
+ new AndroidJavaObject("java.lang.Boolean", thirdPartySharing.IsEnabled.Value))
+ : new AndroidJavaObject("com.adjust.sdk.AdjustThirdPartySharing", (object)null))
+ {
+ if (thirdPartySharing.GranularOptions != null)
+ {
+ for (int i = 0; i < thirdPartySharing.GranularOptions.Count;)
+ {
+ string partnerName = thirdPartySharing.GranularOptions[i++];
+ string key = thirdPartySharing.GranularOptions[i++];
+ string value = thirdPartySharing.GranularOptions[i++];
+ ajoAdjustThirdPartySharing.Call("addGranularOption", partnerName, key, value);
+ }
+ }
+
+ if (thirdPartySharing.PartnerSharingSettings != null)
+ {
+ for (int i = 0; i < thirdPartySharing.PartnerSharingSettings.Count;)
+ {
+ string partnerName = thirdPartySharing.PartnerSharingSettings[i++];
+ string key = thirdPartySharing.PartnerSharingSettings[i++];
+ string value = thirdPartySharing.PartnerSharingSettings[i++];
+ ajoAdjustThirdPartySharing.Call("addPartnerSharingSetting", partnerName, key, bool.Parse(value));
+ }
+ }
+
+ ajcAdjust.CallStatic("trackThirdPartySharing", ajoAdjustThirdPartySharing);
+ }
+ }
+
+ public static void TrackMeasurementConsent(bool measurementConsent)
+ {
+ ajcAdjust.CallStatic("trackMeasurementConsent", measurementConsent);
+ }
+
+ public static void IsEnabled(Action onIsEnabled)
+ {
+ IsEnabledListener isEnabledProxy = new IsEnabledListener(onIsEnabled);
+ ajcAdjust.CallStatic("isEnabled", ajoCurrentActivity, isEnabledProxy);
+ }
+
+ public static void GetAdid(Action onAdidRead)
+ {
+ AdidReadListener onAdidReadProxy = new AdidReadListener(onAdidRead);
+ ajcAdjust.CallStatic("getAdid", onAdidReadProxy);
+ }
+
+ public static void GetAttribution(Action onAttributionRead)
+ {
+ AttributionReadListener onAttributionReadProxy = new AttributionReadListener(onAttributionRead);
+ ajcAdjust.CallStatic("getAttribution", onAttributionReadProxy);
+ }
+
+ public static void GetSdkVersion(Action onSdkVersionRead)
+ {
+ SdkVersionReadListener onSdkVersionReadProxy = new SdkVersionReadListener(onSdkVersionRead, sdkPrefix);
+ ajcAdjust.CallStatic("getSdkVersion", onSdkVersionReadProxy);
+ }
+
+ public static void GetLastDeeplink(Action onLastDeeplinkRead)
+ {
+ LastDeeplinkListener onLastDeeplinkReadProxy = new LastDeeplinkListener(onLastDeeplinkRead);
+ ajcAdjust.CallStatic("getLastDeeplink", ajoCurrentActivity, onLastDeeplinkReadProxy);
+ }
+
+ public static void EndFirstSessionDelay()
+ {
+ ajcAdjust.CallStatic("endFirstSessionDelay");
+ }
+
+ public static void EnableCoppaComplianceInDelay()
+ {
+ ajcAdjust.CallStatic("enableCoppaComplianceInDelay");
+ }
+
+ public static void DisableCoppaComplianceInDelay()
+ {
+ ajcAdjust.CallStatic("disableCoppaComplianceInDelay");
+ }
+
+ public static void SetExternalDeviceIdInDelay(string externalDeviceId)
+ {
+ ajcAdjust.CallStatic("setExternalDeviceIdInDelay", externalDeviceId);
+ }
+
+ // android specific methods
+ public static void GetGoogleAdId(Action onDeviceIdsRead)
+ {
+ GoogleAdIdReadListener onDeviceIdsReadProxy = new GoogleAdIdReadListener(onDeviceIdsRead);
+ ajcAdjust.CallStatic("getGoogleAdId", ajoCurrentActivity, onDeviceIdsReadProxy);
+ }
+
+ public static void GetAmazonAdId(Action onAmazonAdIdRead)
+ {
+ AmazonAdIdReadListener onAmazonAdIdReadProxy = new AmazonAdIdReadListener(onAmazonAdIdRead);
+ ajcAdjust.CallStatic("getAmazonAdId", ajoCurrentActivity, onAmazonAdIdReadProxy);
+ }
+
+ public static void VerifyPlayStorePurchase(
+ AdjustPlayStorePurchase purchase,
+ Action verificationInfoCallback)
+ {
+ VerificationResultListener verificationResultListener = new VerificationResultListener(verificationInfoCallback);
+ using (AndroidJavaObject ajoPurchase = new AndroidJavaObject("com.adjust.sdk.AdjustPlayStorePurchase",
+ purchase.ProductId,
+ purchase.PurchaseToken))
+ {
+ ajcAdjust.CallStatic("verifyPlayStorePurchase", ajoPurchase, verificationResultListener);
+ }
+ }
+
+ public static void ProcessAndResolveDeeplink(AdjustDeeplink deeplink, Action resolvedLinkCallback)
+ {
+ onDeeplinkResolvedListener = new DeeplinkResolutionListener(resolvedLinkCallback);
+ using (AndroidJavaClass ajcUri = new AndroidJavaClass("android.net.Uri"))
+ using (AndroidJavaObject ajoUri = ajcUri.CallStatic("parse", deeplink.Deeplink))
+ using (AndroidJavaObject ajoAdjustDeeplink = new AndroidJavaObject("com.adjust.sdk.AdjustDeeplink", ajoUri))
+ {
+ if (deeplink.Referrer != null)
+ {
+ using (AndroidJavaObject ajoReferrer = ajcUri.CallStatic("parse", deeplink.Referrer))
+ {
+ ajoAdjustDeeplink.Call("setReferrer", ajoReferrer);
+ }
+ }
+
+ ajcAdjust.CallStatic(
+ "processAndResolveDeeplink",
+ ajoAdjustDeeplink,
+ ajoCurrentActivity,
+ onDeeplinkResolvedListener);
+ }
+ }
+
+ public static void VerifyAndTrackPlayStorePurchase(
+ AdjustEvent adjustEvent,
+ Action verificationInfoCallback)
+ {
+ VerificationResultListener verifyAndTrackListener = new VerificationResultListener(verificationInfoCallback);
+ using (AndroidJavaObject ajoAdjustEvent =
+ new AndroidJavaObject("com.adjust.sdk.AdjustEvent", adjustEvent.EventToken))
+ {
+ // check if user has set revenue for the event
+ if (adjustEvent.Revenue != null)
+ {
+ ajoAdjustEvent.Call("setRevenue", (double)adjustEvent.Revenue, adjustEvent.Currency);
+ }
+
+ // check if user has added any callback parameters to the event
+ if (adjustEvent.CallbackParameters != null)
+ {
+ for (int i = 0; i < adjustEvent.CallbackParameters.Count; i += 2)
+ {
+ string key = adjustEvent.CallbackParameters[i];
+ string value = adjustEvent.CallbackParameters[i + 1];
+ ajoAdjustEvent.Call("addCallbackParameter", key, value);
+ }
+ }
+
+ // check if user has added any partner parameters to the event
+ if (adjustEvent.PartnerParameters != null)
+ {
+ for (int i = 0; i < adjustEvent.PartnerParameters.Count; i += 2)
+ {
+ string key = adjustEvent.PartnerParameters[i];
+ string value = adjustEvent.PartnerParameters[i + 1];
+ ajoAdjustEvent.Call("addPartnerParameter", key, value);
+ }
+ }
+
+ // check if user has set deduplication ID for the event
+ if (adjustEvent.DeduplicationId != null)
+ {
+ ajoAdjustEvent.Call("setDeduplicationId", adjustEvent.DeduplicationId);
+ }
+
+ // check if user has added callback ID to the event
+ if (adjustEvent.CallbackId != null)
+ {
+ ajoAdjustEvent.Call("setCallbackId", adjustEvent.CallbackId);
+ }
+
+ // check if user has added product ID to the event
+ if (adjustEvent.ProductId != null)
+ {
+ ajoAdjustEvent.Call("setProductId", adjustEvent.ProductId);
+ }
+
+ // check if user has added purchase token to the event
+ if (adjustEvent.PurchaseToken != null)
+ {
+ ajoAdjustEvent.Call("setPurchaseToken", adjustEvent.PurchaseToken);
+ }
+
+ ajcAdjust.CallStatic("verifyAndTrackPlayStorePurchase", ajoAdjustEvent, verifyAndTrackListener);
+ }
+ }
+
+ public static void EnablePlayStoreKidsComplianceInDelay()
+ {
+ ajcAdjust.CallStatic("enablePlayStoreKidsComplianceInDelay");
+ }
+
+ public static void DisablePlayStoreKidsComplianceInDelay()
+ {
+ ajcAdjust.CallStatic("disablePlayStoreKidsComplianceInDelay");
+ }
+
+ // used for testing only
+ public static void SetTestOptions(Dictionary testOptions)
+ {
+ using (AndroidJavaObject ajoTestOptions = AdjustUtils.TestOptionsMap2AndroidJavaObject(testOptions, ajoCurrentActivity))
+ {
+ ajcAdjust.CallStatic("setTestOptions", ajoTestOptions);
+ }
+ }
+
+ public static void OnResume(string testingArgument = null)
+ {
+ if (testingArgument == "test")
+ {
+ ajcAdjust.CallStatic("onResume");
+ }
+ }
+
+ public static void OnPause(string testingArgument = null)
+ {
+ if (testingArgument == "test")
+ {
+ ajcAdjust.CallStatic("onPause");
+ }
+ }
+
+ // private & helper classes
+ private class AttributionChangedListener : AndroidJavaProxy
+ {
+ private Action callback;
+
+ public AttributionChangedListener(Action pCallback)
+ : base("com.adjust.sdk.OnAttributionChangedListener")
+ {
+ this.callback = pCallback;
+ }
+
+ // native method:
+ // void onAttributionChanged(AdjustAttribution attribution);
+ public void onAttributionChanged(AndroidJavaObject ajoAttribution)
+ {
+ if (this.callback == null)
+ {
+ return;
+ }
+
+ AdjustThreadDispatcher.RunOnMainThread(() =>
+ {
+ try
+ {
+ if (ajoAttribution == null)
+ {
+ if (callback != null)
+ {
+ callback.Invoke(null);
+ }
+ return;
+ }
+
+ AdjustAttribution adjustAttribution = new AdjustAttribution
+ {
+ TrackerName = AdjustUtils.GetValueOrEmptyToNull(ajoAttribution.Get(AdjustUtils.KeyTrackerName)),
+ TrackerToken = AdjustUtils.GetValueOrEmptyToNull(ajoAttribution.Get(AdjustUtils.KeyTrackerToken)),
+ Network = AdjustUtils.GetValueOrEmptyToNull(ajoAttribution.Get(AdjustUtils.KeyNetwork)),
+ Campaign = AdjustUtils.GetValueOrEmptyToNull(ajoAttribution.Get(AdjustUtils.KeyCampaign)),
+ Adgroup = AdjustUtils.GetValueOrEmptyToNull(ajoAttribution.Get(AdjustUtils.KeyAdgroup)),
+ Creative = AdjustUtils.GetValueOrEmptyToNull(ajoAttribution.Get(AdjustUtils.KeyCreative)),
+ ClickLabel = AdjustUtils.GetValueOrEmptyToNull(ajoAttribution.Get(AdjustUtils.KeyClickLabel)),
+ CostType = AdjustUtils.GetValueOrEmptyToNull(ajoAttribution.Get(AdjustUtils.KeyCostType)),
+ CostCurrency = AdjustUtils.GetValueOrEmptyToNull(ajoAttribution.Get(AdjustUtils.KeyCostCurrency)),
+ FbInstallReferrer = AdjustUtils.GetValueOrEmptyToNull(ajoAttribution.Get(AdjustUtils.KeyFbInstallReferrer))
+ };
+
+ using (AndroidJavaObject ajoCostAmount = ajoAttribution.Get(AdjustUtils.KeyCostAmount))
+ {
+ adjustAttribution.CostAmount = ajoCostAmount != null ? ajoCostAmount.Call("doubleValue") : (double?)null;
+ }
+
+ string jsonResponse = ajoAttribution.Get(AdjustUtils.KeyJsonResponse);
+ if (jsonResponse != null) {
+ var jsonResponseNode = JSON.Parse(jsonResponse);
+ if (jsonResponseNode != null && jsonResponseNode.AsObject != null)
+ {
+ adjustAttribution.JsonResponse = new Dictionary();
+ AdjustUtils.WriteJsonResponseDictionary(jsonResponseNode.AsObject, adjustAttribution.JsonResponse);
+ }
+ }
+
+ if (callback != null)
+ {
+ callback.Invoke(adjustAttribution);
+ }
+ }
+ catch (Exception)
+ {
+ // JSON response reading failed.
+ }
+ });
+ }
+ }
+
+ private class DeferredDeeplinkListener : AndroidJavaProxy
+ {
+ private Action callback;
+
+ public DeferredDeeplinkListener(Action pCallback)
+ : base("com.adjust.sdk.OnDeferredDeeplinkResponseListener")
+ {
+ this.callback = pCallback;
+ }
+
+ // native method:
+ // boolean launchReceivedDeeplink(Uri deeplink);
+ public bool launchReceivedDeeplink(AndroidJavaObject deeplink)
+ {
+ if (this.callback == null)
+ {
+ return isDeferredDeeplinkOpeningEnabled;
+ }
+
+ AdjustThreadDispatcher.RunOnMainThread(() =>
+ {
+ string strDeeplink = deeplink != null ? deeplink.Call("toString") : null;
+ if (callback != null)
+ {
+ callback.Invoke(strDeeplink);
+ }
+ });
+
+ return isDeferredDeeplinkOpeningEnabled;
+ }
+ }
+
+ private class EventTrackingSucceededListener : AndroidJavaProxy
+ {
+ private Action callback;
+
+ public EventTrackingSucceededListener(Action pCallback) : base("com.adjust.sdk.OnEventTrackingSucceededListener")
+ {
+ this.callback = pCallback;
+ }
+
+ // native method:
+ // void onEventTrackingSucceeded(AdjustEventSuccess eventSuccessResponseData);
+ public void onEventTrackingSucceeded(AndroidJavaObject eventSuccessData)
+ {
+ if (this.callback == null)
+ {
+ return;
+ }
+
+ AdjustThreadDispatcher.RunOnMainThread(() =>
+ {
+ try
+ {
+ AdjustEventSuccess adjustEventSuccess = new AdjustEventSuccess
+ {
+ Adid = AdjustUtils.GetValueOrEmptyToNull(eventSuccessData.Get(AdjustUtils.KeyAdid)),
+ Message = AdjustUtils.GetValueOrEmptyToNull(eventSuccessData.Get(AdjustUtils.KeyMessage)),
+ Timestamp = AdjustUtils.GetValueOrEmptyToNull(eventSuccessData.Get(AdjustUtils.KeyTimestamp)),
+ EventToken = AdjustUtils.GetValueOrEmptyToNull(eventSuccessData.Get(AdjustUtils.KeyEventToken)),
+ CallbackId = AdjustUtils.GetValueOrEmptyToNull(eventSuccessData.Get(AdjustUtils.KeyCallbackId))
+ };
+
+ using (AndroidJavaObject ajoJsonResponse = eventSuccessData.Get(AdjustUtils.KeyJsonResponse))
+ {
+ if (ajoJsonResponse != null)
+ {
+ string jsonResponseString = ajoJsonResponse.Call("toString");
+ adjustEventSuccess.BuildJsonResponseFromString(jsonResponseString);
+ }
+ }
+
+ if (callback != null)
+ {
+ callback.Invoke(adjustEventSuccess);
+ }
+ }
+ catch (Exception)
+ {
+ // JSON response reading failed.
+ // Native Android SDK should send empty JSON object if none available as of v4.12.5.
+ // Native Android SDK added special logic to send Unity friendly values as of v4.15.0.
+ }
+ });
+ }
+ }
+
+ private class EventTrackingFailedListener : AndroidJavaProxy
+ {
+ private Action callback;
+
+ public EventTrackingFailedListener(Action pCallback) : base("com.adjust.sdk.OnEventTrackingFailedListener")
+ {
+ this.callback = pCallback;
+ }
+
+ // native method:
+ // void onEventTrackingFailed(AdjustEventFailure eventFailureResponseData);
+ public void onEventTrackingFailed(AndroidJavaObject eventFailureData)
+ {
+ if (this.callback == null)
+ {
+ return;
+ }
+
+ AdjustThreadDispatcher.RunOnMainThread(() =>
+ {
+ try
+ {
+ AdjustEventFailure adjustEventFailure = new AdjustEventFailure
+ {
+ Adid = AdjustUtils.GetValueOrEmptyToNull(eventFailureData.Get(AdjustUtils.KeyAdid)),
+ Message = AdjustUtils.GetValueOrEmptyToNull(eventFailureData.Get(AdjustUtils.KeyMessage)),
+ Timestamp = AdjustUtils.GetValueOrEmptyToNull(eventFailureData.Get(AdjustUtils.KeyTimestamp)),
+ EventToken = AdjustUtils.GetValueOrEmptyToNull(eventFailureData.Get(AdjustUtils.KeyEventToken)),
+ CallbackId = AdjustUtils.GetValueOrEmptyToNull(eventFailureData.Get(AdjustUtils.KeyCallbackId)),
+ WillRetry = eventFailureData.Get(AdjustUtils.KeyWillRetry)
+ };
+
+ using (AndroidJavaObject ajoJsonResponse = eventFailureData.Get(AdjustUtils.KeyJsonResponse))
+ {
+ if (ajoJsonResponse != null)
+ {
+ string jsonResponseString = ajoJsonResponse.Call("toString");
+ adjustEventFailure.BuildJsonResponseFromString(jsonResponseString);
+ }
+ }
+
+ if (callback != null)
+ {
+ callback.Invoke(adjustEventFailure);
+ }
+ }
+ catch (Exception)
+ {
+ // JSON response reading failed.
+ // Native Android SDK should send empty JSON object if none available as of v4.12.5.
+ // Native Android SDK added special logic to send Unity friendly values as of v4.15.0.
+ }
+ });
+ }
+ }
+
+ private class SessionTrackingSucceededListener : AndroidJavaProxy
+ {
+ private Action callback;
+
+ public SessionTrackingSucceededListener(Action pCallback)
+ : base("com.adjust.sdk.OnSessionTrackingSucceededListener")
+ {
+ this.callback = pCallback;
+ }
+
+ // native method:
+ // void onSessionTrackingSucceeded(AdjustSessionSuccess sessionSuccessResponseData);
+ public void onSessionTrackingSucceeded(AndroidJavaObject sessionSuccessData)
+ {
+ if (this.callback == null)
+ {
+ return;
+ }
+
+ AdjustThreadDispatcher.RunOnMainThread(() =>
+ {
+ try
+ {
+ AdjustSessionSuccess adjustSessionSuccess = new AdjustSessionSuccess
+ {
+ Adid = AdjustUtils.GetValueOrEmptyToNull(sessionSuccessData.Get(AdjustUtils.KeyAdid)),
+ Message = AdjustUtils.GetValueOrEmptyToNull(sessionSuccessData.Get(AdjustUtils.KeyMessage)),
+ Timestamp = AdjustUtils.GetValueOrEmptyToNull(sessionSuccessData.Get(AdjustUtils.KeyTimestamp))
+ };
+
+ using (AndroidJavaObject ajoJsonResponse = sessionSuccessData.Get(AdjustUtils.KeyJsonResponse))
+ {
+ if (ajoJsonResponse != null)
+ {
+ string jsonResponseString = ajoJsonResponse.Call("toString");
+ adjustSessionSuccess.BuildJsonResponseFromString(jsonResponseString);
+ }
+ }
+
+ if (callback != null)
+ {
+ callback.Invoke(adjustSessionSuccess);
+ }
+ }
+ catch (Exception)
+ {
+ // JSON response reading failed.
+ // Native Android SDK should send empty JSON object if none available as of v4.12.5.
+ // Native Android SDK added special logic to send Unity friendly values as of v4.15.0.
+ }
+ });
+ }
+ }
+
+ private class SessionTrackingFailedListener : AndroidJavaProxy
+ {
+ private Action callback;
+
+ public SessionTrackingFailedListener(Action pCallback)
+ : base("com.adjust.sdk.OnSessionTrackingFailedListener")
+ {
+ this.callback = pCallback;
+ }
+
+ // native method:
+ // void onSessionTrackingFailed(AdjustSessionFailure failureResponseData);
+ public void onSessionTrackingFailed(AndroidJavaObject sessionFailureData)
+ {
+ if (this.callback == null)
+ {
+ return;
+ }
+
+ AdjustThreadDispatcher.RunOnMainThread(() =>
+ {
+ try
+ {
+ AdjustSessionFailure adjustSessionFailure = new AdjustSessionFailure
+ {
+ Adid = AdjustUtils.GetValueOrEmptyToNull(sessionFailureData.Get(AdjustUtils.KeyAdid)),
+ Message = AdjustUtils.GetValueOrEmptyToNull(sessionFailureData.Get(AdjustUtils.KeyMessage)),
+ Timestamp = AdjustUtils.GetValueOrEmptyToNull(sessionFailureData.Get(AdjustUtils.KeyTimestamp)),
+ WillRetry = sessionFailureData.Get(AdjustUtils.KeyWillRetry)
+ };
+
+ using (AndroidJavaObject ajoJsonResponse = sessionFailureData.Get(AdjustUtils.KeyJsonResponse))
+ {
+ if (ajoJsonResponse != null)
+ {
+ string jsonResponseString = ajoJsonResponse.Call("toString");
+ adjustSessionFailure.BuildJsonResponseFromString(jsonResponseString);
+ }
+ }
+
+ if (callback != null)
+ {
+ callback.Invoke(adjustSessionFailure);
+ }
+ }
+ catch (Exception)
+ {
+ // JSON response reading failed.
+ // Native Android SDK should send empty JSON object if none available as of v4.12.5.
+ // Native Android SDK added special logic to send Unity friendly values as of v4.15.0.
+ }
+ });
+ }
+ }
+
+ private class GoogleAdIdReadListener : AndroidJavaProxy
+ {
+ private Action callback;
+
+ public GoogleAdIdReadListener(Action pCallback)
+ : base("com.adjust.sdk.OnGoogleAdIdReadListener")
+ {
+ this.callback = pCallback;
+ }
+
+ // native method:
+ // void onGoogleAdIdRead(String googleAdId);
+ public void onGoogleAdIdRead(string adid)
+ {
+ if (this.callback == null)
+ {
+ return;
+ }
+
+ AdjustThreadDispatcher.RunOnMainThread(() =>
+ {
+ if (callback != null)
+ {
+ callback.Invoke(adid);
+ }
+ });
+ }
+ }
+
+ private class VerificationResultListener : AndroidJavaProxy
+ {
+ private Action callback;
+
+ public VerificationResultListener(Action pCallback)
+ : base("com.adjust.sdk.OnPurchaseVerificationFinishedListener")
+ {
+ this.callback = pCallback;
+ }
+
+ // native method:
+ // void onVerificationFinished(AdjustPurchaseVerificationResult result);
+ public void onVerificationFinished(AndroidJavaObject ajoVerificationInfo)
+ {
+ if (this.callback == null)
+ {
+ return;
+ }
+
+ AdjustThreadDispatcher.RunOnMainThread(() =>
+ {
+ try
+ {
+ if (ajoVerificationInfo == null)
+ {
+ if (callback != null)
+ {
+ callback.Invoke(null);
+ }
+ return;
+ }
+
+ AdjustPurchaseVerificationResult purchaseVerificationResult = new AdjustPurchaseVerificationResult
+ {
+ VerificationStatus = ajoVerificationInfo.Get(AdjustUtils.KeyVerificationStatus),
+ Code = ajoVerificationInfo.Get(AdjustUtils.KeyCode),
+ Message = AdjustUtils.GetValueOrEmptyToNull(ajoVerificationInfo.Get(AdjustUtils.KeyMessage))
+ };
+
+ if (callback != null)
+ {
+ callback.Invoke(purchaseVerificationResult);
+ }
+ }
+ catch (Exception)
+ {
+ // Handle potential errors during the verification process
+ }
+ });
+ }
+ }
+
+ private class DeeplinkResolutionListener : AndroidJavaProxy
+ {
+ private Action callback;
+
+ public DeeplinkResolutionListener(Action pCallback)
+ : base("com.adjust.sdk.OnDeeplinkResolvedListener")
+ {
+ this.callback = pCallback;
+ }
+
+ // native method:
+ // void onDeeplinkResolved(String resolvedLink);
+ public void onDeeplinkResolved(string resolvedLink)
+ {
+ if (this.callback == null)
+ {
+ return;
+ }
+
+ AdjustThreadDispatcher.RunOnMainThread(() =>
+ {
+ if (callback != null)
+ {
+ callback.Invoke(resolvedLink);
+ }
+ });
+ }
+ }
+
+ private class AdidReadListener : AndroidJavaProxy
+ {
+ private Action callback;
+
+ public AdidReadListener(Action pCallback)
+ : base("com.adjust.sdk.OnAdidReadListener")
+ {
+ this.callback = pCallback;
+ }
+
+ // native method:
+ // void onAdidRead(String adid);
+ public void onAdidRead(string adid)
+ {
+ if (this.callback == null)
+ {
+ return;
+ }
+
+ AdjustThreadDispatcher.RunOnMainThread(() =>
+ {
+ if (callback != null)
+ {
+ callback.Invoke(adid);
+ }
+ });
+ }
+ }
+
+ private class AttributionReadListener : AndroidJavaProxy
+ {
+ private Action callback;
+
+ public AttributionReadListener(Action pCallback)
+ : base("com.adjust.sdk.OnAttributionReadListener")
+ {
+ this.callback = pCallback;
+ }
+
+ // native method:
+ // void onAttributionRead(AdjustAttribution attribution);
+ public void onAttributionRead(AndroidJavaObject ajoAttribution)
+ {
+ if (this.callback == null)
+ {
+ return;
+ }
+
+ AdjustThreadDispatcher.RunOnMainThread(() =>
+ {
+ try
+ {
+ if (ajoAttribution == null)
+ {
+ if (callback != null)
+ {
+ callback.Invoke(null);
+ }
+ return;
+ }
+
+ AdjustAttribution adjustAttribution = new AdjustAttribution
+ {
+ TrackerName = AdjustUtils.GetValueOrEmptyToNull(ajoAttribution.Get(AdjustUtils.KeyTrackerName)),
+ TrackerToken = AdjustUtils.GetValueOrEmptyToNull(ajoAttribution.Get(AdjustUtils.KeyTrackerToken)),
+ Network = AdjustUtils.GetValueOrEmptyToNull(ajoAttribution.Get(AdjustUtils.KeyNetwork)),
+ Campaign = AdjustUtils.GetValueOrEmptyToNull(ajoAttribution.Get(AdjustUtils.KeyCampaign)),
+ Adgroup = AdjustUtils.GetValueOrEmptyToNull(ajoAttribution.Get(AdjustUtils.KeyAdgroup)),
+ Creative = AdjustUtils.GetValueOrEmptyToNull(ajoAttribution.Get(AdjustUtils.KeyCreative)),
+ ClickLabel = AdjustUtils.GetValueOrEmptyToNull(ajoAttribution.Get(AdjustUtils.KeyClickLabel)),
+ CostType = AdjustUtils.GetValueOrEmptyToNull(ajoAttribution.Get(AdjustUtils.KeyCostType)),
+ CostCurrency = AdjustUtils.GetValueOrEmptyToNull(ajoAttribution.Get(AdjustUtils.KeyCostCurrency)),
+ FbInstallReferrer = AdjustUtils.GetValueOrEmptyToNull(ajoAttribution.Get(AdjustUtils.KeyFbInstallReferrer))
+ };
+
+ using (AndroidJavaObject ajoCostAmount = ajoAttribution.Get(AdjustUtils.KeyCostAmount))
+ {
+ adjustAttribution.CostAmount = ajoCostAmount != null ? ajoCostAmount.Call("doubleValue") : (double?)null;
+ }
+
+ string jsonResponse = ajoAttribution.Get(AdjustUtils.KeyJsonResponse);
+ if (jsonResponse != null) {
+ var jsonResponseNode = JSON.Parse(jsonResponse);
+ if (jsonResponseNode != null && jsonResponseNode.AsObject != null)
+ {
+ adjustAttribution.JsonResponse = new Dictionary();
+ AdjustUtils.WriteJsonResponseDictionary(jsonResponseNode.AsObject, adjustAttribution.JsonResponse);
+ }
+ }
+
+ if (callback != null)
+ {
+ callback.Invoke(adjustAttribution);
+ }
+ }
+ catch (Exception)
+ {
+ // JSON response reading failed.
+ }
+ });
+ }
+ }
+
+ private class AmazonAdIdReadListener : AndroidJavaProxy
+ {
+ private Action callback;
+
+ public AmazonAdIdReadListener(Action pCallback)
+ : base("com.adjust.sdk.OnAmazonAdIdReadListener")
+ {
+ this.callback = pCallback;
+ }
+
+ // native method:
+ // void onAmazonAdIdRead(String amazonAdId);
+ public void onAmazonAdIdRead(string amazonAdId)
+ {
+ if (this.callback == null)
+ {
+ return;
+ }
+
+ AdjustThreadDispatcher.RunOnMainThread(() =>
+ {
+ if (callback != null)
+ {
+ callback.Invoke(amazonAdId);
+ }
+ });
+ }
+ }
+
+ private class SdkVersionReadListener : AndroidJavaProxy
+ {
+ private Action callback;
+ private string sdkPrefix;
+
+ public SdkVersionReadListener(Action pCallback, string sdkPrefix)
+ : base("com.adjust.sdk.OnSdkVersionReadListener")
+ {
+ this.callback = pCallback;
+ this.sdkPrefix = sdkPrefix;
+ }
+
+ // native method:
+ // void onSdkVersionRead(String sdkVersion);
+ public void onSdkVersionRead(string sdkVersion)
+ {
+ if (this.callback == null)
+ {
+ return;
+ }
+
+ AdjustThreadDispatcher.RunOnMainThread(() =>
+ {
+ if (callback != null)
+ {
+ callback.Invoke(this.sdkPrefix + "@" + sdkVersion);
+ }
+ });
+ }
+ }
+
+ private class IsEnabledListener : AndroidJavaProxy
+ {
+ private Action callback;
+
+ public IsEnabledListener(Action pCallback)
+ : base("com.adjust.sdk.OnIsEnabledListener")
+ {
+ this.callback = pCallback;
+ }
+
+ // native method:
+ // void onIsEnabledRead(boolean isEnabled);
+ public void onIsEnabledRead(bool isEnabled)
+ {
+ if (this.callback == null)
+ {
+ return;
+ }
+
+ AdjustThreadDispatcher.RunOnMainThread(() =>
+ {
+ if (callback != null)
+ {
+ callback.Invoke(isEnabled);
+ }
+ });
+ }
+ }
+
+ private class LastDeeplinkListener : AndroidJavaProxy
+ {
+ private Action callback;
+
+ public LastDeeplinkListener(Action pCallback)
+ : base("com.adjust.sdk.OnLastDeeplinkReadListener")
+ {
+ this.callback = pCallback;
+ }
+
+ // native method:
+ // void onLastDeeplinkRead(Uri deeplink);
+ public void onLastDeeplinkRead(AndroidJavaObject ajoLastDeeplink)
+ {
+ if (this.callback == null)
+ {
+ return;
+ }
+
+ AdjustThreadDispatcher.RunOnMainThread(() =>
+ {
+ string deeplink = ajoLastDeeplink != null ? ajoLastDeeplink.Call("toString") : null;
+ if (callback != null)
+ {
+ callback.Invoke(deeplink);
+ }
+ });
+ }
+ }
+ }
+#endif
+}
diff --git a/Assets/rd3/Adjust/Scripts/AdjustAndroid.cs.meta b/Assets/rd3/Adjust/Scripts/AdjustAndroid.cs.meta
new file mode 100644
index 0000000..5aa3741
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/AdjustAndroid.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 04f57a99ef137445992d048a89c36788
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/rd3/Adjust/Scripts/AdjustAppStorePurchase.cs b/Assets/rd3/Adjust/Scripts/AdjustAppStorePurchase.cs
new file mode 100644
index 0000000..ef345e1
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/AdjustAppStorePurchase.cs
@@ -0,0 +1,16 @@
+using System.Collections.Generic;
+
+namespace AdjustSdk
+{
+ public class AdjustAppStorePurchase
+ {
+ public string TransactionId { get; private set; }
+ public string ProductId { get; private set; }
+
+ public AdjustAppStorePurchase(string transactionId, string productId)
+ {
+ this.TransactionId = transactionId;
+ this.ProductId = productId;
+ }
+ }
+}
diff --git a/Assets/rd3/Adjust/Scripts/AdjustAppStorePurchase.cs.meta b/Assets/rd3/Adjust/Scripts/AdjustAppStorePurchase.cs.meta
new file mode 100644
index 0000000..dbd826d
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/AdjustAppStorePurchase.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 828a981c8c96741afa5d16ccb679e5af
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/rd3/Adjust/Scripts/AdjustAppStoreSubscription.cs b/Assets/rd3/Adjust/Scripts/AdjustAppStoreSubscription.cs
new file mode 100644
index 0000000..a7bdcc5
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/AdjustAppStoreSubscription.cs
@@ -0,0 +1,72 @@
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+
+namespace AdjustSdk
+{
+ public class AdjustAppStoreSubscription
+ {
+ private List innerCallbackParameters;
+ private List innerPartnerParameters;
+
+ public string Price { get; private set; }
+ public string Currency { get; private set; }
+ public string TransactionId { get; private set; }
+ public string TransactionDate { get; set; }
+ public string SalesRegion { get; set; }
+ public ReadOnlyCollection CallbackParameters
+ {
+ get
+ {
+ if (innerCallbackParameters == null)
+ {
+ return null;
+ }
+ else
+ {
+ return innerCallbackParameters.AsReadOnly();
+ }
+ }
+ }
+ public ReadOnlyCollection PartnerParameters
+ {
+ get
+ {
+ if (innerPartnerParameters == null)
+ {
+ return null;
+ }
+ else
+ {
+ return innerPartnerParameters.AsReadOnly();
+ }
+ }
+ }
+
+ public AdjustAppStoreSubscription(string price, string currency, string transactionId)
+ {
+ this.Price = price;
+ this.Currency = currency;
+ this.TransactionId = transactionId;
+ }
+
+ public void AddCallbackParameter(string key, string value)
+ {
+ if (this.innerCallbackParameters == null)
+ {
+ this.innerCallbackParameters = new List();
+ }
+ this.innerCallbackParameters.Add(key);
+ this.innerCallbackParameters.Add(value);
+ }
+
+ public void AddPartnerParameter(string key, string value)
+ {
+ if (this.innerPartnerParameters == null)
+ {
+ this.innerPartnerParameters = new List();
+ }
+ this.innerPartnerParameters.Add(key);
+ this.innerPartnerParameters.Add(value);
+ }
+ }
+}
diff --git a/Assets/rd3/Adjust/Scripts/AdjustAppStoreSubscription.cs.meta b/Assets/rd3/Adjust/Scripts/AdjustAppStoreSubscription.cs.meta
new file mode 100644
index 0000000..f5af330
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/AdjustAppStoreSubscription.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 7e2d69221b1124370a4c016edce5a95a
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/rd3/Adjust/Scripts/AdjustAttribution.cs b/Assets/rd3/Adjust/Scripts/AdjustAttribution.cs
new file mode 100644
index 0000000..661bc63
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/AdjustAttribution.cs
@@ -0,0 +1,117 @@
+using System;
+using System.Collections.Generic;
+
+namespace AdjustSdk
+{
+ public class AdjustAttribution
+ {
+ public string TrackerToken { get; set; }
+ public string TrackerName { get; set; }
+ public string Network { get; set; }
+ public string Campaign { get; set; }
+ public string Adgroup { get; set; }
+ public string Creative { get; set; }
+ public string ClickLabel { get; set; }
+ public string CostType { get; set; }
+ public double? CostAmount { get; set; }
+ public string CostCurrency { get; set; }
+ public Dictionary JsonResponse { get; set; }
+ // Android only
+ public string FbInstallReferrer { get; set; }
+
+ public AdjustAttribution() {}
+
+ public AdjustAttribution(string jsonString)
+ {
+ var jsonNode = JSON.Parse(jsonString);
+ if (jsonNode == null)
+ {
+ return;
+ }
+
+ this.TrackerName = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyTrackerName);
+ this.TrackerToken = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyTrackerToken);
+ this.Network = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyNetwork);
+ this.Campaign = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyCampaign);
+ this.Adgroup = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyAdgroup);
+ this.Creative = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyCreative);
+ this.ClickLabel = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyClickLabel);
+ this.CostType = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyCostType);
+ try
+ {
+ this.CostAmount = double.Parse(
+ AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyCostAmount),
+ System.Globalization.CultureInfo.InvariantCulture);
+ }
+ catch (Exception)
+ {
+ // attribution response doesn't contain cost amount attached
+ // value will default to null
+ }
+ this.CostCurrency = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyCostCurrency);
+ this.FbInstallReferrer = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyFbInstallReferrer);
+
+ var jsonResponseValue = jsonNode[AdjustUtils.KeyJsonResponse];
+ if (jsonResponseValue == null)
+ {
+ return;
+ }
+ this.JsonResponse = AdjustUtils.GetAttributionJsonResponse(jsonResponseValue);
+ }
+
+ public AdjustAttribution(Dictionary dicAttributionData)
+ {
+ if (dicAttributionData == null)
+ {
+ return;
+ }
+
+ this.TrackerName = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyTrackerName);
+ this.TrackerToken = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyTrackerToken);
+ this.Network = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyNetwork);
+ this.Campaign = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyCampaign);
+ this.Adgroup = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyAdgroup);
+ this.Creative = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyCreative);
+ this.ClickLabel = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyClickLabel);
+ this.CostType = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyCostType);
+ try
+ {
+ this.CostAmount = double.Parse(
+ AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyCostAmount),
+ System.Globalization.CultureInfo.InvariantCulture);
+ }
+ catch (Exception)
+ {
+ // attribution response doesn't contain cost amount attached
+ // value will default to null
+ }
+ this.CostCurrency = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyCostCurrency);
+ this.FbInstallReferrer = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyFbInstallReferrer);
+
+ string jsonResponseString = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyJsonResponse);
+ var jsonResponseNode = JSON.Parse(jsonResponseString);
+ if (jsonResponseNode != null && jsonResponseNode.AsObject != null)
+ {
+ this.JsonResponse = new Dictionary();
+ AdjustUtils.WriteJsonResponseDictionary(jsonResponseNode.AsObject, this.JsonResponse);
+ }
+ }
+
+ public void BuildJsonResponseFromString(string jsonResponseString)
+ {
+ var jsonNode = JSON.Parse(jsonResponseString);
+ if (jsonNode == null)
+ {
+ return;
+ }
+
+ this.JsonResponse = new Dictionary();
+ AdjustUtils.WriteJsonResponseDictionary(jsonNode.AsObject, JsonResponse);
+ }
+
+ public string GetJsonResponseAsString()
+ {
+ return AdjustUtils.GetJsonResponseCompact(JsonResponse);
+ }
+ }
+}
diff --git a/Assets/rd3/Adjust/Scripts/AdjustAttribution.cs.meta b/Assets/rd3/Adjust/Scripts/AdjustAttribution.cs.meta
new file mode 100644
index 0000000..37c4bbd
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/AdjustAttribution.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: cc46748ad0e664f6d839a4f1a23d9f47
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Assets/rd3/Adjust/Scripts/AdjustConfig.cs b/Assets/rd3/Adjust/Scripts/AdjustConfig.cs
new file mode 100644
index 0000000..c13d75c
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/AdjustConfig.cs
@@ -0,0 +1,71 @@
+using System;
+using System.Collections.Generic;
+
+namespace AdjustSdk
+{
+ public class AdjustConfig
+ {
+ public string AppToken { get; private set; }
+ public string DefaultTracker { get; set; }
+ public string ExternalDeviceId { get; set; }
+ public bool? IsCoppaComplianceEnabled { get; set; }
+ public bool? IsSendingInBackgroundEnabled { get; set; }
+ public bool? IsCostDataInAttributionEnabled { get; set; }
+ public bool? IsDeviceIdsReadingOnceEnabled { get; set; }
+ public bool? IsDeferredDeeplinkOpeningEnabled { get; set; }
+ public bool? IsAppTrackingTransparencyUsageEnabled { get; set; }
+ public bool? IsFirstSessionDelayEnabled { get; set; }
+ public bool? AllowSuppressLogLevel { get; private set; }
+ public bool? IsDataResidency { get; private set; }
+ public bool? ShouldUseSubdomains { get; private set; }
+ public int? EventDeduplicationIdsMaxSize { get; set; }
+ public List UrlStrategyDomains { get; private set; }
+ public AdjustLogLevel? LogLevel { get; set; }
+ public AdjustEnvironment Environment { get; private set; }
+ public AdjustStoreInfo StoreInfo { get; set; }
+ public Action AttributionChangedDelegate { get; set; }
+ public Action EventSuccessDelegate { get; set; }
+ public Action EventFailureDelegate { get; set; }
+ public Action SessionSuccessDelegate { get; set; }
+ public Action SessionFailureDelegate { get; set; }
+ public Action DeferredDeeplinkDelegate { get; set; }
+ public Action> SkanUpdatedDelegate { get; set; }
+
+ // iOS specific
+ public bool? IsAdServicesEnabled { get; set; }
+ public bool? IsIdfaReadingEnabled { get; set; }
+ public bool? IsIdfvReadingEnabled { get; set; }
+ public bool? IsSkanAttributionEnabled { get; set; }
+ public bool? IsLinkMeEnabled { get; set; }
+ public int? AttConsentWaitingInterval { get; set; }
+
+ // Android specific
+ public bool? IsPlayStoreKidsComplianceEnabled { get; set; }
+ public bool? IsPreinstallTrackingEnabled { get; set; }
+ public string PreinstallFilePath { get; set; }
+ public string FbAppId { get; set; }
+
+ public AdjustConfig(string appToken, AdjustEnvironment environment)
+ {
+ this.AppToken = appToken;
+ this.Environment = environment;
+ }
+
+ public AdjustConfig(string appToken, AdjustEnvironment environment, bool allowSuppressLogLevel)
+ {
+ this.AppToken = appToken;
+ this.Environment = environment;
+ this.AllowSuppressLogLevel = allowSuppressLogLevel;
+ }
+
+ public void SetUrlStrategy(
+ List urlStrategyDomains,
+ bool shouldUseSubdomains,
+ bool isDataResidency)
+ {
+ this.UrlStrategyDomains = urlStrategyDomains;
+ this.ShouldUseSubdomains = shouldUseSubdomains;
+ this.IsDataResidency = isDataResidency;
+ }
+ }
+}
diff --git a/Assets/rd3/Adjust/Scripts/AdjustConfig.cs.meta b/Assets/rd3/Adjust/Scripts/AdjustConfig.cs.meta
new file mode 100644
index 0000000..d98ac07
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/AdjustConfig.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 02d4cad14fc094b17afde3b685897e5e
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Assets/rd3/Adjust/Scripts/AdjustDeeplink.cs b/Assets/rd3/Adjust/Scripts/AdjustDeeplink.cs
new file mode 100644
index 0000000..8ff852e
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/AdjustDeeplink.cs
@@ -0,0 +1,15 @@
+using System;
+
+namespace AdjustSdk
+{
+ public class AdjustDeeplink
+ {
+ public string Deeplink { get; private set; }
+ public string Referrer { get; set; }
+
+ public AdjustDeeplink(string deeplink)
+ {
+ this.Deeplink = deeplink;
+ }
+ }
+}
diff --git a/Assets/rd3/Adjust/Scripts/AdjustDeeplink.cs.meta b/Assets/rd3/Adjust/Scripts/AdjustDeeplink.cs.meta
new file mode 100644
index 0000000..e4c1597
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/AdjustDeeplink.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 40e25efef61754d66a47cd3e62a7f6bc
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/rd3/Adjust/Scripts/AdjustEnvironment.cs b/Assets/rd3/Adjust/Scripts/AdjustEnvironment.cs
new file mode 100644
index 0000000..f57f3bf
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/AdjustEnvironment.cs
@@ -0,0 +1,25 @@
+namespace AdjustSdk
+{
+ [System.Serializable]
+ public enum AdjustEnvironment
+ {
+ Sandbox,
+ Production
+ }
+
+ public static class AdjustEnvironmentExtension
+ {
+ public static string ToLowercaseString(this AdjustEnvironment adjustEnvironment)
+ {
+ switch (adjustEnvironment)
+ {
+ case AdjustEnvironment.Sandbox:
+ return "sandbox";
+ case AdjustEnvironment.Production:
+ return "production";
+ default:
+ return "unknown";
+ }
+ }
+ }
+}
diff --git a/Assets/rd3/Adjust/Scripts/AdjustEnvironment.cs.meta b/Assets/rd3/Adjust/Scripts/AdjustEnvironment.cs.meta
new file mode 100644
index 0000000..fb47242
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/AdjustEnvironment.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 633f6fa279b2244fdb999db0441f9aac
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Assets/rd3/Adjust/Scripts/AdjustEvent.cs b/Assets/rd3/Adjust/Scripts/AdjustEvent.cs
new file mode 100644
index 0000000..0779e16
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/AdjustEvent.cs
@@ -0,0 +1,81 @@
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+
+namespace AdjustSdk
+{
+ public class AdjustEvent
+ {
+ private List innerCallbackParameters;
+ private List innerPartnerParameters;
+
+ public string EventToken { get; private set; }
+ public double? Revenue { get; private set; }
+ public string Currency { get; private set; }
+ public string CallbackId { get; set; }
+ public string DeduplicationId { get; set; }
+ public string ProductId { get; set; }
+ public ReadOnlyCollection CallbackParameters
+ {
+ get
+ {
+ if (innerCallbackParameters == null)
+ {
+ return null;
+ }
+ else
+ {
+ return innerCallbackParameters.AsReadOnly();
+ }
+ }
+ }
+ public ReadOnlyCollection PartnerParameters
+ {
+ get
+ {
+ if (innerPartnerParameters == null)
+ {
+ return null;
+ }
+ else
+ {
+ return innerPartnerParameters.AsReadOnly();
+ }
+ }
+ }
+ // ios specific
+ public string TransactionId { get; set; }
+ // android specific
+ public string PurchaseToken;
+
+ public AdjustEvent(string eventToken)
+ {
+ this.EventToken = eventToken;
+ }
+
+ public void SetRevenue(double amount, string currency)
+ {
+ this.Revenue = amount;
+ this.Currency = currency;
+ }
+
+ public void AddCallbackParameter(string key, string value)
+ {
+ if (this.innerCallbackParameters == null)
+ {
+ this.innerCallbackParameters = new List();
+ }
+ this.innerCallbackParameters.Add(key);
+ this.innerCallbackParameters.Add(value);
+ }
+
+ public void AddPartnerParameter(string key, string value)
+ {
+ if (this.innerPartnerParameters == null)
+ {
+ this.innerPartnerParameters = new List();
+ }
+ this.innerPartnerParameters.Add(key);
+ this.innerPartnerParameters.Add(value);
+ }
+ }
+}
diff --git a/Assets/rd3/Adjust/Scripts/AdjustEvent.cs.meta b/Assets/rd3/Adjust/Scripts/AdjustEvent.cs.meta
new file mode 100644
index 0000000..41ea634
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/AdjustEvent.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: cd89f7713977f497a862f1a1b6f60933
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Assets/rd3/Adjust/Scripts/AdjustEventFailure.cs b/Assets/rd3/Adjust/Scripts/AdjustEventFailure.cs
new file mode 100644
index 0000000..0320b8a
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/AdjustEventFailure.cs
@@ -0,0 +1,92 @@
+using System;
+using System.Collections.Generic;
+
+namespace AdjustSdk
+{
+ public class AdjustEventFailure
+ {
+ public string Adid { get; set; }
+ public string Message { get; set; }
+ public string Timestamp { get; set; }
+ public string EventToken { get; set; }
+ public string CallbackId { get; set; }
+ public bool WillRetry { get; set; }
+ public Dictionary JsonResponse { get; set; }
+
+ public AdjustEventFailure() {}
+
+ public AdjustEventFailure(Dictionary eventFailureDataMap)
+ {
+ if (eventFailureDataMap == null)
+ {
+ return;
+ }
+
+ this.Adid = AdjustUtils.TryGetValue(eventFailureDataMap, AdjustUtils.KeyAdid);
+ this.Message = AdjustUtils.TryGetValue(eventFailureDataMap, AdjustUtils.KeyMessage);
+ this.Timestamp = AdjustUtils.TryGetValue(eventFailureDataMap, AdjustUtils.KeyTimestamp);
+ this.EventToken = AdjustUtils.TryGetValue(eventFailureDataMap, AdjustUtils.KeyEventToken);
+ this.CallbackId = AdjustUtils.TryGetValue(eventFailureDataMap, AdjustUtils.KeyCallbackId);
+
+ bool willRetry;
+ if (bool.TryParse(AdjustUtils.TryGetValue(eventFailureDataMap, AdjustUtils.KeyWillRetry), out willRetry))
+ {
+ this.WillRetry = willRetry;
+ }
+
+ string jsonResponseString = AdjustUtils.TryGetValue(eventFailureDataMap, AdjustUtils.KeyJsonResponse);
+ var jsonResponseNode = JSON.Parse(jsonResponseString);
+ if (jsonResponseNode != null && jsonResponseNode.AsObject != null)
+ {
+ this.JsonResponse = new Dictionary();
+ AdjustUtils.WriteJsonResponseDictionary(jsonResponseNode.AsObject, JsonResponse);
+ }
+ }
+
+ public AdjustEventFailure(string jsonString)
+ {
+ var jsonNode = JSON.Parse(jsonString);
+ if (jsonNode == null)
+ {
+ return;
+ }
+
+ this.Adid = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyAdid);
+ this.Message = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyMessage);
+ this.Timestamp = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyTimestamp);
+ this.EventToken = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyEventToken);
+ this.CallbackId = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyCallbackId);
+ this.WillRetry = Convert.ToBoolean(AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyWillRetry));
+
+ var jsonResponseNode = jsonNode[AdjustUtils.KeyJsonResponse];
+ if (jsonResponseNode == null)
+ {
+ return;
+ }
+ if (jsonResponseNode.AsObject == null)
+ {
+ return;
+ }
+
+ this.JsonResponse = new Dictionary();
+ AdjustUtils.WriteJsonResponseDictionary(jsonResponseNode.AsObject, JsonResponse);
+ }
+
+ public void BuildJsonResponseFromString(string jsonResponseString)
+ {
+ var jsonNode = JSON.Parse(jsonResponseString);
+ if (jsonNode == null)
+ {
+ return;
+ }
+
+ this.JsonResponse = new Dictionary();
+ AdjustUtils.WriteJsonResponseDictionary(jsonNode.AsObject, JsonResponse);
+ }
+
+ public string GetJsonResponseAsString()
+ {
+ return AdjustUtils.GetJsonResponseCompact(JsonResponse);
+ }
+ }
+}
diff --git a/Assets/rd3/Adjust/Scripts/AdjustEventFailure.cs.meta b/Assets/rd3/Adjust/Scripts/AdjustEventFailure.cs.meta
new file mode 100644
index 0000000..ee12da9
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/AdjustEventFailure.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: ea86cd4e1c6d0496397920902d0f0b5f
+timeCreated: 1458128791
+licenseType: Free
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/rd3/Adjust/Scripts/AdjustEventSuccess.cs b/Assets/rd3/Adjust/Scripts/AdjustEventSuccess.cs
new file mode 100644
index 0000000..925ac49
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/AdjustEventSuccess.cs
@@ -0,0 +1,84 @@
+using System;
+using System.Collections.Generic;
+
+namespace AdjustSdk
+{
+ public class AdjustEventSuccess
+ {
+ public string Adid { get; set; }
+ public string Message { get; set; }
+ public string Timestamp { get; set; }
+ public string EventToken { get; set; }
+ public string CallbackId { get; set; }
+ public Dictionary JsonResponse { get; set; }
+
+ public AdjustEventSuccess() {}
+
+ public AdjustEventSuccess(Dictionary eventSuccessDataMap)
+ {
+ if (eventSuccessDataMap == null)
+ {
+ return;
+ }
+
+ this.Adid = AdjustUtils.TryGetValue(eventSuccessDataMap, AdjustUtils.KeyAdid);
+ this.Message = AdjustUtils.TryGetValue(eventSuccessDataMap, AdjustUtils.KeyMessage);
+ this.Timestamp = AdjustUtils.TryGetValue(eventSuccessDataMap, AdjustUtils.KeyTimestamp);
+ this.EventToken = AdjustUtils.TryGetValue(eventSuccessDataMap, AdjustUtils.KeyEventToken);
+ this.CallbackId = AdjustUtils.TryGetValue(eventSuccessDataMap, AdjustUtils.KeyCallbackId);
+
+ string jsonResponseString = AdjustUtils.TryGetValue(eventSuccessDataMap, AdjustUtils.KeyJsonResponse);
+ var jsonResponseNode = JSON.Parse(jsonResponseString);
+ if (jsonResponseNode != null && jsonResponseNode.AsObject != null)
+ {
+ this.JsonResponse = new Dictionary();
+ AdjustUtils.WriteJsonResponseDictionary(jsonResponseNode.AsObject, JsonResponse);
+ }
+ }
+
+ public AdjustEventSuccess(string jsonString)
+ {
+ var jsonNode = JSON.Parse(jsonString);
+ if (jsonNode == null)
+ {
+ return;
+ }
+
+ this.Adid = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyAdid);
+ this.Message = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyMessage);
+ this.Timestamp = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyTimestamp);
+ this.EventToken = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyEventToken);
+ this.CallbackId = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyCallbackId);
+
+ var jsonResponseNode = jsonNode[AdjustUtils.KeyJsonResponse];
+ if (jsonResponseNode == null)
+ {
+ return;
+ }
+ if (jsonResponseNode.AsObject == null)
+ {
+ return;
+ }
+
+ this.JsonResponse = new Dictionary();
+ AdjustUtils.WriteJsonResponseDictionary(jsonResponseNode.AsObject, JsonResponse);
+ }
+
+ public void BuildJsonResponseFromString(string jsonResponseString)
+ {
+ var jsonNode = JSON.Parse(jsonResponseString);
+ if (jsonNode == null)
+ {
+ return;
+ }
+
+ this.JsonResponse = new Dictionary();
+ AdjustUtils.WriteJsonResponseDictionary(jsonNode.AsObject, JsonResponse);
+ }
+
+ public string GetJsonResponseAsString()
+ {
+ return AdjustUtils.GetJsonResponseCompact(JsonResponse);
+ }
+ }
+}
diff --git a/Assets/rd3/Adjust/Scripts/AdjustEventSuccess.cs.meta b/Assets/rd3/Adjust/Scripts/AdjustEventSuccess.cs.meta
new file mode 100644
index 0000000..a750f56
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/AdjustEventSuccess.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 1957a0e6e9aa14f0e8adefa2120f1e02
+timeCreated: 1458128791
+licenseType: Free
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/rd3/Adjust/Scripts/AdjustLogLevel.cs b/Assets/rd3/Adjust/Scripts/AdjustLogLevel.cs
new file mode 100644
index 0000000..63adf16
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/AdjustLogLevel.cs
@@ -0,0 +1,63 @@
+namespace AdjustSdk
+{
+ [System.Serializable]
+ public enum AdjustLogLevel
+ {
+ Verbose = 1,
+ Debug,
+ Info,
+ Warn,
+ Error,
+ Assert,
+ Suppress
+ }
+
+ public static class AdjustLogLevelExtension
+ {
+ public static string ToLowercaseString(this AdjustLogLevel AdjustLogLevel)
+ {
+ switch (AdjustLogLevel)
+ {
+ case AdjustLogLevel.Verbose:
+ return "verbose";
+ case AdjustLogLevel.Debug:
+ return "debug";
+ case AdjustLogLevel.Info:
+ return "info";
+ case AdjustLogLevel.Warn:
+ return "warn";
+ case AdjustLogLevel.Error:
+ return "error";
+ case AdjustLogLevel.Assert:
+ return "assert";
+ case AdjustLogLevel.Suppress:
+ return "suppress";
+ default:
+ return "unknown";
+ }
+ }
+
+ public static string ToUppercaseString(this AdjustLogLevel AdjustLogLevel)
+ {
+ switch (AdjustLogLevel)
+ {
+ case AdjustLogLevel.Verbose:
+ return "VERBOSE";
+ case AdjustLogLevel.Debug:
+ return "DEBUG";
+ case AdjustLogLevel.Info:
+ return "INFO";
+ case AdjustLogLevel.Warn:
+ return "WARN";
+ case AdjustLogLevel.Error:
+ return "ERROR";
+ case AdjustLogLevel.Assert:
+ return "ASSERT";
+ case AdjustLogLevel.Suppress:
+ return "SUPPRESS";
+ default:
+ return "UNKNOWN";
+ }
+ }
+ }
+}
diff --git a/Assets/rd3/Adjust/Scripts/AdjustLogLevel.cs.meta b/Assets/rd3/Adjust/Scripts/AdjustLogLevel.cs.meta
new file mode 100644
index 0000000..226164e
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/AdjustLogLevel.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 428ab44990df24973902248a9d2b43dd
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Assets/rd3/Adjust/Scripts/AdjustPlayStorePurchase.cs b/Assets/rd3/Adjust/Scripts/AdjustPlayStorePurchase.cs
new file mode 100644
index 0000000..2d2ddde
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/AdjustPlayStorePurchase.cs
@@ -0,0 +1,16 @@
+using System.Collections.Generic;
+
+namespace AdjustSdk
+{
+ public class AdjustPlayStorePurchase
+ {
+ public string ProductId { get; private set; }
+ public string PurchaseToken { get; private set; }
+
+ public AdjustPlayStorePurchase(string productId, string purchaseToken)
+ {
+ this.ProductId = productId;
+ this.PurchaseToken = purchaseToken;
+ }
+ }
+}
diff --git a/Assets/rd3/Adjust/Scripts/AdjustPlayStorePurchase.cs.meta b/Assets/rd3/Adjust/Scripts/AdjustPlayStorePurchase.cs.meta
new file mode 100644
index 0000000..004849b
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/AdjustPlayStorePurchase.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: d875a71a5aeb1496d93afac749ab17f6
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/rd3/Adjust/Scripts/AdjustPlayStoreSubscription.cs b/Assets/rd3/Adjust/Scripts/AdjustPlayStoreSubscription.cs
new file mode 100644
index 0000000..a48d017
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/AdjustPlayStoreSubscription.cs
@@ -0,0 +1,83 @@
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+
+namespace AdjustSdk
+{
+ public class AdjustPlayStoreSubscription
+ {
+ private List innerCallbackParameters;
+ private List innerPartnerParameters;
+
+ public string Price { get; private set; }
+ public string Currency { get; private set; }
+ public string ProductId { get; private set; }
+ public string OrderId { get; private set; }
+ public string Signature { get; private set; }
+ public string PurchaseToken { get; private set; }
+ public string PurchaseTime { get; set; }
+ public ReadOnlyCollection CallbackParameters
+ {
+ get
+ {
+ if (innerCallbackParameters == null)
+ {
+ return null;
+ }
+ else
+ {
+ return innerCallbackParameters.AsReadOnly();
+ }
+ }
+ }
+ public ReadOnlyCollection PartnerParameters
+ {
+ get
+ {
+ if (innerPartnerParameters == null)
+ {
+ return null;
+ }
+ else
+ {
+ return innerPartnerParameters.AsReadOnly();
+ }
+ }
+ }
+
+ public AdjustPlayStoreSubscription(
+ string price,
+ string currency,
+ string productId,
+ string orderId,
+ string signature,
+ string purchaseToken)
+ {
+ this.Price = price;
+ this.Currency = currency;
+ this.ProductId = productId;
+ this.OrderId = orderId;
+ this.Signature = signature;
+ this.PurchaseToken = purchaseToken;
+ }
+
+ public void AddCallbackParameter(string key, string value)
+ {
+ if (this.innerCallbackParameters == null)
+ {
+ this.innerCallbackParameters = new List();
+ }
+ this.innerCallbackParameters.Add(key);
+ this.innerCallbackParameters.Add(value);
+ }
+
+ public void AddPartnerParameter(string key, string value)
+ {
+ if (this.innerPartnerParameters == null)
+ {
+ this.innerPartnerParameters = new List();
+ }
+ this.innerPartnerParameters.Add(key);
+ this.innerPartnerParameters.Add(value);
+ }
+ }
+}
diff --git a/Assets/rd3/Adjust/Scripts/AdjustPlayStoreSubscription.cs.meta b/Assets/rd3/Adjust/Scripts/AdjustPlayStoreSubscription.cs.meta
new file mode 100644
index 0000000..8b82732
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/AdjustPlayStoreSubscription.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 69e7a4074abb44758b3f011d8352a57a
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/rd3/Adjust/Scripts/AdjustPurchaseVerificationResult.cs b/Assets/rd3/Adjust/Scripts/AdjustPurchaseVerificationResult.cs
new file mode 100644
index 0000000..6b5eb65
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/AdjustPurchaseVerificationResult.cs
@@ -0,0 +1,27 @@
+using System.Collections.Generic;
+
+namespace AdjustSdk
+{
+ public class AdjustPurchaseVerificationResult
+ {
+ public int Code { get; set; }
+ public string Message { get; set; }
+ public string VerificationStatus { get; set; }
+
+ public AdjustPurchaseVerificationResult() {}
+
+ public AdjustPurchaseVerificationResult(string jsonString)
+ {
+ var jsonNode = JSON.Parse(jsonString);
+ if (jsonNode == null)
+ {
+ return;
+ }
+
+ string strCode = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyCode);
+ this.Code = int.Parse(strCode);
+ this.Message = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyMessage);
+ this.VerificationStatus = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyVerificationStatus);
+ }
+ }
+}
diff --git a/Assets/rd3/Adjust/Scripts/AdjustPurchaseVerificationResult.cs.meta b/Assets/rd3/Adjust/Scripts/AdjustPurchaseVerificationResult.cs.meta
new file mode 100644
index 0000000..83cbb24
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/AdjustPurchaseVerificationResult.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: cbd451b59ec374fa7b72f226b1cef0b4
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/rd3/Adjust/Scripts/AdjustSdk.Scripts.asmdef b/Assets/rd3/Adjust/Scripts/AdjustSdk.Scripts.asmdef
new file mode 100644
index 0000000..93b41c2
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/AdjustSdk.Scripts.asmdef
@@ -0,0 +1,6 @@
+{
+ "name": "AdjustSdk.Scripts",
+ "references": [],
+ "includePlatforms": [],
+ "excludePlatforms": []
+}
\ No newline at end of file
diff --git a/Assets/rd3/Adjust/Scripts/AdjustSdk.Scripts.asmdef.meta b/Assets/rd3/Adjust/Scripts/AdjustSdk.Scripts.asmdef.meta
new file mode 100644
index 0000000..99f43a5
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/AdjustSdk.Scripts.asmdef.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 7d8924c6e6beb44e18f19e8c0b5068cd
+AssemblyDefinitionImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/rd3/Adjust/Scripts/AdjustSessionFailure.cs b/Assets/rd3/Adjust/Scripts/AdjustSessionFailure.cs
new file mode 100644
index 0000000..62c0ead
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/AdjustSessionFailure.cs
@@ -0,0 +1,86 @@
+using System;
+using System.Collections.Generic;
+
+namespace AdjustSdk
+{
+ public class AdjustSessionFailure
+ {
+ public string Adid { get; set; }
+ public string Message { get; set; }
+ public string Timestamp { get; set; }
+ public bool WillRetry { get; set; }
+ public Dictionary JsonResponse { get; set; }
+
+ public AdjustSessionFailure() {}
+
+ public AdjustSessionFailure(Dictionary sessionFailureDataMap)
+ {
+ if (sessionFailureDataMap == null)
+ {
+ return;
+ }
+
+ this.Adid = AdjustUtils.TryGetValue(sessionFailureDataMap, AdjustUtils.KeyAdid);
+ this.Message = AdjustUtils.TryGetValue(sessionFailureDataMap, AdjustUtils.KeyMessage);
+ this.Timestamp = AdjustUtils.TryGetValue(sessionFailureDataMap, AdjustUtils.KeyTimestamp);
+
+ bool willRetry;
+ if (bool.TryParse(AdjustUtils.TryGetValue(sessionFailureDataMap, AdjustUtils.KeyWillRetry), out willRetry))
+ {
+ this.WillRetry = willRetry;
+ }
+
+ string jsonResponseString = AdjustUtils.TryGetValue(sessionFailureDataMap, AdjustUtils.KeyJsonResponse);
+ var jsonResponseNode = JSON.Parse(jsonResponseString);
+ if (jsonResponseNode != null && jsonResponseNode.AsObject != null)
+ {
+ this.JsonResponse = new Dictionary();
+ AdjustUtils.WriteJsonResponseDictionary(jsonResponseNode.AsObject, JsonResponse);
+ }
+ }
+
+ public AdjustSessionFailure(string jsonString)
+ {
+ var jsonNode = JSON.Parse(jsonString);
+ if (jsonNode == null)
+ {
+ return;
+ }
+
+ this.Adid = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyAdid);
+ this.Message = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyMessage);
+ this.Timestamp = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyTimestamp);
+ this.WillRetry = Convert.ToBoolean(AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyWillRetry));
+
+ var jsonResponseNode = jsonNode[AdjustUtils.KeyJsonResponse];
+ if (jsonResponseNode == null)
+ {
+ return;
+ }
+ if (jsonResponseNode.AsObject == null)
+ {
+ return;
+ }
+
+ this.JsonResponse = new Dictionary();
+ AdjustUtils.WriteJsonResponseDictionary(jsonResponseNode.AsObject, JsonResponse);
+ }
+
+ public void BuildJsonResponseFromString(string jsonResponseString)
+ {
+ var jsonNode = JSON.Parse(jsonResponseString);
+ if (jsonNode == null)
+ {
+ return;
+ }
+
+ this.JsonResponse = new Dictionary();
+ AdjustUtils.WriteJsonResponseDictionary(jsonNode.AsObject, JsonResponse);
+ }
+
+ public string GetJsonResponseAsString()
+ {
+ return AdjustUtils.GetJsonResponseCompact(JsonResponse);
+ }
+ }
+}
diff --git a/Assets/rd3/Adjust/Scripts/AdjustSessionFailure.cs.meta b/Assets/rd3/Adjust/Scripts/AdjustSessionFailure.cs.meta
new file mode 100644
index 0000000..4e905a4
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/AdjustSessionFailure.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: b4de268ab985448a594fb82264190742
+timeCreated: 1458128791
+licenseType: Free
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/rd3/Adjust/Scripts/AdjustSessionSuccess.cs b/Assets/rd3/Adjust/Scripts/AdjustSessionSuccess.cs
new file mode 100644
index 0000000..f556ee2
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/AdjustSessionSuccess.cs
@@ -0,0 +1,77 @@
+using System.Collections.Generic;
+
+namespace AdjustSdk
+{
+ public class AdjustSessionSuccess
+ {
+ public string Adid { get; set; }
+ public string Message { get; set; }
+ public string Timestamp { get; set; }
+ public Dictionary JsonResponse { get; set; }
+
+ public AdjustSessionSuccess() {}
+
+ public AdjustSessionSuccess(Dictionary sessionSuccessDataMap)
+ {
+ if (sessionSuccessDataMap == null)
+ {
+ return;
+ }
+
+ this.Adid = AdjustUtils.TryGetValue(sessionSuccessDataMap, AdjustUtils.KeyAdid);
+ this.Message = AdjustUtils.TryGetValue(sessionSuccessDataMap, AdjustUtils.KeyMessage);
+ this.Timestamp = AdjustUtils.TryGetValue(sessionSuccessDataMap, AdjustUtils.KeyTimestamp);
+
+ string jsonResponseString = AdjustUtils.TryGetValue(sessionSuccessDataMap, AdjustUtils.KeyJsonResponse);
+ var jsonResponseNode = JSON.Parse(jsonResponseString);
+ if (jsonResponseNode != null && jsonResponseNode.AsObject != null)
+ {
+ this.JsonResponse = new Dictionary();
+ AdjustUtils.WriteJsonResponseDictionary(jsonResponseNode.AsObject, JsonResponse);
+ }
+ }
+
+ public AdjustSessionSuccess(string jsonString)
+ {
+ var jsonNode = JSON.Parse(jsonString);
+ if (jsonNode == null)
+ {
+ return;
+ }
+
+ this.Adid = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyAdid);
+ this.Message = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyMessage);
+ this.Timestamp = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyTimestamp);
+
+ var jsonResponseNode = jsonNode[AdjustUtils.KeyJsonResponse];
+ if (jsonResponseNode == null)
+ {
+ return;
+ }
+ if (jsonResponseNode.AsObject == null)
+ {
+ return;
+ }
+
+ this.JsonResponse = new Dictionary();
+ AdjustUtils.WriteJsonResponseDictionary(jsonResponseNode.AsObject, JsonResponse);
+ }
+
+ public void BuildJsonResponseFromString(string jsonResponseString)
+ {
+ var jsonNode = JSON.Parse(jsonResponseString);
+ if (jsonNode == null)
+ {
+ return;
+ }
+
+ this.JsonResponse = new Dictionary();
+ AdjustUtils.WriteJsonResponseDictionary(jsonNode.AsObject, JsonResponse);
+ }
+
+ public string GetJsonResponseAsString()
+ {
+ return AdjustUtils.GetJsonResponseCompact(JsonResponse);
+ }
+ }
+}
diff --git a/Assets/rd3/Adjust/Scripts/AdjustSessionSuccess.cs.meta b/Assets/rd3/Adjust/Scripts/AdjustSessionSuccess.cs.meta
new file mode 100644
index 0000000..643c083
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/AdjustSessionSuccess.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: c23847e7a1f464d7a8c7f9b35829af17
+timeCreated: 1458128791
+licenseType: Free
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/rd3/Adjust/Scripts/AdjustStoreInfo.cs b/Assets/rd3/Adjust/Scripts/AdjustStoreInfo.cs
new file mode 100644
index 0000000..0247d0f
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/AdjustStoreInfo.cs
@@ -0,0 +1,15 @@
+using System;
+
+namespace AdjustSdk
+{
+ public class AdjustStoreInfo
+ {
+ public string StoreName { get; private set; }
+ public string StoreAppId { get; set; }
+
+ public AdjustStoreInfo(string storeName)
+ {
+ this.StoreName = storeName;
+ }
+ }
+}
diff --git a/Assets/rd3/Adjust/Scripts/AdjustStoreInfo.cs.meta b/Assets/rd3/Adjust/Scripts/AdjustStoreInfo.cs.meta
new file mode 100644
index 0000000..4ea2ed0
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/AdjustStoreInfo.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 09215b0ccf65143ae91e6fa6cdca34b9
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/rd3/Adjust/Scripts/AdjustThirdPartySharing.cs b/Assets/rd3/Adjust/Scripts/AdjustThirdPartySharing.cs
new file mode 100644
index 0000000..0243a83
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/AdjustThirdPartySharing.cs
@@ -0,0 +1,68 @@
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+
+namespace AdjustSdk
+{
+ public class AdjustThirdPartySharing
+ {
+ private List innerGranularOptions;
+ private List innerPartnerSharingSettings;
+
+ public bool? IsEnabled { get; private set; }
+ public ReadOnlyCollection GranularOptions
+ {
+ get
+ {
+ if (innerGranularOptions == null)
+ {
+ return null;
+ }
+ else
+ {
+ return innerGranularOptions.AsReadOnly();
+ }
+ }
+ }
+ public ReadOnlyCollection PartnerSharingSettings
+ {
+ get
+ {
+ if (innerPartnerSharingSettings == null)
+ {
+ return null;
+ }
+ else
+ {
+ return innerPartnerSharingSettings.AsReadOnly();
+ }
+ }
+ }
+
+ public AdjustThirdPartySharing(bool? isEnabled)
+ {
+ this.IsEnabled = isEnabled;
+ }
+
+ public void AddGranularOption(string partnerName, string key, string value)
+ {
+ if (this.innerGranularOptions == null)
+ {
+ this.innerGranularOptions = new List();
+ }
+ this.innerGranularOptions.Add(partnerName);
+ this.innerGranularOptions.Add(key);
+ this.innerGranularOptions.Add(value);
+ }
+
+ public void AddPartnerSharingSetting(string partnerName, string key, bool value)
+ {
+ if (this.innerPartnerSharingSettings == null)
+ {
+ this.innerPartnerSharingSettings = new List();
+ }
+ this.innerPartnerSharingSettings.Add(partnerName);
+ this.innerPartnerSharingSettings.Add(key);
+ this.innerPartnerSharingSettings.Add(value.ToString());
+ }
+ }
+}
diff --git a/Assets/rd3/Adjust/Scripts/AdjustThirdPartySharing.cs.meta b/Assets/rd3/Adjust/Scripts/AdjustThirdPartySharing.cs.meta
new file mode 100644
index 0000000..5270a0b
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/AdjustThirdPartySharing.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: dcb2591dfab904327904b8879af699ca
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/rd3/Adjust/Scripts/AdjustThreadDispatcher.cs b/Assets/rd3/Adjust/Scripts/AdjustThreadDispatcher.cs
new file mode 100644
index 0000000..26157f3
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/AdjustThreadDispatcher.cs
@@ -0,0 +1,49 @@
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class AdjustThreadDispatcher : MonoBehaviour
+{
+ private static readonly Queue executionQueue = new Queue();
+ private static AdjustThreadDispatcher instance;
+
+ public static void RunOnMainThread(Action action)
+ {
+ if (action == null)
+ {
+ return;
+ }
+
+ lock (executionQueue)
+ {
+ executionQueue.Enqueue(action);
+ }
+ }
+
+ private void Update()
+ {
+ while (executionQueue.Count > 0)
+ {
+ Action action;
+ lock (executionQueue)
+ {
+ action = executionQueue.Dequeue();
+ }
+ if (action != null)
+ {
+ action.Invoke();
+ }
+ }
+ }
+
+ [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
+ private static void Initialize()
+ {
+ if (instance == null)
+ {
+ GameObject obj = new GameObject("AdjustThreadDispatcher");
+ instance = obj.AddComponent();
+ DontDestroyOnLoad(obj);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/rd3/Adjust/Scripts/AdjustThreadDispatcher.cs.meta b/Assets/rd3/Adjust/Scripts/AdjustThreadDispatcher.cs.meta
new file mode 100644
index 0000000..fe68f17
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/AdjustThreadDispatcher.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 068759bba95d0411895637c9165b2f99
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/rd3/Adjust/Scripts/AdjustUtils.cs b/Assets/rd3/Adjust/Scripts/AdjustUtils.cs
new file mode 100644
index 0000000..ae21f5e
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/AdjustUtils.cs
@@ -0,0 +1,448 @@
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using UnityEngine;
+
+namespace AdjustSdk
+{
+ public class AdjustUtils
+ {
+ public static string KeyAdid = "adid";
+ public static string KeyMessage = "message";
+ public static string KeyNetwork = "network";
+ public static string KeyAdgroup = "adgroup";
+ public static string KeyCampaign = "campaign";
+ public static string KeyCreative = "creative";
+ public static string KeyWillRetry = "willRetry";
+ public static string KeyTimestamp = "timestamp";
+ public static string KeyCallbackId = "callbackId";
+ public static string KeyEventToken = "eventToken";
+ public static string KeyClickLabel = "clickLabel";
+ public static string KeyTrackerName = "trackerName";
+ public static string KeyTrackerToken = "trackerToken";
+ public static string KeyJsonResponse = "jsonResponse";
+ public static string KeyCostType = "costType";
+ public static string KeyCostAmount = "costAmount";
+ public static string KeyCostCurrency = "costCurrency";
+ public static string KeyFbInstallReferrer = "fbInstallReferrer";
+ public static string KeySkanConversionValue = "fineValue";
+ public static string KeySkanCoarseValue = "coarseValue";
+ public static string KeySkanLockWindow = "lockWindow";
+ public static string KeyCode = "code";
+ public static string KeyVerificationStatus = "verificationStatus";
+
+ // For testing purposes.
+ public static string KeyTestOptionsBaseUrl = "baseUrl";
+ public static string KeyTestOptionsGdprUrl = "gdprUrl";
+ public static string KeyTestOptionsSubscriptionUrl = "subscriptionUrl";
+ public static string KeyTestOptionsPurchaseVerificationUrl = "purchaseVerificationUrl";
+ public static string KeyTestOptionsOverwriteUrl = "urlOverwrite";
+ public static string KeyTestOptionsExtraPath = "extraPath";
+ public static string KeyTestOptionsBasePath = "basePath";
+ public static string KeyTestOptionsGdprPath = "gdprPath";
+ public static string KeyTestOptionsDeleteState = "deleteState";
+ public static string KeyTestOptionsUseTestConnectionOptions = "useTestConnectionOptions";
+ public static string KeyTestOptionsTimerIntervalInMilliseconds = "timerIntervalInMilliseconds";
+ public static string KeyTestOptionsTimerStartInMilliseconds = "timerStartInMilliseconds";
+ public static string KeyTestOptionsSessionIntervalInMilliseconds = "sessionIntervalInMilliseconds";
+ public static string KeyTestOptionsSubsessionIntervalInMilliseconds = "subsessionIntervalInMilliseconds";
+ public static string KeyTestOptionsTeardown = "teardown";
+ public static string KeyTestOptionsNoBackoffWait = "noBackoffWait";
+ public static string KeyTestOptionsAdServicesFrameworkEnabled = "adServicesFrameworkEnabled";
+ public static string KeyTestOptionsAttStatus = "attStatus";
+ public static string KeyTestOptionsIdfa = "idfa";
+ public static string KeyTestOptionsIgnoreSystemLifecycleBootstrap = "ignoreSystemLifecycleBootstrap";
+
+ public static int ConvertLogLevel(AdjustLogLevel? logLevel)
+ {
+ if (logLevel == null)
+ {
+ return -1;
+ }
+
+ return (int)logLevel;
+ }
+
+ public static int ConvertBool(bool? value)
+ {
+ if (value == null)
+ {
+ return -1;
+ }
+ if (value.Value)
+ {
+ return 1;
+ }
+ else
+ {
+ return 0;
+ }
+ }
+
+ public static double ConvertDouble(double? value)
+ {
+ if (value == null)
+ {
+ return -1;
+ }
+
+ return (double)value;
+ }
+
+ public static int ConvertInt(int? value)
+ {
+ if (value == null)
+ {
+ return -1;
+ }
+
+ return (int)value;
+ }
+
+ public static long ConvertLong(long? value)
+ {
+ if (value == null)
+ {
+ return -1;
+ }
+
+ return (long)value;
+ }
+
+ public static string ConvertReadOnlyCollectionToJson(ReadOnlyCollection list)
+ {
+ if (list == null)
+ {
+ return null;
+ }
+
+ List processedList = new List();
+ for (int i = 0; i < list.Count; i += 1)
+ {
+ string item = list[i];
+
+ if (item == null)
+ {
+ continue;
+ }
+
+ processedList.Add(item);
+ }
+
+ // create JSON array
+ var jsonArray = new JSONArray();
+ foreach (var listItem in processedList)
+ {
+ jsonArray.Add(new JSONData(listItem));
+ }
+
+ return jsonArray.ToString();
+ }
+
+ public static string ConvertReadOnlyCollectionOfPairsToJson(ReadOnlyCollection list)
+ {
+ if (list == null)
+ {
+ return null;
+ }
+ // list of callback / partner parameters must contain even number of elements
+ if (list.Count % 2 != 0)
+ {
+ return null;
+ }
+
+ List processedList = new List();
+ for (int i = 0; i < list.Count; i += 2)
+ {
+ string key = list[i];
+ string value = list[i + 1];
+
+ if (key == null || value == null)
+ {
+ continue;
+ }
+
+ processedList.Add(key);
+ processedList.Add(value);
+ }
+
+ // create JSON array
+ var jsonArray = new JSONArray();
+ foreach (var listItem in processedList)
+ {
+ jsonArray.Add(new JSONData(listItem));
+ }
+
+ return jsonArray.ToString();
+ }
+
+ public static string ConvertReadOnlyCollectionOfTripletsToJson(ReadOnlyCollection list)
+ {
+ if (list == null)
+ {
+ return null;
+ }
+ // list of third party sharing parameters must contain number of elements divisible by 3
+ if (list.Count % 3 != 0)
+ {
+ return null;
+ }
+
+ List processedList = new List();
+ for (int i = 0; i < list.Count; i += 3)
+ {
+ string partnerName = list[i];
+ string key = list[i + 1];
+ string value = list[i + 2];
+
+ if (partnerName == null || key == null || value == null)
+ {
+ continue;
+ }
+
+ processedList.Add(partnerName);
+ processedList.Add(key);
+ processedList.Add(value);
+ }
+
+ // create JSON array
+ var jsonArray = new JSONArray();
+ foreach (var listItem in processedList)
+ {
+ jsonArray.Add(new JSONData(listItem));
+ }
+
+ return jsonArray.ToString();
+ }
+
+ public static string GetJsonResponseCompact(Dictionary dictionary)
+ {
+ string logJsonResponse = "";
+
+ if (dictionary == null)
+ {
+ return logJsonResponse;
+ }
+ else
+ {
+ int preLoopCounter = 0;
+ logJsonResponse += "{";
+
+ foreach (KeyValuePair pair in dictionary)
+ {
+ string valueString = pair.Value as string;
+
+ if (valueString != null)
+ {
+ if (++preLoopCounter > 1)
+ {
+ logJsonResponse += ",";
+ }
+
+ // if the value is another JSON/complex-structure
+ if (valueString.StartsWith("{") && valueString.EndsWith("}"))
+ {
+ logJsonResponse += "\"" + pair.Key + "\"" + ":" + valueString;
+ }
+ else
+ {
+ logJsonResponse += "\"" + pair.Key + "\"" + ":" + "\"" + valueString + "\"";
+ }
+
+ continue;
+ }
+
+ Dictionary valueDictionary = pair.Value as Dictionary;
+
+ if (++preLoopCounter > 1)
+ {
+ logJsonResponse += ",";
+ }
+
+ logJsonResponse += "\"" + pair.Key + "\"" + ":";
+ logJsonResponse += GetJsonResponseCompact(valueDictionary);
+ }
+
+ logJsonResponse += "}";
+ }
+
+ return logJsonResponse;
+ }
+
+ public static string GetJsonString(JSONNode node, string key)
+ {
+ if (node == null)
+ {
+ return null;
+ }
+
+ // Access value object and cast it to JSONData.
+ var nodeValue = node[key] as JSONData;
+
+ if (nodeValue == null)
+ {
+ return null;
+ }
+
+ // https://github.com/adjust/unity_sdk/issues/137
+ if (nodeValue == "")
+ {
+ return null;
+ }
+
+ return nodeValue.Value;
+ }
+
+ public static void WriteJsonResponseDictionary(JSONClass jsonObject, Dictionary output)
+ {
+ foreach (KeyValuePair pair in jsonObject)
+ {
+ // Try to cast value as a complex object.
+ var subNode = pair.Value.AsObject;
+ var key = pair.Key;
+
+ // Value is not a complex object.
+ if (subNode == null)
+ {
+ var value = pair.Value.Value;
+ output.Add(key, value);
+ continue;
+ }
+
+ // Create new dictionary for complex type.
+ var newSubDictionary = new Dictionary();
+
+ // Save it in the current dictionary.
+ output.Add(key, newSubDictionary);
+
+ // Recursive call to fill new dictionary.
+ WriteJsonResponseDictionary(subNode, newSubDictionary);
+ }
+ }
+
+ public static string TryGetValue(Dictionary dictionary, string key)
+ {
+ string value;
+ if (dictionary.TryGetValue(key, out value))
+ {
+ // https://github.com/adjust/unity_sdk/issues/137
+ if (value == "")
+ {
+ return null;
+ }
+ return value;
+ }
+ return null;
+ }
+
+ public static Dictionary GetSkanUpdateDataDictionary(string skanUpdateData)
+ {
+ Dictionary skanUpdateDataDictionary = new Dictionary();
+ var skanUpdateDataNode = JSON.Parse(skanUpdateData);
+ if (skanUpdateDataNode != null && skanUpdateDataNode.AsObject != null)
+ {
+ Dictionary temp = new Dictionary();
+ AdjustUtils.WriteJsonResponseDictionary(skanUpdateDataNode.AsObject, temp);
+ foreach (KeyValuePair entry in temp)
+ {
+ skanUpdateDataDictionary.Add(entry.Key, entry.Value.ToString());
+ }
+ }
+ return skanUpdateDataDictionary;
+ }
+
+ public static Dictionary GetAttributionJsonResponse(string attributionJsonResponse)
+ {
+ Dictionary attributionJsonResponseDictionary = new Dictionary();
+ var attributionJsonResponseNode = JSON.Parse(attributionJsonResponse);
+ if (attributionJsonResponseNode != null && attributionJsonResponseNode.AsObject != null)
+ {
+ Dictionary temp = new Dictionary();
+ AdjustUtils.WriteJsonResponseDictionary(attributionJsonResponseNode.AsObject, temp);
+ foreach (KeyValuePair entry in temp)
+ {
+ attributionJsonResponseDictionary.Add(entry.Key, entry.Value);
+ }
+ }
+ return attributionJsonResponseDictionary;
+ }
+
+ public static string GetValueOrEmptyToNull(string value)
+ {
+ return string.IsNullOrEmpty(value) ? null : value;
+ }
+
+#if UNITY_ANDROID
+ public static AndroidJavaObject TestOptionsMap2AndroidJavaObject(Dictionary testOptionsMap, AndroidJavaObject ajoCurrentActivity)
+ {
+ AndroidJavaObject ajoTestOptions = new AndroidJavaObject("com.adjust.sdk.AdjustTestOptions");
+ ajoTestOptions.Set("baseUrl", testOptionsMap[KeyTestOptionsBaseUrl]);
+ ajoTestOptions.Set("gdprUrl", testOptionsMap[KeyTestOptionsGdprUrl]);
+ ajoTestOptions.Set("subscriptionUrl", testOptionsMap[KeyTestOptionsSubscriptionUrl]);
+ ajoTestOptions.Set("purchaseVerificationUrl", testOptionsMap[KeyTestOptionsPurchaseVerificationUrl]);
+
+ if (testOptionsMap.ContainsKey(KeyTestOptionsExtraPath) && !string.IsNullOrEmpty(testOptionsMap[KeyTestOptionsExtraPath]))
+ {
+ ajoTestOptions.Set("basePath", testOptionsMap[KeyTestOptionsExtraPath]);
+ ajoTestOptions.Set("gdprPath", testOptionsMap[KeyTestOptionsExtraPath]);
+ ajoTestOptions.Set("subscriptionPath", testOptionsMap[KeyTestOptionsExtraPath]);
+ ajoTestOptions.Set("purchaseVerificationPath", testOptionsMap[KeyTestOptionsExtraPath]);
+ }
+ if (testOptionsMap.ContainsKey(KeyTestOptionsDeleteState) && ajoCurrentActivity != null)
+ {
+ ajoTestOptions.Set("context", ajoCurrentActivity);
+ }
+ if (testOptionsMap.ContainsKey(KeyTestOptionsUseTestConnectionOptions))
+ {
+ bool useTestConnectionOptions = testOptionsMap[KeyTestOptionsUseTestConnectionOptions].ToLower() == "true";
+ AndroidJavaObject ajoUseTestConnectionOptions = new AndroidJavaObject("java.lang.Boolean", useTestConnectionOptions);
+ ajoTestOptions.Set("useTestConnectionOptions", ajoUseTestConnectionOptions);
+ }
+ if (testOptionsMap.ContainsKey(KeyTestOptionsTimerIntervalInMilliseconds))
+ {
+ var timerIntervalInMilliseconds = long.Parse(testOptionsMap[KeyTestOptionsTimerIntervalInMilliseconds]);
+ AndroidJavaObject ajoTimerIntervalInMilliseconds = new AndroidJavaObject("java.lang.Long", timerIntervalInMilliseconds);
+ ajoTestOptions.Set("timerIntervalInMilliseconds", ajoTimerIntervalInMilliseconds);
+ }
+ if (testOptionsMap.ContainsKey(KeyTestOptionsTimerStartInMilliseconds))
+ {
+ var timerStartInMilliseconds = long.Parse(testOptionsMap[KeyTestOptionsTimerStartInMilliseconds]);
+ AndroidJavaObject ajoTimerStartInMilliseconds = new AndroidJavaObject("java.lang.Long", timerStartInMilliseconds);
+ ajoTestOptions.Set("timerStartInMilliseconds", ajoTimerStartInMilliseconds);
+ }
+ if (testOptionsMap.ContainsKey(KeyTestOptionsSessionIntervalInMilliseconds))
+ {
+ var sessionIntervalInMilliseconds = long.Parse(testOptionsMap[KeyTestOptionsSessionIntervalInMilliseconds]);
+ AndroidJavaObject ajoSessionIntervalInMilliseconds = new AndroidJavaObject("java.lang.Long", sessionIntervalInMilliseconds);
+ ajoTestOptions.Set("sessionIntervalInMilliseconds", ajoSessionIntervalInMilliseconds);
+ }
+ if (testOptionsMap.ContainsKey(KeyTestOptionsSubsessionIntervalInMilliseconds))
+ {
+ var subsessionIntervalInMilliseconds = long.Parse(testOptionsMap[KeyTestOptionsSubsessionIntervalInMilliseconds]);
+ AndroidJavaObject ajoSubsessionIntervalInMilliseconds = new AndroidJavaObject("java.lang.Long", subsessionIntervalInMilliseconds);
+ ajoTestOptions.Set("subsessionIntervalInMilliseconds", ajoSubsessionIntervalInMilliseconds);
+ }
+ if (testOptionsMap.ContainsKey(KeyTestOptionsTeardown))
+ {
+ bool teardown = testOptionsMap[KeyTestOptionsTeardown].ToLower() == "true";
+ AndroidJavaObject ajoTeardown = new AndroidJavaObject("java.lang.Boolean", teardown);
+ ajoTestOptions.Set("teardown", ajoTeardown);
+ }
+ if (testOptionsMap.ContainsKey(KeyTestOptionsNoBackoffWait))
+ {
+ bool noBackoffWait = testOptionsMap[KeyTestOptionsNoBackoffWait].ToLower() == "true";
+ AndroidJavaObject ajoNoBackoffWait = new AndroidJavaObject("java.lang.Boolean", noBackoffWait);
+ ajoTestOptions.Set("noBackoffWait", ajoNoBackoffWait);
+ }
+ if (testOptionsMap.ContainsKey(KeyTestOptionsIgnoreSystemLifecycleBootstrap))
+ {
+ // TODO: fix native logic not to have negation in naming throughout the chain of calls
+ bool doNotIgnoreSystemLifecycleBootstrap = testOptionsMap[KeyTestOptionsIgnoreSystemLifecycleBootstrap].ToLower() == "true";
+ AndroidJavaObject ajoDoNotIgnoreSystemLifecycleBootstrap = new AndroidJavaObject("java.lang.Boolean", doNotIgnoreSystemLifecycleBootstrap);
+ ajoTestOptions.Set("ignoreSystemLifecycleBootstrap", ajoDoNotIgnoreSystemLifecycleBootstrap);
+ }
+
+ return ajoTestOptions;
+ }
+#endif
+ }
+}
diff --git a/Assets/rd3/Adjust/Scripts/AdjustUtils.cs.meta b/Assets/rd3/Adjust/Scripts/AdjustUtils.cs.meta
new file mode 100644
index 0000000..5f6f1ad
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/AdjustUtils.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 98e51a1481cc24ddebf93f61f6c1eb9d
+timeCreated: 1458230617
+licenseType: Free
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/rd3/Adjust/Scripts/AdjustiOS.cs b/Assets/rd3/Adjust/Scripts/AdjustiOS.cs
new file mode 100644
index 0000000..308b720
--- /dev/null
+++ b/Assets/rd3/Adjust/Scripts/AdjustiOS.cs
@@ -0,0 +1,1121 @@
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+using UnityEngine;
+
+namespace AdjustSdk
+{
+#if UNITY_IOS
+ public class AdjustiOS
+ {
+ private const string sdkPrefix = "unity5.4.2";
+
+ // app callbacks as method parameters
+ private static List> appIsEnabledGetterCallbacks;
+ private static List> appAttributionGetterCallbacks;
+ private static List> appAdidGetterCallbacks;
+ private static List> appIdfaGetterCallbacks;
+ private static List> appIdfvGetterCallbacks;
+ private static List> appLastDeeplinkGetterCallbacks;
+ private static List> appSdkVersionGetterCallbacks;
+ private static List