Skip to content

Commit b48e7c3

Browse files
authored
Merge pull request #213 from adjust/v4270
Version 4.27.0
2 parents ba71e39 + 1746874 commit b48e7c3

File tree

18 files changed

+139
-31
lines changed

18 files changed

+139
-31
lines changed

Assets/Adjust/Android/AdjustAndroid.cs

Lines changed: 6 additions & 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.26.1";
11+
private const string sdkPrefix = "unity4.27.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");
@@ -135,6 +135,11 @@ public static void Start(AdjustConfig adjustConfig)
135135
AndroidJavaObject ajoUrlStrategyIndia = new AndroidJavaClass("com.adjust.sdk.AdjustConfig").GetStatic<AndroidJavaObject>("URL_STRATEGY_INDIA");
136136
ajoAdjustConfig.Call("setUrlStrategy", ajoUrlStrategyIndia);
137137
}
138+
else if (adjustConfig.urlStrategy == AdjustConfig.AdjustDataResidencyEU)
139+
{
140+
AndroidJavaObject ajoDataResidencyEU = new AndroidJavaClass("com.adjust.sdk.AdjustConfig").GetStatic<AndroidJavaObject>("DATA_RESIDENCY_EU");
141+
ajoAdjustConfig.Call("setUrlStrategy", ajoDataResidencyEU);
142+
}
138143
}
139144

140145
// Check if user has set app secret.
2.86 KB
Binary file not shown.

Assets/Adjust/Unity/AdjustConfig.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ public class AdjustConfig
77
public const string AdjustUrlStrategyChina = "china";
88
public const string AdjustUrlStrategyIndia = "india";
99

10+
public const string AdjustDataResidencyEU = "data-residency-eu";
11+
1012
public const string AdjustAdRevenueSourceMopub = "mopub";
1113
public const string AdjustAdRevenueSourceAdmob = "admob";
1214
public const string AdjustAdRevenueSourceFbNativeAd = "facebook_native_ad";

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.26.1";
20+
private const string sdkPrefix = "unity4.27.0";
2121
private static bool appLaunched = false;
2222

2323
public static void Start(AdjustConfig adjustConfig)

Assets/Adjust/iOS/Adjust.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Adjust.h
33
// Adjust
44
//
5-
// V4.26.1
5+
// V4.27.1
66
// Created by Christian Wellenbrock (wellle) on 23rd July 2013.
77
// Copyright © 2012-2017 Adjust GmbH. All rights reserved.
88
//
@@ -67,6 +67,7 @@ extern NSString * __nonnull const ADJAdRevenueSourceTapdaq;
6767
*/
6868
extern NSString * __nonnull const ADJUrlStrategyIndia;
6969
extern NSString * __nonnull const ADJUrlStrategyChina;
70+
extern NSString * __nonnull const ADJDataResidencyEU;
7071

7172
/**
7273
* @brief The main interface to Adjust.

Assets/Adjust/iOS/AdjustSdk.a

51.6 KB
Binary file not shown.

Assets/Adjust/iOS/AdjustUnity.mm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,8 @@ void _AdjustLaunchApp(const char* appToken,
227227
[adjustConfig setUrlStrategy:ADJUrlStrategyChina];
228228
} else if ([stringUrlStrategy isEqualToString:@"india"]) {
229229
[adjustConfig setUrlStrategy:ADJUrlStrategyIndia];
230+
} else if ([stringUrlStrategy isEqualToString:@"data-residency-eu"]) {
231+
[adjustConfig setUrlStrategy:ADJDataResidencyEU];
230232
}
231233
}
232234

Assets/Adjust/iOS/AdjustiOS.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_IOS
99
public class AdjustiOS
1010
{
11-
private const string sdkPrefix = "unity4.26.1";
11+
private const string sdkPrefix = "unity4.27.0";
1212

1313
[DllImport("__Internal")]
1414
private static extern void _AdjustLaunchApp(
0 Bytes
Binary file not shown.
Binary file not shown.

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
### Version 4.27.0 (29th March 2021)
2+
#### Added
3+
- Added data residency feature. Support for EU data residency region is added. You can choose this setting by calling `setUrlStrategy` method of `AdjustConfig` instance with `AdjustConfig.AdjustDataResidencyEU` parameter.
4+
- Added preinstall tracking with usage of system installer receiver on Android platform.
5+
- Added support for MSA SDK v1.0.25 to OAID plugin.
6+
7+
#### Fixed
8+
- Fixed attribution value comparison logic which might cause same attribution value to be delivered into attribution callback on iOS platform.
9+
10+
#### Native SDKs
11+
- [[email protected]][ios_sdk_v4.27.1]
12+
- [[email protected]][android_sdk_v4.27.0]
13+
- [[email protected]][windows_sdk_v4.17.0]
14+
15+
---
16+
117
### Version 4.26.1 (12th February 2021)
218
#### Fixed
319
- Fixed ambiguous API invocation error in certain Unity IDE setups.
@@ -851,6 +867,7 @@
851867
[ios_sdk_v4.23.2]: https://github.com/adjust/ios_sdk/tree/v4.23.2
852868
[ios_sdk_v4.24.0]: https://github.com/adjust/ios_sdk/tree/v4.24.0
853869
[ios_sdk_v4.26.2]: https://github.com/adjust/ios_sdk/tree/v4.26.2
870+
[ios_sdk_v4.27.1]: https://github.com/adjust/ios_sdk/tree/v4.27.1
854871

855872
[android_sdk_v3.5.0]: https://github.com/adjust/android_sdk/tree/v3.5.0
856873
[android_sdk_v4.1.0]: https://github.com/adjust/android_sdk/tree/v4.1.0
@@ -882,6 +899,7 @@
882899
[android_sdk_v4.24.1]: https://github.com/adjust/android_sdk/tree/v4.24.1
883900
[android_sdk_v4.25.0]: https://github.com/adjust/android_sdk/tree/v4.25.0
884901
[android_sdk_v4.26.1]: https://github.com/adjust/android_sdk/tree/v4.26.1
902+
[android_sdk_v4.27.0]: https://github.com/adjust/android_sdk/tree/v4.27.0
885903

886904
[windows_sdk_v4.12.0]: https://github.com/adjust/windows_sdk/tree/v4.12.0
887905
[windows_sdk_v4.13.0]: https://github.com/adjust/windows_sdk/tree/v4.13.0

README.md

Lines changed: 72 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Read this in other languages: [English][en-readme], [中文][zh-readme], [日本
7373
* [Google Play Services advertising identifier](#ad-gps-adid)
7474
* [Amazon advertising identifier](#ad-amazon-adid)
7575
* [Adjust device identifier](#ad-adid)
76-
* [Pre-installed trackers](#ad-pre-installed-trackers)
76+
* [Preinstalled apps](#ad-preinstalled-apps)
7777
* [Offline mode](#ad-offline-mode)
7878
* [Disable tracking](#ad-disable-tracking)
7979
* [Event buffering](#ad-event-buffering)
@@ -83,6 +83,7 @@ Read this in other languages: [English][en-readme], [中文][zh-readme], [日本
8383
* [Disable third-party sharing](#ad-disable-third-party-sharing)
8484
* [Enable third-party sharing](#ad-enable-third-party-sharing)
8585
* [Measurement consent](#ad-measurement-consent)
86+
* [Data residency](#ad-data-residency)
8687

8788
### Testing and troubleshooting
8889
* [Debug information in iOS](#tt-debug-ios)
@@ -946,28 +947,76 @@ String adid = Adjust.getAdid();
946947

947948
Information about the adid is only available after our backend tracks the app install. It is not possible to access the adid value before the SDK has been initialized and the installation of your app has been successfully tracked.
948949

949-
### <a id="ad-pre-installed-trackers"></a>Pre-installed trackers
950+
### <a id="ad-preinstalled-apps"></a>Preinstalled apps
950951

951-
To use the Adjust SDK to recognize users whose devices came with your app pre-installed, follow these steps:
952+
You can use the Adjust SDK to recognize users whose devices had your app preinstalled during manufacturing. Adjust offers two solutions: one which uses the system payload, and one which uses a default tracker.
952953

953-
1. Create a new tracker in your [dashboard].
954-
2. Set the default tracker of your `AdjustConfig`:
954+
In general, we recommend using the system payload solution. However, there are certain use cases which may require the tracker. First check the available [implementation methods](https://help.adjust.com/en/article/pre-install-tracking#Implementation_methods) and your preinstall partner’s preferred method. If you are unsure which solution to implement, reach out to [email protected]
955955

956-
```cs
957-
AdjustConfig adjustConfig = new AdjustConfig(appToken, environment);
956+
#### Use the system payload
957+
958+
- The Content Provider, System Properties, or File System method is supported from SDK v4.23.0 and above.
959+
960+
- The System Installer Receiver method is supported from SDK v4.27.0 and above.
961+
962+
Enable the Adjust SDK to recognise preinstalled apps by calling `setPreinstallTrackingEnabled` with the parameter `true` after creating the config object:
963+
964+
965+
```csharp
966+
adjustConfig.setPreinstallTrackingEnabled(true);
967+
```
968+
969+
Depending upon your implmentation method, you may need to make a change to your `AndroidManifest.xml` file. Find the required code change using the table below.
970+
971+
<table>
972+
<tr>
973+
<td>
974+
<b>Method</b>
975+
</td>
976+
<td>
977+
<b>AndroidManifest.xml change</b>
978+
</td>
979+
</tr>
980+
<tr>
981+
<td>Content Provider</td>
982+
<td>Add permission:</br>
983+
984+
```
985+
<uses-permission android:name="com.adjust.preinstall.READ_PERMISSION"/>
986+
```
987+
</td>
988+
</tr>
989+
<tr>
990+
<td>System Installer Receiver</td>
991+
<td>Declare receiver:</br>
992+
993+
```
994+
<receiver android:name="com.adjust.sdk.AdjustPreinstallReferrerReceiver">
995+
<intent-filter>
996+
<action android:name="com.attribution.SYSTEM_INSTALLER_REFERRER" />
997+
</intent-filter>
998+
</receiver>
999+
```
1000+
</td>
1001+
</tr>
1002+
</table>
1003+
1004+
#### Use a default tracker
1005+
1006+
- Create a new tracker in your [dashboard].
1007+
- Open your app delegate and set the default tracker of your config:
1008+
1009+
```csharp
9581010
adjustConfig.setDefaultTracker("{TrackerToken}");
959-
Adjust.start(adjustConfig);
9601011
```
9611012

962-
Replace `{TrackerToken}` with the tracker token you created in step 2. E.g. `{abc123}`
963-
964-
Although the dashboard displays a tracker URL (including `http://app.adjust.com/`), in your source code you should only enter the six or seven-character token and not the entire URL.
1013+
- Replace `{TrackerToken}` with the tracker token you created in step one. Please note that the dashboard displays a tracker URL (including `http://app.adjust.com/`). In your source code, you should specify only the six or seven-character token and not the entire URL.
9651014

966-
3. Build and run your app. You should see a line like the following in the log output:
1015+
- Build and run your app. You should see a line like the following in your LogCat:
9671016

968-
```
969-
Default tracker: 'abc123'
970-
```
1017+
```
1018+
Default tracker: 'abc123'
1019+
```
9711020

9721021
### <a id="ad-offline-mode"></a>Offline mode
9731022

@@ -1078,6 +1127,14 @@ Adjust.trackMeasurementConsent(true);
10781127

10791128
Upon receiving this information, Adjust changes sharing the specific user's data to partners. The Adjust SDK will continue to work as expected.
10801129

1130+
### <a id="ad-data-residency"></a>Data residency
1131+
1132+
In order to enable data residency feature, make sure to make a call to `setUrlStrategy` method of the `AdjustConfig` instance with one of the following constants:
1133+
1134+
```csharp
1135+
adjustConfig.setUrlStrategy(AdjustConfig.AdjustDataResidencyEU); // for EU data residency region
1136+
```
1137+
10811138
## Testing and troubleshooting
10821139

10831140
### <a id="tt-debug-ios"></a>Debug information in iOS

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.26.1
1+
4.27.0

doc/english/migration/migrate.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Migrate your Adjust SDK for Unity3d to 4.26.1 from 3.4.4
1+
## Migrate your Adjust SDK for Unity3d to 4.27.0 from 3.4.4
22

33
### Migration procedure
44

ext/android/sdk

Submodule sdk updated 36 files

ext/ios/sdk

Submodule sdk updated 39 files

scripts/build_sdk_android.py

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,26 @@ def build(root_dir, android_submodule_dir, with_test_lib):
3535
# Paths.
3636
set_log_tag('ANDROID-TEST-LIB-BUILD')
3737
debug_green('Building Test Library started ...')
38-
test_jar_in_dir = '{0}/test-library/build/libs'.format(src_dir)
39-
test_jar_out_dir = '{0}/Assets/Adjust/Android/Test'.format(root_dir)
38+
test_library_in_dir = '{0}/test-library/build/outputs/aar'.format(src_dir)
39+
test_options_in_dir = '{0}/test-options/build/outputs/aar'.format(src_dir)
40+
test_unity_out_dir = '{0}/Assets/Adjust/Android/Test'.format(root_dir)
4041

4142
# ------------------------------------------------------------------
42-
# Building Android test library JAR in debug mode.
43-
debug_green('Building Adjust test library JAR in debug mode ...')
44-
gradle_make_test_jar_debug()
43+
# Building Android test library AAR in debug mode.
44+
debug_green('Building Adjust test library AAR in debug mode ...')
45+
gradle_make_test_library_aar_debug()
4546

4647
# ------------------------------------------------------------------
47-
# Copy Android test library JAR from to destination.
48-
debug_green('Copying generated Android test library JAR from {0} to {1} ...'.format(test_jar_in_dir, test_jar_out_dir))
49-
copy_file('{0}/test-library-debug.jar'.format(test_jar_in_dir), '{0}/adjust-test.jar'.format(test_jar_out_dir))
48+
# Copy Android test library AAR from to destination.
49+
debug_green('Copying generated Android test library AAR from {0} to {1} ...'.format(test_library_in_dir, test_unity_out_dir))
50+
copy_file('{0}/test-library-debug.aar'.format(test_library_in_dir), '{0}/adjust-test-library.aar'.format(test_unity_out_dir))
51+
52+
# ------------------------------------------------------------------
53+
# Building Android test options AAR in debug mode.
54+
debug_green('Building Adjust test options AAR in debug mode ...')
55+
gradle_make_test_options_aar_debug()
56+
57+
# ------------------------------------------------------------------
58+
# Copy Android test options AAR from to destination.
59+
debug_green('Copying generated Android test options AAR from {0} to {1} ...'.format(test_options_in_dir, test_unity_out_dir))
60+
copy_file('{0}/test-options-debug.aar'.format(test_options_in_dir), '{0}/adjust-test-options.aar'.format(test_unity_out_dir))

scripts/scripting_utils.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,18 @@ def gradle_make_test_jar_debug():
161161
def gradle_make_test_jar_release():
162162
execute_command(['./gradlew', 'clean', ':test-library:adjustTestLibraryJarRelease'])
163163

164+
def gradle_make_test_library_aar_debug():
165+
execute_command(['./gradlew', 'clean', ':test-library:assembleDebug'])
166+
167+
def gradle_make_test_library_aar_release():
168+
execute_command(['./gradlew', 'clean', ':test-library:assembleRelease'])
169+
170+
def gradle_make_test_options_aar_debug():
171+
execute_command(['./gradlew', 'clean', ':test-options:assembleDebug'])
172+
173+
def gradle_make_test_options_aar_release():
174+
execute_command(['./gradlew', 'clean', ':test-options:assembleRelease'])
175+
164176
def gradle_make_oaid_jar_release():
165177
execute_command(['./gradlew', 'clean', ':sdk-plugin-oaid:adjustOaidAndroidJar'])
166178

0 commit comments

Comments
 (0)