Skip to content

Commit 0681fff

Browse files
authored
Merge pull request #291 from adjust/v4380
Version 4.38.0
2 parents 36626ac + a6110a5 commit 0681fff

19 files changed

+98
-118
lines changed

Assets/Adjust/Android/AdjustAndroid.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace com.adjust.sdk
88
#if UNITY_ANDROID
99
public class AdjustAndroid
1010
{
11-
private const string sdkPrefix = "unity4.37.2";
11+
private const string sdkPrefix = "unity4.38.0";
1212
private static bool launchDeferredDeeplink = true;
1313
private static AndroidJavaClass ajcAdjust = new AndroidJavaClass("com.adjust.sdk.Adjust");
1414
private static AndroidJavaObject ajoCurrentActivity = new AndroidJavaClass("com.unity3d.player.UnityPlayer").GetStatic<AndroidJavaObject>("currentActivity");
443 Bytes
Binary file not shown.

Assets/Adjust/Test/CommandExecutor.cs

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,13 @@ public class CommandExecutor
1717

1818
private Dictionary<int, AdjustConfig> _savedConfigs = new Dictionary<int, AdjustConfig>();
1919
private Dictionary<int, AdjustEvent> _savedEvents = new Dictionary<int, AdjustEvent>();
20-
private string _baseUrl;
21-
private string _gdprUrl;
22-
private string _subscriptionUrl;
23-
private string _purchaseVerificationUrl;
20+
private string _overwriteUrl;
2421
private Command _command;
2522
private ITestLibrary _testLibrary;
2623

27-
public CommandExecutor(
28-
ITestLibrary testLibrary,
29-
string baseUrl,
30-
string gdprUrl,
31-
string subscriptionUrl,
32-
string purchaseVerificationUrl)
24+
public CommandExecutor(ITestLibrary testLibrary, string overwriteUrl)
3325
{
34-
_baseUrl = baseUrl;
35-
_gdprUrl = gdprUrl;
36-
_subscriptionUrl = subscriptionUrl;
37-
_purchaseVerificationUrl = purchaseVerificationUrl;
26+
_overwriteUrl = overwriteUrl;
3827
_testLibrary = testLibrary;
3928
}
4029

@@ -96,10 +85,11 @@ public void ExecuteCommand(Command command)
9685
private void TestOptions()
9786
{
9887
Dictionary<string, string> testOptions = new Dictionary<string, string>();
99-
testOptions[AdjustUtils.KeyTestOptionsBaseUrl] = _baseUrl;
100-
testOptions[AdjustUtils.KeyTestOptionsGdprUrl] = _gdprUrl;
101-
testOptions[AdjustUtils.KeyTestOptionsSubscriptionUrl] = _subscriptionUrl;
102-
testOptions[AdjustUtils.KeyTestOptionsPurchaseVerificationUrl] = _purchaseVerificationUrl;
88+
testOptions[AdjustUtils.KeyTestOptionsBaseUrl] = _overwriteUrl;
89+
testOptions[AdjustUtils.KeyTestOptionsGdprUrl] = _overwriteUrl;
90+
testOptions[AdjustUtils.KeyTestOptionsSubscriptionUrl] = _overwriteUrl;
91+
testOptions[AdjustUtils.KeyTestOptionsPurchaseVerificationUrl] = _overwriteUrl;
92+
testOptions[AdjustUtils.KeyTestOptionsOverwriteUrl] = _overwriteUrl;
10393

10494
if (_command.ContainsParameter("basePath"))
10595
{
@@ -131,6 +121,14 @@ private void TestOptions()
131121
{
132122
testOptions[AdjustUtils.KeyTestOptionsAdServicesFrameworkEnabled] = _command.GetFirstParameterValue("adServicesFrameworkEnabled");
133123
}
124+
if (_command.ContainsParameter("attStatus"))
125+
{
126+
testOptions[AdjustUtils.KeyTestOptionsAttStatus] = _command.GetFirstParameterValue("attStatus");
127+
}
128+
if (_command.ContainsParameter("idfa"))
129+
{
130+
testOptions[AdjustUtils.KeyTestOptionsIdfa] = _command.GetFirstParameterValue("idfa");
131+
}
134132
#if UNITY_ANDROID
135133
bool useTestConnectionOptions = false;
136134
#endif
@@ -388,6 +386,13 @@ private void Config()
388386
}
389387
}
390388

389+
if (_command.ContainsParameter("attConsentWaitingSeconds"))
390+
{
391+
var attConsentWaitingSecondsStr = _command.GetFirstParameterValue("attConsentWaitingSeconds");
392+
var attConsentWaitingSeconds = int.Parse(attConsentWaitingSecondsStr, System.Globalization.CultureInfo.InvariantCulture);
393+
adjustConfig.setAttConsentWaitingInterval(attConsentWaitingSeconds);
394+
}
395+
391396
if (_command.ContainsParameter("deferredDeeplinkCallback"))
392397
{
393398
bool launchDeferredDeeplink = _command.GetFirstParameterValue("deferredDeeplinkCallback") == "true";

Assets/Adjust/Test/TestApp.cs

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,18 @@ public class TestApp : MonoBehaviour
1212
#if UNITY_ANDROID
1313
private const string PORT = ":8443";
1414
private const string PROTOCOL = "https://";
15-
private const string IP = "192.168.8.98";
15+
private const string IP = "192.168.8.65";
1616
#elif UNITY_IOS
1717
private const string PORT = ":8080";
1818
private const string PROTOCOL = "http://";
19-
private const string IP = "192.168.8.98";
19+
private const string IP = "192.168.8.65";
2020
private TestLibraryiOS _testLibraryiOS;
2121
#else
2222
private const string PORT = ":8080";
2323
private const string PROTOCOL = "http://";
2424
private const string IP = "localhost";
2525
#endif
26-
private const string BASE_URL = PROTOCOL + IP + PORT;
27-
private const string GDPR_URL = PROTOCOL + IP + PORT;
28-
private const string SUBSCRIPTION_URL = PROTOCOL + IP + PORT;
29-
private const string PURCHASE_VERIFICATION_URL = PROTOCOL + IP + PORT;
26+
private const string OVERWRITE_URL = PROTOCOL + IP + PORT;
3027
private const string CONTROL_URL = "ws://" + IP + ":1987";
3128

3229
void OnGUI()
@@ -54,24 +51,14 @@ private void StartTestSession()
5451
private ITestLibrary GetPlatformSpecificTestLibrary()
5552
{
5653
#if UNITY_IOS
57-
return new TestLibraryiOS(
58-
BASE_URL,
59-
GDPR_URL,
60-
SUBSCRIPTION_URL,
61-
PURCHASE_VERIFICATION_URL,
62-
CONTROL_URL);
54+
return new TestLibraryiOS(OVERWRITE_URL, CONTROL_URL);
6355
#elif UNITY_ANDROID
64-
return new TestLibraryAndroid(
65-
BASE_URL,
66-
GDPR_URL,
67-
SUBSCRIPTION_URL,
68-
PURCHASE_VERIFICATION_URL,
69-
CONTROL_URL);
56+
return new TestLibraryAndroid(OVERWRITE_URL, CONTROL_URL);
7057
#elif (UNITY_WSA || UNITY_WP8)
7158
return new TestLibraryWindows(
72-
BASE_URL,
59+
OVERWRITE_URL,
7360
CONTROL_URL,
74-
GDPR_URL);
61+
OVERWRITE_URL);
7562
#else
7663
Debug.Log("Cannot run integration tests (Error in TestApp.GetPlatformSpecificTestLibrary(...)). None of the supported platforms selected.");
7764
return null;

Assets/Adjust/Test/TestLibraryAndroid.cs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,13 @@ public class TestLibraryAndroid : ITestLibrary
88
private AndroidJavaObject ajoTestLibrary;
99
private CommandListenerAndroid onCommandReceivedListener;
1010

11-
public TestLibraryAndroid(
12-
string baseUrl,
13-
string gdprUrl,
14-
string subscriptionUrl,
15-
string purchaseVerificationUrl,
16-
string controlUrl)
11+
public TestLibraryAndroid(string overwriteUrl, string controlUrl)
1712
{
18-
CommandExecutor commandExecutor = new CommandExecutor(
19-
this,
20-
baseUrl,
21-
gdprUrl,
22-
subscriptionUrl,
23-
purchaseVerificationUrl);
13+
CommandExecutor commandExecutor = new CommandExecutor(this, overwriteUrl);
2414
onCommandReceivedListener = new CommandListenerAndroid(commandExecutor);
2515
ajoTestLibrary = new AndroidJavaObject(
2616
"com.adjust.test.TestLibrary",
27-
baseUrl,
17+
overwriteUrl,
2818
controlUrl,
2919
onCommandReceivedListener);
3020
}

Assets/Adjust/Test/TestLibraryBridgeiOS.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace com.adjust.sdk.test
77
public static class TestLibraryBridgeiOS
88
{
99
[DllImport("__Internal")]
10-
private static extern void _ATLInitialize(string baseUrl, string controlUrl);
10+
private static extern void _ATLInitialize(string overwriteUrl, string controlUrl);
1111

1212
[DllImport("__Internal")]
1313
private static extern void _ATLStartTestSession(string clientSdk);
@@ -24,9 +24,9 @@ public static class TestLibraryBridgeiOS
2424
[DllImport("__Internal")]
2525
private static extern void _ATLAddTestDirectory(string testDirectory);
2626

27-
public static void Initialize(string baseUrl, string controlUrl)
27+
public static void Initialize(string overwriteUrl, string controlUrl)
2828
{
29-
_ATLInitialize(baseUrl, controlUrl);
29+
_ATLInitialize(overwriteUrl, controlUrl);
3030
}
3131

3232
public static void StartTestSession(string clientSdk)

Assets/Adjust/Test/TestLibraryiOS.cs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,10 @@ public class TestLibraryiOS : ITestLibrary
88
#if UNITY_IOS
99
private CommandExecutor _commandExecutor;
1010

11-
public TestLibraryiOS(
12-
string baseUrl,
13-
string gdprUrl,
14-
string subscriptionUrl,
15-
string purchaseVerificationUrl,
16-
string controlUrl)
11+
public TestLibraryiOS(string overwriteUrl, string controlUrl)
1712
{
18-
_commandExecutor = new CommandExecutor(
19-
this,
20-
baseUrl,
21-
gdprUrl,
22-
subscriptionUrl,
23-
purchaseVerificationUrl);
24-
TestLibraryBridgeiOS.Initialize(baseUrl, controlUrl);
13+
_commandExecutor = new CommandExecutor(this, overwriteUrl);
14+
TestLibraryBridgeiOS.Initialize(overwriteUrl, controlUrl);
2515
}
2616

2717
public void StartTestSession()

Assets/Adjust/Unity/AdjustUtils.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public class AdjustUtils
3636
public static string KeyTestOptionsGdprUrl = "gdprUrl";
3737
public static string KeyTestOptionsSubscriptionUrl = "subscriptionUrl";
3838
public static string KeyTestOptionsPurchaseVerificationUrl = "purchaseVerificationUrl";
39+
public static string KeyTestOptionsOverwriteUrl = "urlOverwrite";
3940
public static string KeyTestOptionsExtraPath = "extraPath";
4041
public static string KeyTestOptionsBasePath = "basePath";
4142
public static string KeyTestOptionsGdprPath = "gdprPath";
@@ -48,6 +49,8 @@ public class AdjustUtils
4849
public static string KeyTestOptionsTeardown = "teardown";
4950
public static string KeyTestOptionsNoBackoffWait = "noBackoffWait";
5051
public static string KeyTestOptionsAdServicesFrameworkEnabled = "adServicesFrameworkEnabled";
52+
public static string KeyTestOptionsAttStatus = "attStatus";
53+
public static string KeyTestOptionsIdfa = "idfa";
5154

5255
public static int ConvertLogLevel(AdjustLogLevel? logLevel)
5356
{

Assets/Adjust/Windows/AdjustWindows.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace com.adjust.sdk
1717
{
1818
public class AdjustWindows
1919
{
20-
private const string sdkPrefix = "unity4.37.2";
20+
private const string sdkPrefix = "unity4.38.0";
2121
private static bool appLaunched = false;
2222

2323
public static void Start(AdjustConfig adjustConfig)

Assets/Adjust/iOS/Adjust.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Adjust.h
33
// Adjust SDK
44
//
5-
// V4.37.2
5+
// V4.38.0
66
// Created by Christian Wellenbrock (@wellle) on 23rd July 2013.
77
// Copyright (c) 2012-2021 Adjust GmbH. All rights reserved.
88
//
@@ -21,15 +21,14 @@ typedef void(^AdjustResolvedDeeplinkBlock)(NSString * _Nonnull resolvedLink);
2121

2222
@interface AdjustTestOptions : NSObject
2323

24-
@property (nonatomic, copy, nullable) NSString *baseUrl;
25-
@property (nonatomic, copy, nullable) NSString *gdprUrl;
26-
@property (nonatomic, copy, nullable) NSString *subscriptionUrl;
27-
@property (nonatomic, copy, nullable) NSString *purchaseVerificationUrl;
24+
@property (nonatomic, copy, nullable) NSString *urlOverwrite;
2825
@property (nonatomic, copy, nullable) NSString *extraPath;
2926
@property (nonatomic, copy, nullable) NSNumber *timerIntervalInMilliseconds;
3027
@property (nonatomic, copy, nullable) NSNumber *timerStartInMilliseconds;
3128
@property (nonatomic, copy, nullable) NSNumber *sessionIntervalInMilliseconds;
3229
@property (nonatomic, copy, nullable) NSNumber *subsessionIntervalInMilliseconds;
30+
@property (nonatomic, copy, nullable) NSNumber *attStatusInt;
31+
@property (nonatomic, copy, nullable) NSString *idfa;
3332
@property (nonatomic, assign) BOOL teardown;
3433
@property (nonatomic, assign) BOOL deleteState;
3534
@property (nonatomic, assign) BOOL noBackoffWait;

Assets/Adjust/iOS/AdjustSdk.a

18.4 KB
Binary file not shown.

Assets/Adjust/iOS/AdjustUnity.mm

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -924,10 +924,7 @@ void _AdjustProcessDeeplink(const char* url, const char* sceneName) {
924924
}
925925
}
926926

927-
void _AdjustSetTestOptions(const char* baseUrl,
928-
const char* gdprUrl,
929-
const char* subscriptionUrl,
930-
const char* purchaseVerificationUrl,
927+
void _AdjustSetTestOptions(const char* overwriteUrl,
931928
const char* extraPath,
932929
long timerIntervalInMilliseconds,
933930
long timerStartInMilliseconds,
@@ -936,38 +933,29 @@ void _AdjustSetTestOptions(const char* baseUrl,
936933
int teardown,
937934
int deleteState,
938935
int noBackoffWait,
939-
int adServicesFrameworkEnabled) {
936+
int adServicesFrameworkEnabled,
937+
int attStatus,
938+
const char *idfa) {
940939
AdjustTestOptions *testOptions = [[AdjustTestOptions alloc] init];
941940

942-
NSString *stringBaseUrl = isStringValid(baseUrl) == true ? [NSString stringWithUTF8String:baseUrl] : nil;
943-
if (stringBaseUrl != nil) {
944-
[testOptions setBaseUrl:stringBaseUrl];
941+
NSString *stringOverwriteUrl = isStringValid(overwriteUrl) == true ? [NSString stringWithUTF8String:overwriteUrl] : nil;
942+
if (stringOverwriteUrl != nil) {
943+
[testOptions setUrlOverwrite:stringOverwriteUrl];
945944
}
946-
947-
NSString *stringGdprUrl = isStringValid(baseUrl) == true ? [NSString stringWithUTF8String:gdprUrl] : nil;
948-
if (stringGdprUrl != nil) {
949-
[testOptions setGdprUrl:stringGdprUrl];
950-
}
951-
952-
NSString *stringSubscriptionUrl = isStringValid(baseUrl) == true ? [NSString stringWithUTF8String:subscriptionUrl] : nil;
953-
if (stringSubscriptionUrl != nil) {
954-
[testOptions setSubscriptionUrl:stringSubscriptionUrl];
955-
}
956-
957-
NSString *stringPurchaseVerificationUrl = isStringValid(baseUrl) == true ? [NSString stringWithUTF8String:purchaseVerificationUrl] : nil;
958-
if (stringPurchaseVerificationUrl != nil) {
959-
[testOptions setPurchaseVerificationUrl:stringPurchaseVerificationUrl];
960-
}
961-
962945
NSString *stringExtraPath = isStringValid(extraPath) == true ? [NSString stringWithUTF8String:extraPath] : nil;
963946
if (stringExtraPath != nil && [stringExtraPath length] > 0) {
964947
[testOptions setExtraPath:stringExtraPath];
965948
}
949+
NSString *stringIdfa = isStringValid(idfa) == true ? [NSString stringWithUTF8String:idfa] : nil;
950+
if (stringIdfa != nil && [stringIdfa length] > 0) {
951+
[testOptions setIdfa:stringIdfa];
952+
}
966953

967954
testOptions.timerIntervalInMilliseconds = [NSNumber numberWithLong:timerIntervalInMilliseconds];
968955
testOptions.timerStartInMilliseconds = [NSNumber numberWithLong:timerStartInMilliseconds];
969956
testOptions.sessionIntervalInMilliseconds = [NSNumber numberWithLong:sessionIntervalInMilliseconds];
970957
testOptions.subsessionIntervalInMilliseconds = [NSNumber numberWithLong:subsessionIntervalInMilliseconds];
958+
testOptions.attStatusInt = [NSNumber numberWithInt:attStatus];
971959

972960
if (teardown != -1) {
973961
[AdjustUnityDelegate teardown];

0 commit comments

Comments
 (0)