Skip to content

Commit e31ea3e

Browse files
authored
Merge pull request #348 from adjust/v545
Version 5.4.5
2 parents b187857 + 6b07e09 commit e31ea3e

File tree

12 files changed

+453
-55
lines changed

12 files changed

+453
-55
lines changed

Assets/Adjust/Native/Editor/Dependencies.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<dependencies>
33
<androidPackages>
4-
<androidPackage spec="com.adjust.sdk:adjust-android:5.4.5">
4+
<androidPackage spec="com.adjust.sdk:adjust-android:5.4.6">
55
</androidPackage>
66
<androidPackage spec="com.android.installreferrer:installreferrer:2.2">
77
</androidPackage>

Assets/Adjust/Scripts/Adjust.cs

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.Linq;
34
using UnityEngine;
45

56
namespace AdjustSdk
@@ -33,14 +34,32 @@ public class Adjust : MonoBehaviour
3334
[HideInInspector]
3435
public bool linkMe = false;
3536
[HideInInspector]
37+
public bool deviceIdsReadingOnce = false;
38+
[HideInInspector]
39+
public int eventDeduplicationIdsMaxSize = 0;
40+
[HideInInspector]
41+
public bool firstSessionDelay = false;
42+
[HideInInspector]
3643
public string defaultTracker;
44+
[HideInInspector]
45+
public string storeName;
46+
[HideInInspector]
47+
public string storeAppId;
48+
[HideInInspector]
49+
public List<string> urlStrategyDomains = new List<string>();
50+
[HideInInspector]
51+
public bool shouldUseSubdomains = false;
52+
[HideInInspector]
53+
public bool isDataResidency = false;
3754

3855
// [Header("ANDROID SPECIFIC FEATURES:")]
3956
// [Space(5)]
4057
[HideInInspector]
4158
public bool preinstallTracking = false;
4259
[HideInInspector]
4360
public string preinstallFilePath;
61+
[HideInInspector]
62+
public string fbAppId;
4463

4564
// [Header("iOS SPECIFIC FEATURES:")]
4665
// [Space(5)]
@@ -49,7 +68,13 @@ public class Adjust : MonoBehaviour
4968
[HideInInspector]
5069
public bool idfaReading = true;
5170
[HideInInspector]
71+
public bool idfvReading = true;
72+
[HideInInspector]
5273
public bool skanAttribution = true;
74+
[HideInInspector]
75+
public bool appTrackingTransparencyUsage = true;
76+
[HideInInspector]
77+
public int attConsentWaitingInterval = 0;
5378

5479
void Awake()
5580
{
@@ -83,15 +108,45 @@ void Awake()
83108
adjustConfig.IsSendingInBackgroundEnabled = this.sendInBackground;
84109
adjustConfig.IsDeferredDeeplinkOpeningEnabled = this.launchDeferredDeeplink;
85110
adjustConfig.DefaultTracker = this.defaultTracker;
86-
// TODO: URL strategy
87111
adjustConfig.IsCoppaComplianceEnabled = this.coppaCompliance;
88112
adjustConfig.IsCostDataInAttributionEnabled = this.costDataInAttribution;
113+
adjustConfig.IsDeviceIdsReadingOnceEnabled = this.deviceIdsReadingOnce;
114+
if (this.eventDeduplicationIdsMaxSize > 0)
115+
{
116+
adjustConfig.EventDeduplicationIdsMaxSize = this.eventDeduplicationIdsMaxSize;
117+
}
118+
adjustConfig.IsFirstSessionDelayEnabled = this.firstSessionDelay;
119+
if (!string.IsNullOrEmpty(this.storeName))
120+
{
121+
AdjustStoreInfo storeInfo = new AdjustStoreInfo(this.storeName);
122+
if (!string.IsNullOrEmpty(this.storeAppId))
123+
{
124+
storeInfo.StoreAppId = this.storeAppId;
125+
}
126+
adjustConfig.StoreInfo = storeInfo;
127+
}
128+
if (this.urlStrategyDomains != null && this.urlStrategyDomains.Count > 0)
129+
{
130+
// Filter out empty strings
131+
List<string> validDomains = this.urlStrategyDomains.Where(domain => !string.IsNullOrEmpty(domain)).ToList();
132+
if (validDomains.Count > 0)
133+
{
134+
adjustConfig.SetUrlStrategy(validDomains, this.shouldUseSubdomains, this.isDataResidency);
135+
}
136+
}
89137
adjustConfig.IsPreinstallTrackingEnabled = this.preinstallTracking;
90138
adjustConfig.PreinstallFilePath = this.preinstallFilePath;
139+
adjustConfig.FbAppId = this.fbAppId;
91140
adjustConfig.IsAdServicesEnabled = this.adServices;
92141
adjustConfig.IsIdfaReadingEnabled = this.idfaReading;
142+
adjustConfig.IsIdfvReadingEnabled = this.idfvReading;
93143
adjustConfig.IsLinkMeEnabled = this.linkMe;
94144
adjustConfig.IsSkanAttributionEnabled = this.skanAttribution;
145+
adjustConfig.IsAppTrackingTransparencyUsageEnabled = this.appTrackingTransparencyUsage;
146+
if (this.attConsentWaitingInterval > 0)
147+
{
148+
adjustConfig.AttConsentWaitingInterval = this.attConsentWaitingInterval;
149+
}
95150
Adjust.InitSdk(adjustConfig);
96151
}
97152
}

Assets/Adjust/Scripts/AdjustAndroid.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace AdjustSdk
88
#if UNITY_ANDROID
99
public class AdjustAndroid
1010
{
11-
private const string sdkPrefix = "unity5.4.4";
11+
private const string sdkPrefix = "unity5.4.5";
1212
private static bool isDeferredDeeplinkOpeningEnabled = 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");

Assets/Adjust/Scripts/AdjustiOS.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace AdjustSdk
88
#if UNITY_IOS
99
public class AdjustiOS
1010
{
11-
private const string sdkPrefix = "unity5.4.4";
11+
private const string sdkPrefix = "unity5.4.5";
1212

1313
// app callbacks as method parameters
1414
private static List<Action<bool>> appIsEnabledGetterCallbacks;

Assets/Adjust/Scripts/Editor/AdjustCustomEditor.cs

Lines changed: 51 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,28 +31,69 @@ public override void OnInspectorGUI()
3131
EditorGUILayout.Space();
3232
EditorGUILayout.LabelField("MULTIPLATFORM SETTINGS:", darkerCyanTextFieldStyles);
3333
EditorGUI.indentLevel += 1;
34+
EditorGUILayout.Space();
3435
adjust.appToken = EditorGUILayout.TextField("App Token", adjust.appToken);
3536
adjust.environment = (AdjustEnvironment)EditorGUILayout.EnumPopup("Environment", adjust.environment);
3637
adjust.logLevel = (AdjustLogLevel)EditorGUILayout.EnumPopup("Log Level", adjust.logLevel);
37-
// TODO: URL strategy missing
38+
adjust.firstSessionDelay = EditorGUILayout.Toggle("First Session Delay", adjust.firstSessionDelay);
3839
adjust.sendInBackground = EditorGUILayout.Toggle("Send In Background", adjust.sendInBackground);
3940
adjust.launchDeferredDeeplink = EditorGUILayout.Toggle("Launch Deferred Deep Link", adjust.launchDeferredDeeplink);
4041
adjust.costDataInAttribution = EditorGUILayout.Toggle("Cost Data In Attribution Callback", adjust.costDataInAttribution);
41-
adjust.linkMe = EditorGUILayout.Toggle("LinkMe", adjust.linkMe);
42+
adjust.deviceIdsReadingOnce = EditorGUILayout.Toggle("Device IDs Reading Once", adjust.deviceIdsReadingOnce);
43+
adjust.eventDeduplicationIdsMaxSize = EditorGUILayout.IntField("Event Deduplication IDs Count", adjust.eventDeduplicationIdsMaxSize);
4244
adjust.defaultTracker = EditorGUILayout.TextField("Default Tracker", adjust.defaultTracker);
43-
EditorGUI.indentLevel -= 1;
45+
46+
// Store Info section - visually grouped
4447
EditorGUILayout.Space();
45-
EditorGUILayout.LabelField("ANDROID SETTINGS:", darkerCyanTextFieldStyles);
48+
EditorGUILayout.LabelField("Store Info:", EditorStyles.boldLabel);
4649
EditorGUI.indentLevel += 1;
47-
adjust.preinstallTracking = EditorGUILayout.Toggle("Preinstall Tracking", adjust.preinstallTracking);
48-
adjust.preinstallFilePath = EditorGUILayout.TextField("Preinstall File Path", adjust.preinstallFilePath);
50+
adjust.storeName = EditorGUILayout.TextField("Store Name", adjust.storeName);
51+
adjust.storeAppId = EditorGUILayout.TextField("Store App ID", adjust.storeAppId);
4952
EditorGUI.indentLevel -= 1;
53+
54+
// URL Strategy and Data Residency section - visually grouped
5055
EditorGUILayout.Space();
51-
EditorGUILayout.LabelField("IOS SETTINGS:", darkerCyanTextFieldStyles);
56+
EditorGUILayout.LabelField("URL Strategy And Data Residency:", EditorStyles.boldLabel);
57+
EditorGUI.indentLevel += 1;
58+
59+
// URL Strategy Domains list
60+
if (adjust.urlStrategyDomains == null)
61+
{
62+
adjust.urlStrategyDomains = new System.Collections.Generic.List<string>();
63+
}
64+
65+
EditorGUILayout.LabelField("URL Strategy Domains", EditorStyles.label);
5266
EditorGUI.indentLevel += 1;
53-
adjust.adServices = EditorGUILayout.Toggle("AdServices Info Reading", adjust.adServices);
54-
adjust.idfaReading = EditorGUILayout.Toggle("IDFA Info Reading", adjust.idfaReading);
55-
adjust.skanAttribution = EditorGUILayout.Toggle("SKAdNetwork Handling", adjust.skanAttribution);
67+
int domainCount = adjust.urlStrategyDomains.Count;
68+
int newDomainCount = EditorGUILayout.IntField("Size", domainCount);
69+
if (newDomainCount != domainCount)
70+
{
71+
while (adjust.urlStrategyDomains.Count < newDomainCount)
72+
{
73+
adjust.urlStrategyDomains.Add("");
74+
}
75+
while (adjust.urlStrategyDomains.Count > newDomainCount)
76+
{
77+
adjust.urlStrategyDomains.RemoveAt(adjust.urlStrategyDomains.Count - 1);
78+
}
79+
}
80+
81+
for (int i = 0; i < adjust.urlStrategyDomains.Count; i++)
82+
{
83+
EditorGUILayout.BeginHorizontal();
84+
adjust.urlStrategyDomains[i] = EditorGUILayout.TextField("Element " + i, adjust.urlStrategyDomains[i]);
85+
if (GUILayout.Button("Remove", GUILayout.Width(60)))
86+
{
87+
adjust.urlStrategyDomains.RemoveAt(i);
88+
break;
89+
}
90+
EditorGUILayout.EndHorizontal();
91+
}
92+
EditorGUI.indentLevel -= 1;
93+
94+
adjust.shouldUseSubdomains = EditorGUILayout.Toggle("Should Use Subdomains", adjust.shouldUseSubdomains);
95+
adjust.isDataResidency = EditorGUILayout.Toggle("Is Data Residency", adjust.isDataResidency);
96+
EditorGUI.indentLevel -= 1;
5697
EditorGUI.indentLevel -= 1;
5798
}
5899

0 commit comments

Comments
 (0)