Skip to content

Commit

Permalink
Merge pull request #213 from adjust/v4270
Browse files Browse the repository at this point in the history
Version 4.27.0
  • Loading branch information
uerceg authored Mar 29, 2021
2 parents ba71e39 + 1746874 commit b48e7c3
Show file tree
Hide file tree
Showing 18 changed files with 139 additions and 31 deletions.
7 changes: 6 additions & 1 deletion Assets/Adjust/Android/AdjustAndroid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace com.adjust.sdk
#if UNITY_ANDROID
public class AdjustAndroid
{
private const string sdkPrefix = "unity4.26.1";
private const string sdkPrefix = "unity4.27.0";
private static bool launchDeferredDeeplink = true;
private static AndroidJavaClass ajcAdjust = new AndroidJavaClass("com.adjust.sdk.Adjust");
private static AndroidJavaObject ajoCurrentActivity = new AndroidJavaClass("com.unity3d.player.UnityPlayer").GetStatic<AndroidJavaObject>("currentActivity");
Expand Down Expand Up @@ -135,6 +135,11 @@ public static void Start(AdjustConfig adjustConfig)
AndroidJavaObject ajoUrlStrategyIndia = new AndroidJavaClass("com.adjust.sdk.AdjustConfig").GetStatic<AndroidJavaObject>("URL_STRATEGY_INDIA");
ajoAdjustConfig.Call("setUrlStrategy", ajoUrlStrategyIndia);
}
else if (adjustConfig.urlStrategy == AdjustConfig.AdjustDataResidencyEU)
{
AndroidJavaObject ajoDataResidencyEU = new AndroidJavaClass("com.adjust.sdk.AdjustConfig").GetStatic<AndroidJavaObject>("DATA_RESIDENCY_EU");
ajoAdjustConfig.Call("setUrlStrategy", ajoDataResidencyEU);
}
}

// Check if user has set app secret.
Expand Down
Binary file modified Assets/Adjust/Android/adjust-android.jar
Binary file not shown.
2 changes: 2 additions & 0 deletions Assets/Adjust/Unity/AdjustConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ public class AdjustConfig
public const string AdjustUrlStrategyChina = "china";
public const string AdjustUrlStrategyIndia = "india";

public const string AdjustDataResidencyEU = "data-residency-eu";

public const string AdjustAdRevenueSourceMopub = "mopub";
public const string AdjustAdRevenueSourceAdmob = "admob";
public const string AdjustAdRevenueSourceFbNativeAd = "facebook_native_ad";
Expand Down
2 changes: 1 addition & 1 deletion Assets/Adjust/Windows/AdjustWindows.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace com.adjust.sdk
{
public class AdjustWindows
{
private const string sdkPrefix = "unity4.26.1";
private const string sdkPrefix = "unity4.27.0";
private static bool appLaunched = false;

public static void Start(AdjustConfig adjustConfig)
Expand Down
3 changes: 2 additions & 1 deletion Assets/Adjust/iOS/Adjust.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Adjust.h
// Adjust
//
// V4.26.1
// V4.27.1
// Created by Christian Wellenbrock (wellle) on 23rd July 2013.
// Copyright © 2012-2017 Adjust GmbH. All rights reserved.
//
Expand Down Expand Up @@ -67,6 +67,7 @@ extern NSString * __nonnull const ADJAdRevenueSourceTapdaq;
*/
extern NSString * __nonnull const ADJUrlStrategyIndia;
extern NSString * __nonnull const ADJUrlStrategyChina;
extern NSString * __nonnull const ADJDataResidencyEU;

/**
* @brief The main interface to Adjust.
Expand Down
Binary file modified Assets/Adjust/iOS/AdjustSdk.a
Binary file not shown.
2 changes: 2 additions & 0 deletions Assets/Adjust/iOS/AdjustUnity.mm
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ void _AdjustLaunchApp(const char* appToken,
[adjustConfig setUrlStrategy:ADJUrlStrategyChina];
} else if ([stringUrlStrategy isEqualToString:@"india"]) {
[adjustConfig setUrlStrategy:ADJUrlStrategyIndia];
} else if ([stringUrlStrategy isEqualToString:@"data-residency-eu"]) {
[adjustConfig setUrlStrategy:ADJDataResidencyEU];
}
}

Expand Down
2 changes: 1 addition & 1 deletion Assets/Adjust/iOS/AdjustiOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace com.adjust.sdk
#if UNITY_IOS
public class AdjustiOS
{
private const string sdkPrefix = "unity4.26.1";
private const string sdkPrefix = "unity4.27.0";

[DllImport("__Internal")]
private static extern void _AdjustLaunchApp(
Expand Down
Binary file modified Assets/Adjust/iOS/Test/AdjustTestLibrary.a
Binary file not shown.
Binary file modified Assets/AdjustOaid/Android/adjust-android-oaid.jar
Binary file not shown.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
### Version 4.27.0 (29th March 2021)
#### Added
- 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.
- Added preinstall tracking with usage of system installer receiver on Android platform.
- Added support for MSA SDK v1.0.25 to OAID plugin.

#### Fixed
- Fixed attribution value comparison logic which might cause same attribution value to be delivered into attribution callback on iOS platform.

#### Native SDKs
- [[email protected]][ios_sdk_v4.27.1]
- [[email protected]][android_sdk_v4.27.0]
- [[email protected]][windows_sdk_v4.17.0]

---

### Version 4.26.1 (12th February 2021)
#### Fixed
- Fixed ambiguous API invocation error in certain Unity IDE setups.
Expand Down Expand Up @@ -851,6 +867,7 @@
[ios_sdk_v4.23.2]: https://github.com/adjust/ios_sdk/tree/v4.23.2
[ios_sdk_v4.24.0]: https://github.com/adjust/ios_sdk/tree/v4.24.0
[ios_sdk_v4.26.2]: https://github.com/adjust/ios_sdk/tree/v4.26.2
[ios_sdk_v4.27.1]: https://github.com/adjust/ios_sdk/tree/v4.27.1

[android_sdk_v3.5.0]: https://github.com/adjust/android_sdk/tree/v3.5.0
[android_sdk_v4.1.0]: https://github.com/adjust/android_sdk/tree/v4.1.0
Expand Down Expand Up @@ -882,6 +899,7 @@
[android_sdk_v4.24.1]: https://github.com/adjust/android_sdk/tree/v4.24.1
[android_sdk_v4.25.0]: https://github.com/adjust/android_sdk/tree/v4.25.0
[android_sdk_v4.26.1]: https://github.com/adjust/android_sdk/tree/v4.26.1
[android_sdk_v4.27.0]: https://github.com/adjust/android_sdk/tree/v4.27.0

[windows_sdk_v4.12.0]: https://github.com/adjust/windows_sdk/tree/v4.12.0
[windows_sdk_v4.13.0]: https://github.com/adjust/windows_sdk/tree/v4.13.0
Expand Down
87 changes: 72 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Read this in other languages: [English][en-readme], [中文][zh-readme], [日本
* [Google Play Services advertising identifier](#ad-gps-adid)
* [Amazon advertising identifier](#ad-amazon-adid)
* [Adjust device identifier](#ad-adid)
* [Pre-installed trackers](#ad-pre-installed-trackers)
* [Preinstalled apps](#ad-preinstalled-apps)
* [Offline mode](#ad-offline-mode)
* [Disable tracking](#ad-disable-tracking)
* [Event buffering](#ad-event-buffering)
Expand All @@ -83,6 +83,7 @@ Read this in other languages: [English][en-readme], [中文][zh-readme], [日本
* [Disable third-party sharing](#ad-disable-third-party-sharing)
* [Enable third-party sharing](#ad-enable-third-party-sharing)
* [Measurement consent](#ad-measurement-consent)
* [Data residency](#ad-data-residency)

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

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.

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

To use the Adjust SDK to recognize users whose devices came with your app pre-installed, follow these steps:
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.

1. Create a new tracker in your [dashboard].
2. Set the default tracker of your `AdjustConfig`:
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]

```cs
AdjustConfig adjustConfig = new AdjustConfig(appToken, environment);
#### Use the system payload

- The Content Provider, System Properties, or File System method is supported from SDK v4.23.0 and above.

- The System Installer Receiver method is supported from SDK v4.27.0 and above.

Enable the Adjust SDK to recognise preinstalled apps by calling `setPreinstallTrackingEnabled` with the parameter `true` after creating the config object:


```csharp
adjustConfig.setPreinstallTrackingEnabled(true);
```

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.

<table>
<tr>
<td>
<b>Method</b>
</td>
<td>
<b>AndroidManifest.xml change</b>
</td>
</tr>
<tr>
<td>Content Provider</td>
<td>Add permission:</br>

```
<uses-permission android:name="com.adjust.preinstall.READ_PERMISSION"/>
```
</td>
</tr>
<tr>
<td>System Installer Receiver</td>
<td>Declare receiver:</br>

```
<receiver android:name="com.adjust.sdk.AdjustPreinstallReferrerReceiver">
<intent-filter>
<action android:name="com.attribution.SYSTEM_INSTALLER_REFERRER" />
</intent-filter>
</receiver>
```
</td>
</tr>
</table>

#### Use a default tracker

- Create a new tracker in your [dashboard].
- Open your app delegate and set the default tracker of your config:

```csharp
adjustConfig.setDefaultTracker("{TrackerToken}");
Adjust.start(adjustConfig);
```

Replace `{TrackerToken}` with the tracker token you created in step 2. E.g. `{abc123}`

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.
- 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.

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

```
Default tracker: 'abc123'
```
```
Default tracker: 'abc123'
```

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

Expand Down Expand Up @@ -1078,6 +1127,14 @@ Adjust.trackMeasurementConsent(true);

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

### <a id="ad-data-residency"></a>Data residency

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:

```csharp
adjustConfig.setUrlStrategy(AdjustConfig.AdjustDataResidencyEU); // for EU data residency region
```

## Testing and troubleshooting

### <a id="tt-debug-ios"></a>Debug information in iOS
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.26.1
4.27.0
2 changes: 1 addition & 1 deletion doc/english/migration/migrate.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Migrate your Adjust SDK for Unity3d to 4.26.1 from 3.4.4
## Migrate your Adjust SDK for Unity3d to 4.27.0 from 3.4.4

### Migration procedure

Expand Down
2 changes: 1 addition & 1 deletion ext/android/sdk
Submodule sdk updated 36 files
+2 −2 Adjust/build.gradle
+33 −0 Adjust/sdk-core/src/main/java/com/adjust/sdk/ActivityHandler.java
+1 −1 Adjust/sdk-core/src/main/java/com/adjust/sdk/Adjust.java
+3 −1 Adjust/sdk-core/src/main/java/com/adjust/sdk/AdjustConfig.java
+37 −0 Adjust/sdk-core/src/main/java/com/adjust/sdk/AdjustInstance.java
+24 −0 Adjust/sdk-core/src/main/java/com/adjust/sdk/AdjustPreinstallReferrerReceiver.java
+3 −1 Adjust/sdk-core/src/main/java/com/adjust/sdk/Constants.java
+2 −0 Adjust/sdk-core/src/main/java/com/adjust/sdk/IActivityHandler.java
+112 −93 Adjust/sdk-core/src/main/java/com/adjust/sdk/PackageBuilder.java
+7 −3 Adjust/sdk-core/src/main/java/com/adjust/sdk/SdkClickHandler.java
+34 −2 Adjust/sdk-core/src/main/java/com/adjust/sdk/SharedPreferencesManager.java
+1 −1 Adjust/sdk-core/src/main/java/com/adjust/sdk/network/ActivityPackageSender.java
+24 −2 Adjust/sdk-core/src/main/java/com/adjust/sdk/network/UrlStrategy.java
+1 −1 Adjust/sdk-plugin-criteo/build.gradle
+1 −1 Adjust/sdk-plugin-imei/build.gradle
+2 −2 Adjust/sdk-plugin-oaid/build.gradle
+ Adjust/sdk-plugin-oaid/libs/oaid_sdk_1.0.23.aar
+ Adjust/sdk-plugin-oaid/libs/oaid_sdk_1.0.25.aar
+1 −1 Adjust/sdk-plugin-sociomantic/build.gradle
+1 −1 Adjust/sdk-plugin-trademob/build.gradle
+1 −1 Adjust/sdk-plugin-webbridge/build.gradle
+1 −1 Adjust/sdk-plugin-webbridge/src/main/assets/adjust.js
+1 −0 Adjust/sdk-plugin-webbridge/src/main/assets/adjust_config.js
+1 −1 Adjust/test-unit/src/androidTest/java/com/adjust/sdk/TestActivityPackage.java
+11 −0 CHANGELOG.md
+75 −4 README.md
+1 −1 VERSION
+640 −364 doc/chinese/README.md
+2 −2 doc/chinese/plugins/oaid.md
+1 −1 doc/english/migration/migrate.md
+2 −2 doc/english/plugins/oaid.md
+598 −322 doc/japanese/README.md
+1 −1 doc/japanese/migration/migrate.md
+2 −2 doc/japanese/plugins/oaid.md
+660 −421 doc/korean/README.md
+2 −2 doc/korean/plugins/oaid.md
2 changes: 1 addition & 1 deletion ext/ios/sdk
Submodule sdk updated 39 files
+2 −2 Adjust.podspec
+40 −0 Adjust.xcodeproj/project.pbxproj
+5 −3 Adjust/ADJActivityHandler.m
+15 −0 Adjust/ADJAdditions/NSNumber+ADJAdditions.h
+21 −0 Adjust/ADJAdditions/NSNumber+ADJAdditions.m
+3 −3 Adjust/ADJAttribution.m
+1 −1 Adjust/ADJPackageBuilder.m
+5 −2 Adjust/ADJRequestHandler.m
+1 −1 Adjust/ADJUrlStrategy.h
+31 −4 Adjust/ADJUrlStrategy.m
+1 −1 Adjust/ADJUtil.m
+2 −1 Adjust/Adjust.h
+1 −0 Adjust/Adjust.m
+2 −1 AdjustBridge/AdjustBridgeRegister.m
+6 −0 AdjustTests/AdjustTestApp/AdjustTestApp.xcodeproj/project.pbxproj
+4 −4 AdjustTests/AdjustTestApp/AdjustTestApp/ViewController.h
+2 −2 AdjustTests/AdjustTestApp/AdjustTestApp/ViewController.m
+1 −1 AdjustTests/AdjustUnitTests/ADJPackageFields.m
+6 −0 AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp.xcodeproj/project.pbxproj
+3 −3 AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/TestLibraryBridge.h
+2 −2 AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/TestLibraryBridge.js
+15 −1 CHANGELOG.md
+11 −4 README.md
+1 −1 VERSION
+8 −7 doc/chinese/README.md
+1 −1 doc/english/migrate.md
+1 −1 doc/english/web_views.md
+3 −2 doc/japanese/README.md
+15 −26 doc/japanese/web_views.md
+5 −4 doc/korean/README.md
+1 −1 doc/korean/web_views.md
+1 −1 doc/migrate.md
+574 −288 examples/AdjustExample-FbPixel/AdjustExample-FbPixel.xcodeproj/project.pbxproj
+6 −0 examples/AdjustExample-ObjC/AdjustExample-ObjC.xcodeproj/project.pbxproj
+6 −0 examples/AdjustExample-Swift/AdjustExample-Swift.xcodeproj/project.pbxproj
+6 −0 examples/AdjustExample-WebView/AdjustExample-WebView.xcodeproj/project.pbxproj
+6 −0 examples/AdjustExample-iMessage/AdjustExample-iMessage.xcodeproj/project.pbxproj
+6 −0 examples/AdjustExample-iWatch/AdjustExample-iWatch.xcodeproj/project.pbxproj
+6 −0 examples/AdjustExample-tvOS/AdjustExample-tvOS.xcodeproj/project.pbxproj
27 changes: 19 additions & 8 deletions scripts/build_sdk_android.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,26 @@ def build(root_dir, android_submodule_dir, with_test_lib):
# Paths.
set_log_tag('ANDROID-TEST-LIB-BUILD')
debug_green('Building Test Library started ...')
test_jar_in_dir = '{0}/test-library/build/libs'.format(src_dir)
test_jar_out_dir = '{0}/Assets/Adjust/Android/Test'.format(root_dir)
test_library_in_dir = '{0}/test-library/build/outputs/aar'.format(src_dir)
test_options_in_dir = '{0}/test-options/build/outputs/aar'.format(src_dir)
test_unity_out_dir = '{0}/Assets/Adjust/Android/Test'.format(root_dir)

# ------------------------------------------------------------------
# Building Android test library JAR in debug mode.
debug_green('Building Adjust test library JAR in debug mode ...')
gradle_make_test_jar_debug()
# Building Android test library AAR in debug mode.
debug_green('Building Adjust test library AAR in debug mode ...')
gradle_make_test_library_aar_debug()

# ------------------------------------------------------------------
# Copy Android test library JAR from to destination.
debug_green('Copying generated Android test library JAR from {0} to {1} ...'.format(test_jar_in_dir, test_jar_out_dir))
copy_file('{0}/test-library-debug.jar'.format(test_jar_in_dir), '{0}/adjust-test.jar'.format(test_jar_out_dir))
# Copy Android test library AAR from to destination.
debug_green('Copying generated Android test library AAR from {0} to {1} ...'.format(test_library_in_dir, test_unity_out_dir))
copy_file('{0}/test-library-debug.aar'.format(test_library_in_dir), '{0}/adjust-test-library.aar'.format(test_unity_out_dir))

# ------------------------------------------------------------------
# Building Android test options AAR in debug mode.
debug_green('Building Adjust test options AAR in debug mode ...')
gradle_make_test_options_aar_debug()

# ------------------------------------------------------------------
# Copy Android test options AAR from to destination.
debug_green('Copying generated Android test options AAR from {0} to {1} ...'.format(test_options_in_dir, test_unity_out_dir))
copy_file('{0}/test-options-debug.aar'.format(test_options_in_dir), '{0}/adjust-test-options.aar'.format(test_unity_out_dir))
12 changes: 12 additions & 0 deletions scripts/scripting_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,18 @@ def gradle_make_test_jar_debug():
def gradle_make_test_jar_release():
execute_command(['./gradlew', 'clean', ':test-library:adjustTestLibraryJarRelease'])

def gradle_make_test_library_aar_debug():
execute_command(['./gradlew', 'clean', ':test-library:assembleDebug'])

def gradle_make_test_library_aar_release():
execute_command(['./gradlew', 'clean', ':test-library:assembleRelease'])

def gradle_make_test_options_aar_debug():
execute_command(['./gradlew', 'clean', ':test-options:assembleDebug'])

def gradle_make_test_options_aar_release():
execute_command(['./gradlew', 'clean', ':test-options:assembleRelease'])

def gradle_make_oaid_jar_release():
execute_command(['./gradlew', 'clean', ':sdk-plugin-oaid:adjustOaidAndroidJar'])

Expand Down

0 comments on commit b48e7c3

Please sign in to comment.