Skip to content

Commit 68d5940

Browse files
authored
Merge pull request #132 from adjust/v4290
Version 4.29.0
2 parents aca6630 + c91bc12 commit 68d5940

File tree

120 files changed

+5568
-8000
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+5568
-8000
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
### Version 4.29.0 (15th July 2021)
2+
#### Added
3+
- [beta] Added data residency feature. You can choose this setting by calling `setUrlStrategy` method of `AdjustConfig` instance with `AdjustConfig.DataResidencyEU` (for EU data residency region), `AdjustConfig.DataResidencyTR` (for TR data residency region) or `AdjustConfig.DataResidencyUS` value (for US data residency region).
4+
- Added possibility to `trackAdRevenue` method of `Adjust` interface to allow tracking of ad revenue by passing `AdjustAdRevenue` object as parameter.
5+
- Added support for `AppLovin MAX` ad revenue tracking.
6+
- Added `setConversionValueUpdatedCallbackListener` method to `AdjustConfig` which can be used to set a callback which will get information when Adjust SDK updates conversion value for the user.
7+
- Added preinstall tracking with usage of system installer receiver on Android platform (`setPreinstallFilePath` method of the `AdjustConfig`).
8+
9+
#### Native SDKs
10+
- [[email protected]][ios_sdk_v4.29.3]
11+
- [[email protected]][android_sdk_v4.28.2]
12+
13+
---
14+
115
### Version 4.28.0 (1th April 2021)
216
#### Changed
317
- Removed native iOS legacy code.
@@ -411,6 +425,7 @@
411425
[ios_sdk_v4.23.2]: https://github.com/adjust/ios_sdk/tree/v4.23.2
412426
[ios_sdk_v4.26.1]: https://github.com/adjust/ios_sdk/tree/v4.26.1
413427
[ios_sdk_v4.28.0]: https://github.com/adjust/ios_sdk/tree/v4.28.0
428+
[ios_sdk_v4.29.3]: https://github.com/adjust/ios_sdk/tree/v4.29.3
414429

415430
[android_sdk_v4.10.4]: https://github.com/adjust/android_sdk/tree/v4.10.4
416431
[android_sdk_v4.11.0]: https://github.com/adjust/android_sdk/tree/v4.11.0
@@ -435,3 +450,4 @@
435450
[android_sdk_v4.24.1]: https://github.com/adjust/android_sdk/tree/v4.24.1
436451
[android_sdk_v4.26.2]: https://github.com/adjust/android_sdk/tree/v4.26.2
437452
[android_sdk_v4.27.0]: https://github.com/adjust/android_sdk/tree/v4.27.0
453+
[android_sdk_v4.28.2]: https://github.com/adjust/android_sdk/tree/v4.28.2

README.md

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ This is the React Native SDK of Adjust™. You can read more about Adjust™ at
2424
* [Get current authorisation status](#ata-getter)
2525
* [SKAdNetwork framework](#skadn-framework)
2626
* [Update SKAdNetwork conversion value](#skadn-update-conversion-value)
27+
* [Conversion value updated callback](#skadn-cv-updated-callback)
2728
* [Event tracking](#event-tracking)
2829
* [Revenue tracking](#revenue-tracking)
2930
* [Revenue deduplication](#revenue-deduplication)
@@ -53,13 +54,15 @@ This is the React Native SDK of Adjust™. You can read more about Adjust™ at
5354
* [Google Play Services advertising identifier](#di-gps-adid)
5455
* [Amazon advertising identifier](#di-fire-adid)
5556
* [Adjust device identifier](#di-adid)
57+
* [Set external device ID](#set-external-device-id)
5658
* [Push token](#push-token)
5759
* [Track additional device identifiers](#track-additional-ids)
5860
* [Pre-installed trackers](#pre-installed-trackers)
5961
* [Deep linking](#deeplinking)
6062
* [Standard deep linking](#deeplinking-standard)
6163
* [Deferred deep linking](#deeplinking-deferred)
6264
* [Reattribution via deep links](#deeplinking-reattribution)
65+
* [[beta] Data residency](#data-residency)
6366
* [License](#license)
6467

6568
## <a id="example-app"></a>Example app
@@ -342,6 +345,23 @@ You can use Adjust SDK wrapper method `updateConversionValue` to update SKAdNetw
342345
Adjust.updateConversionValue(6);
343346
```
344347

348+
### <a id="af-skadn-cv-updated-callback"></a>Conversion value updated callback
349+
350+
**Note**: This feature exists only in iOS platform.
351+
352+
You can register callback to get notified each time when Adjust SDK updates conversion value for the user.
353+
354+
```js
355+
var adjustConfig = new AdjustConfig(appToken, environment);
356+
357+
adjustConfig.setConversionValueUpdatedCallbackListener(function(conversionValue) {
358+
console.log("Conversion value updated callback recveived");
359+
console.log("Conversion value: " + conversionValue.conversionValue);
360+
});
361+
362+
Adjust.create(adjustConfig);
363+
```
364+
345365
### <a id="event-tracking"></a>Event tracking
346366

347367
You can use Adjust to track all kinds of events. Let's say you want to track every tap on a button. Simply create a new event token in your [dashboard]. Let's say that event token is `abc123`. You can add the following line in your button’s click handler method to track the click:
@@ -911,6 +931,30 @@ Adjust.getAdid((adid) => {
911931

912932
**Note**: Information about the **adid** is only available after an app installation has been tracked by the Adjust backend. From that moment on, the Adjust SDK has information about the device **adid** and you can access it with this method. So, **it is not possible** to access the **adid** value before the SDK has been initialized and installation of your app has been successfully tracked.
913933

934+
### <a id="set-external-device-id"></a>Set external device ID
935+
936+
> **Note** If you want to use external device IDs, please contact your Adjust representative. They will talk you through the best approach for your use case.
937+
938+
An external device identifier is a custom value that you can assign to a device or user. They can help you to recognize users across sessions and platforms. They can also help you to deduplicate installs by user so that a user isn't counted as multiple new installs.
939+
940+
You can also use an external device ID as a custom identifier for a device. This can be useful if you use these identifiers elsewhere and want to keep continuity.
941+
942+
Check out our [external device identifiers article](https://help.adjust.com/en/article/external-device-identifiers) for more information.
943+
944+
> **Note** This setting requires Adjust SDK v4.21.0 or later.
945+
946+
To set an external device ID, assign the identifier to the `externalDeviceId` property of your config instance. Do this before you initialize the Adjust SDK.
947+
948+
```js
949+
adjustConfig.setExternalDeviceId("{Your-External-Device-Id}");
950+
```
951+
952+
> **Important**: You need to make sure this ID is **unique to the user or device** depending on your use-case. Using the same ID across different users or devices could lead to duplicated data. Talk to your Adjust representative for more information.
953+
954+
If you want to use the external device ID in your business analytics, you can pass it as a session callback parameter. See the section on [session callback parameters](#session-callback-parameters) for more information.
955+
956+
You can import existing external device IDs into Adjust. This ensures that the backend matches future data to your existing device records. If you want to do this, please contact your Adjust representative.
957+
914958
### <a id="user-attribution"></a>User attribution
915959

916960
This callback is triggered as described in the [attribution callback section](#attribution-callback), providing you with information about a new attribution whenever it changes. If you want to access information about a user's current attribution status at any other time, you can make a call to the `getAttribution` method of the `Adjust` instance and pass your callback as a parameter to which the attribution value will be sent once obtained:
@@ -1060,6 +1104,18 @@ handleDeepLink(event) {
10601104
}
10611105
```
10621106

1107+
### <a id="data-residency"></a>[beta] Data residency
1108+
1109+
In order to enable data residency feature, make sure to call `setUrlStrategy` method of the `AdjustConfig` instance with one of the following constants:
1110+
1111+
```js
1112+
adjustConfig.setUrlStrategy(AdjustConfig.DataResidencyEU); // for EU data residency region
1113+
adjustConfig.setUrlStrategy(AdjustConfig.DataResidencyTR); // for Turkey data residency region
1114+
adjustConfig.setUrlStrategy(AdjustConfig.DataResidencyUS); // for US data residency region
1115+
```
1116+
1117+
**Note:** This feature is currently in beta testing phase. If you are interested in getting access to it, please contact your dedicated account manager or write an email to support@adjust.com. Please, do not turn this setting on before making sure with the support team that this feature is enabled for your app because otherwise SDK traffic will get dropped.
1118+
10631119
[dashboard]: http://adjust.com
10641120
[adjust.com]: http://adjust.com
10651121

@@ -1090,7 +1146,7 @@ handleDeepLink(event) {
10901146

10911147
The Adjust SDK is licensed under the MIT License.
10921148

1093-
Copyright (c) 2012-2018 Adjust GmbH, http://www.adjust.com
1149+
Copyright (c) 2012-2021 Adjust GmbH, http://www.adjust.com
10941150

10951151
Permission is hereby granted, free of charge, to any person obtaining a copy of
10961152
this software and associated documentation files (the "Software"), to deal in

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.28.0
1+
4.29.0

android/libs/adjust-android.jar

6.85 KB
Binary file not shown.

android/src/main/java/com/adjust/sdk/Adjust.java

Lines changed: 101 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Adjust SDK
44
//
55
// Created by Abdullah Obaied (@Obaied) on 19th October 2016.
6-
// Copyright (c) 2016-2018 Adjust GmbH. All rights reserved.
6+
// Copyright (c) 2016-2021 Adjust GmbH. All rights reserved.
77
//
88

99
package com.adjust.nativemodule;
@@ -110,6 +110,7 @@ public void create(ReadableMap mapConfig) {
110110
String defaultTracker = null;
111111
String externalDeviceId = null;
112112
String urlStrategy = null;
113+
String preinstallFilePath = null;
113114
long secretId = 0L;
114115
long info1 = 0L;
115116
long info2 = 0L;
@@ -207,6 +208,12 @@ public void create(ReadableMap mapConfig) {
207208
adjustConfig.setUrlStrategy(AdjustConfig.URL_STRATEGY_CHINA);
208209
} else if (urlStrategy.equalsIgnoreCase("india")) {
209210
adjustConfig.setUrlStrategy(AdjustConfig.URL_STRATEGY_INDIA);
211+
} else if (urlStrategy.equalsIgnoreCase("data-residency-eu")) {
212+
adjustConfig.setUrlStrategy(AdjustConfig.DATA_RESIDENCY_EU);
213+
} else if (urlStrategy.equalsIgnoreCase("data-residency-us")) {
214+
adjustConfig.setUrlStrategy(AdjustConfig.DATA_RESIDENCY_US);
215+
} else if (urlStrategy.equalsIgnoreCase("data-residency-tr")) {
216+
adjustConfig.setUrlStrategy(AdjustConfig.DATA_RESIDENCY_TR);
210217
}
211218
}
212219

@@ -216,6 +223,11 @@ public void create(ReadableMap mapConfig) {
216223
adjustConfig.setUserAgent(userAgent);
217224
}
218225

226+
if (checkKey(mapConfig, "preinstallFilePath")) {
227+
preinstallFilePath = mapConfig.getString("preinstallFilePath");
228+
adjustConfig.setPreinstallFilePath(preinstallFilePath);
229+
}
230+
219231
// App secret.
220232
if (checkKey(mapConfig, "secretId")
221233
&& checkKey(mapConfig, "info1")
@@ -429,6 +441,94 @@ public void trackAdRevenue(String source, String payload) {
429441
}
430442
}
431443

444+
@ReactMethod
445+
public void trackAdRevenueNew(ReadableMap mapAdRevenue) {
446+
if (mapAdRevenue == null) {
447+
return;
448+
}
449+
450+
double revenue = -1.0;
451+
int adImpressionsCount = -1;
452+
String source = null;
453+
String currency = null;
454+
String adRevenueNetwork = null;
455+
String adRevenueUnit = null;
456+
String adRevenuePlacement = null;
457+
Map<String, Object> callbackParameters = null;
458+
Map<String, Object> partnerParameters = null;
459+
460+
// Source.
461+
if (checkKey(mapAdRevenue, "source")) {
462+
source = mapAdRevenue.getString("source");
463+
}
464+
465+
final AdjustAdRevenue adRevenue = new AdjustAdRevenue(source);
466+
467+
// Revenue.
468+
if (checkKey(mapAdRevenue, "revenue") || checkKey(mapAdRevenue, "currency")) {
469+
try {
470+
revenue = Double.parseDouble(mapAdRevenue.getString("revenue"));
471+
} catch (NumberFormatException ignore) {}
472+
currency = mapAdRevenue.getString("currency");
473+
adRevenue.setRevenue(revenue, currency);
474+
}
475+
476+
// Ad impressions count.
477+
if (checkKey(mapAdRevenue, "adImpressionsCount")) {
478+
try {
479+
adImpressionsCount = Integer.parseInt(mapAdRevenue.getString("adImpressionsCount"));
480+
} catch (NumberFormatException ignore) {}
481+
adRevenue.setAdImpressionsCount(adImpressionsCount);
482+
}
483+
484+
// Ad revenue network.
485+
if (checkKey(mapAdRevenue, "adRevenueNetwork")) {
486+
adRevenueNetwork = mapAdRevenue.getString("adRevenueNetwork");
487+
if (null != adRevenueNetwork) {
488+
adRevenue.setAdRevenueNetwork(adRevenueNetwork);
489+
}
490+
}
491+
492+
// Ad revenue unit.
493+
if (checkKey(mapAdRevenue, "adRevenueUnit")) {
494+
adRevenueUnit = mapAdRevenue.getString("adRevenueUnit");
495+
if (null != adRevenueUnit) {
496+
adRevenue.setAdRevenueUnit(adRevenueUnit);
497+
}
498+
}
499+
500+
// Ad revenue placement.
501+
if (checkKey(mapAdRevenue, "adRevenuePlacement")) {
502+
adRevenuePlacement = mapAdRevenue.getString("adRevenuePlacement");
503+
if (null != adRevenuePlacement) {
504+
adRevenue.setAdRevenuePlacement(adRevenuePlacement);
505+
}
506+
}
507+
508+
// Callback parameters.
509+
if (checkKey(mapAdRevenue, "callbackParameters")) {
510+
callbackParameters = AdjustUtil.toMap(mapAdRevenue.getMap("callbackParameters"));
511+
if (null != callbackParameters) {
512+
for (Map.Entry<String, Object> entry : callbackParameters.entrySet()) {
513+
adRevenue.addCallbackParameter(entry.getKey(), entry.getValue().toString());
514+
}
515+
}
516+
}
517+
518+
// Partner parameters.
519+
if (checkKey(mapAdRevenue, "partnerParameters")) {
520+
partnerParameters = AdjustUtil.toMap(mapAdRevenue.getMap("partnerParameters"));
521+
if (null != partnerParameters) {
522+
for (Map.Entry<String, Object> entry : partnerParameters.entrySet()) {
523+
adRevenue.addPartnerParameter(entry.getKey(), entry.getValue().toString());
524+
}
525+
}
526+
}
527+
528+
// Track ad revenue.
529+
com.adjust.sdk.Adjust.trackAdRevenue(adRevenue);
530+
}
531+
432532
@ReactMethod
433533
public void trackPlayStoreSubscription(ReadableMap mapEvent) {
434534
if (mapEvent == null) {

android/src/main/java/com/adjust/sdk/AdjustPackage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Adjust SDK
44
//
55
// Created by Abdullah Obaied (@Obaied) on 19th October 2016.
6-
// Copyright (c) 2016-2018 Adjust GmbH. All rights reserved.
6+
// Copyright (c) 2016-2021 Adjust GmbH. All rights reserved.
77
//
88

99
package com.adjust.nativemodule;

android/src/main/java/com/adjust/sdk/AdjustUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Adjust SDK
44
//
55
// Created by Abdullah Obaied (@Obaied) on 19th October 2016.
6-
// Copyright (c) 2016-2018 Adjust GmbH. All rights reserved.
6+
// Copyright (c) 2016-2021 Adjust GmbH. All rights reserved.
77
//
88

99
package com.adjust.nativemodule;

example/App.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
Text,
1616
StatusBar,
1717
TouchableHighlight,
18+
Platform,
1819
} from 'react-native';
1920
import {
2021
Header,
@@ -102,6 +103,11 @@ const App: () => React$Node = () => {
102103
console.log("URL: " + uri.uri);
103104
});
104105

106+
adjustConfig.setConversionValueUpdatedCallbackListener(function(conversionValue) {
107+
console.log("Conversion value updated callback recveived");
108+
console.log("Conversion value: " + conversionValue.conversionValue);
109+
});
110+
105111
Adjust.addSessionCallbackParameter("scpk1", "scpv1");
106112
Adjust.addSessionCallbackParameter("scpk2", "scpv2");
107113

@@ -136,7 +142,9 @@ const App: () => React$Node = () => {
136142
}
137143
});
138144

139-
AdjustOaid.readOaid();
145+
if (Platform.OS === "android") {
146+
AdjustOaid.readOaid();
147+
}
140148
Adjust.create(adjustConfig);
141149

142150
function componentDidMount() {

example/android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ import com.android.build.OutputFile
7878
*/
7979

8080
project.ext.react = [
81-
enableHermes: false
81+
enableHermes: (findProperty('expo.jsEngine') ?: "jsc") == "hermes",
8282
]
8383

8484
apply from: '../../node_modules/react-native-unimodules/gradle.groovy'

example/android/app/src/debug/java/com/example/ReactNativeFlipper.java renamed to example/android/app/src/debug/java/com/adjust/examples/ReactNativeFlipper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
55
* directory of this source tree.
66
*/
7-
package com.example;
7+
package com.adjust.examples;
88

99
import android.content.Context;
1010
import com.facebook.flipper.android.AndroidFlipperClient;

0 commit comments

Comments
 (0)