Skip to content

Commit 09882f1

Browse files
authored
Merge pull request #116 from adjust/v4260
Version 4.26.0
2 parents dbedfe0 + 563601b commit 09882f1

File tree

163 files changed

+10752
-7545
lines changed

Some content is hidden

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

163 files changed

+10752
-7545
lines changed

.gitignore

100755100644
File mode changed.

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
### Version 4.26.0 (18th February 2021)
2+
#### Added
3+
- Added possibility to get cost data information in attribution callback.
4+
- Added `setNeedsCost` method to `AdjustConfig` to indicate if cost data is needed in attribution callback (by default cost data will not be part of attribution callback if not enabled with this setter method).
5+
- Added `setPreinstallTrackingEnabled` method to `AdjustConfig` to allow enabling of preinstall tracking (this feature is OFF by default).
6+
- Added support for Apple Search Ads attribution with usage of `AdServices.framework`.
7+
- Added `setAllowAdServicesInfoReading` method to `AdjustConfig` to allow option for users to prevent SDK from performing any tasks related to Apple Search Ads attribution with usage of `AdServices.framework`.
8+
- Added wrapper method `updateConversionValue` method to `Adjust` to allow updating SKAdNetwork conversion value via SDK API.
9+
- Added `getAppTrackingAuthorizationStatus` getter to `Adjust` instance to be able to get current iOS app tracking status.
10+
- Added improved measurement consent management and third party sharing mechanism.
11+
- Added public constants to be used as sources for ad revenue tracking with `trackAdRevenue` method.
12+
13+
#### Native SDKs
14+
- [[email protected]][ios_sdk_v4.26.1]
15+
- [[email protected]][android_sdk_v4.26.2]
16+
17+
---
18+
119
### Version 4.23.1 (6th November 2020)
220
#### Added
321
- Added support for autolinking.
@@ -381,6 +399,7 @@
381399
[ios_sdk_v4.22.1]: https://github.com/adjust/ios_sdk/tree/v4.22.1
382400
[ios_sdk_v4.23.0]: https://github.com/adjust/ios_sdk/tree/v4.23.0
383401
[ios_sdk_v4.23.2]: https://github.com/adjust/ios_sdk/tree/v4.23.2
402+
[ios_sdk_v4.26.1]: https://github.com/adjust/ios_sdk/tree/v4.26.1
384403

385404
[android_sdk_v4.10.4]: https://github.com/adjust/android_sdk/tree/v4.10.4
386405
[android_sdk_v4.11.0]: https://github.com/adjust/android_sdk/tree/v4.11.0
@@ -403,3 +422,4 @@
403422
[android_sdk_v4.22.0]: https://github.com/adjust/android_sdk/tree/v4.22.0
404423
[android_sdk_v4.24.0]: https://github.com/adjust/android_sdk/tree/v4.24.0
405424
[android_sdk_v4.24.1]: https://github.com/adjust/android_sdk/tree/v4.24.1
425+
[android_sdk_v4.26.2]: https://github.com/adjust/android_sdk/tree/v4.26.2

README.md

Lines changed: 80 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ This is the React Native SDK of Adjust™. You can read more about Adjust™ at
2121
* [Additional features](#additional-features)
2222
* [AppTrackingTransparency framework](#att-framework)
2323
* [App-tracking authorisation wrapper](#ata-wrapper)
24+
* [Get current authorisation status](#ata-getter)
2425
* [SKAdNetwork framework](#skadn-framework)
26+
* [Update SKAdNetwork conversion value](#skadn-update-conversion-value)
2527
* [Event tracking](#event-tracking)
2628
* [Revenue tracking](#revenue-tracking)
2729
* [Revenue deduplication](#revenue-deduplication)
@@ -40,7 +42,10 @@ This is the React Native SDK of Adjust™. You can read more about Adjust™ at
4042
* [Offline mode](#offline-mode)
4143
* [Event buffering](#event-buffering)
4244
* [GDPR right to be forgotten](#gdpr-forget-me)
43-
* [Disable third-party sharing](#disable-third-party-sharing)
45+
* [Third-party sharing](#third-party-sharing)
46+
* [Disable third-party sharing](#disable-third-party-sharing)
47+
* [Enable third-party sharing](#enable-third-party-sharing)
48+
* [Measurement consent](#measurement-consent)
4449
* [SDK signature](#sdk-signature)
4550
* [Background tracking](#background-tracking)
4651
* [Device IDs](#device-ids)
@@ -237,16 +242,15 @@ As of v4.22.0, the Adjust SDK supports install tracking on Huawei devices with H
237242

238243
### <a id="ios-frameworks"></a>iOS frameworks
239244

240-
Select your project in the Project Navigator. In the left hand side of the main view, select your target. In the tab `Build Phases`, expand the group `Link Binary with Libraries`. On the bottom of that section click on the `+` button. Select the `AdSupport.framework` and click the `Add` button. Unless you are using `tvOS`, repeat the same steps to add the `iAd.framework`, `CoreTelephony.framework`, `AppTrackingTransparency.framework` and `StoreKit.framework`. Change the `Status` of both frameworks to `Optional`. Adjust SDK uses these frameworks with following purpose:
245+
Select your project in the Project Navigator. In the left hand side of the main view, select your target. In the tab `Build Phases`, expand the group `Link Binary with Libraries`. On the bottom of that section click on the `+` button. Select below mentined frameworks and make sure to change the `Status` of frameworks to `Optional`. Adjust SDK uses these frameworks with following purpose:
241246

242-
* `iAd.framework` - in case you are running iAd campaigns
243-
* `AdSupport.framework` - for reading iOS Advertising Id (IDFA)
244-
* `CoreTelephony.framework` - for reading MCC and MNC information
245-
* `StoreKit.framework` - for communication with SKAdNetwork framework
247+
* `iAd.framework` - to support Apple Searh Ads campaigns
248+
* `AdServices.framework` - to support Apple Searh Ads campaigns
249+
* `AdSupport.framework` - to read iOS Advertising Id (IDFA) value
250+
* `CoreTelephony.framework` - to read MCC and MNC information
251+
* `StoreKit.framework` - to communicate with `SKAdNetwork` framework
246252
* `AppTrackingTransparency.framework` - to ask for user's consent to be tracked and obtain status of that consent
247253

248-
If you are not running any iAd campaigns, you can feel free to remove the `iAd.framework` dependency. If you don't use SKAdNetwork framework, feel free to remove `StoreKit.framework` dependency (unless you need it for something else).
249-
250254
## <a id="additional-features"></a>Additional features
251255

252256
You can take advantage of the following features once the Adjust SDK is integrated into your project.
@@ -304,6 +308,18 @@ Adjust.requestTrackingAuthorizationWithCompletionHandler(function(status) {
304308

305309
Before calling the method, make sure that your iOS app's `Info.plist` contains an entry for `NSUserTrackingUsageDescription` key. In absence of that key and usage of this method, app will crash.
306310

311+
### <a id="ata-getter"></a>Get current authorisation status
312+
313+
**Note**: This feature exists only in iOS platform.
314+
315+
To get the current app tracking authorization status you can call `getAppTrackingAuthorizationStatus` method of `Adjust` class that will return one of the following possibilities:
316+
317+
* `0`: The user hasn't been asked yet
318+
* `1`: The user device is restricted
319+
* `2`: The user denied access to IDFA
320+
* `3`: The user authorized access to IDFA
321+
* `-1`: The status is not available
322+
307323
### <a id="skadn-framework"></a>SKAdNetwork framework
308324

309325
**Note**: This feature exists only in iOS platform.
@@ -316,6 +332,16 @@ In case you don't want the Adjust SDK to automatically communicate with SKAdNetw
316332
adjustConfig.deactivateSKAdNetworkHandling();
317333
```
318334

335+
### <a id="skadn-update-conversion-value"></a>Update SKAdNetwork conversion value
336+
337+
**Note**: This feature exists only in iOS platform.
338+
339+
You can use Adjust SDK wrapper method `updateConversionValue` to update SKAdNetwork conversion value for your user:
340+
341+
```js
342+
Adjust.updateConversionValue(6);
343+
```
344+
319345
### <a id="event-tracking"></a>Event tracking
320346

321347
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:
@@ -596,6 +622,9 @@ adjustConfig.setAttributionCallbackListener(function(attribution) {
596622
console.log(attribution.creative);
597623
console.log(attribution.clickLabel);
598624
console.log(attribution.adid);
625+
console.log(attribution.costType);
626+
console.log(attribution.costAmount);
627+
console.log(attribution.costCurrency);
599628
});
600629

601630
Adjust.create(adjustConfig);
@@ -611,9 +640,14 @@ Within the listener function you have access to the `attribution` parameters. He
611640
- `creative` the creative grouping level of the current attribution.
612641
- `clickLabel` the click label of the current attribution.
613642
- `adid` the Adjust device identifier.
643+
- `costType` the cost type.
644+
- `costAmount` the cost amount.
645+
- `costCurrency` the cost currency.
614646

615647
Please make sure to consider our [applicable attribution data policies][attribution-data].
616648

649+
**Note**: The cost data - `costType`, `costAmount` & `costCurrency` are only available when configured in `AdjustConfig` by calling `setNeedsCost` method. If not configured or configured, but not being part of the attribution, these fields will have value `null`. This feature is available in SDK v4.26.0 and above.
650+
617651
### <a id="session-event-callbacks"></a>Session and event callbacks
618652

619653
You can register a callback to be notified of successful and failed tracked events and/or sessions.
@@ -754,19 +788,52 @@ Adjust.gdprForgetMe();
754788

755789
Upon receiving this information, Adjust will erase the user's data and the Adjust SDK will stop tracking the user. No requests from this device will be sent to Adjust in the future.
756790

757-
### <a id="disable-third-party-sharing"></a>Disable third-party sharing for specific users
791+
## <a id="third-party-sharing"></a>Third-party sharing for specific users
758792

759-
You can now notify Adjust when a user has exercised their right to stop sharing their data with partners for marketing purposes, but has allowed it to be shared for statistics purposes.
793+
You can notify Adjust when a user disables, enables, and re-enables data sharing with third-party partners.
760794

761-
Call the following method to instruct the Adjust SDK to communicate the user's choice to disable data sharing to the Adjust backend:
795+
### <a id="disable-third-party-sharing"></a>Disable third-party sharing for specific users
762796

797+
Call the following method to instruct the Adjust SDK to communicate the user's choice to disable data sharing to the Adjust backend:
763798

764-
```cs
765-
Adjust.disableThirdPartySharing();
799+
```js
800+
var adjustThirdPartySharing = new AdjustThirdPartySharing(false);
801+
Adjust.trackThirdPartySharing(adjustThirdPartySharing);
766802
```
767803

768804
Upon receiving this information, Adjust will block the sharing of that specific user's data to partners and the Adjust SDK will continue to work as usual.
769805

806+
### <a id="enable-third-party-sharing">Enable or re-enable third-party sharing for specific users</a>
807+
808+
Call the following method to instruct the Adjust SDK to communicate the user's choice to share data or change data sharing, to the Adjust backend:
809+
810+
```js
811+
var adjustThirdPartySharing = new AdjustThirdPartySharing(false);
812+
Adjust.trackThirdPartySharing(adjustThirdPartySharing);
813+
```
814+
815+
Upon receiving this information, Adjust changes sharing the specific user's data to partners. The Adjust SDK will continue to work as expected.
816+
817+
Call the following method to instruct the Adjust SDK to send the granular options to the Adjust backend:
818+
819+
```js
820+
var adjustThirdPartySharing = new AdjustThirdPartySharing(null);
821+
adjustThirdPartySharing.addGranularOption("PartnerA", "foo", "bar");
822+
Adjust.trackThirdPartySharing(adjustThirdPartySharing);
823+
```
824+
825+
### <a id="measurement-consent"></a>Consent measurement for specific users
826+
827+
You can notify Adjust when a user exercises their right to change data sharing with partners for marketing purposes, but they allow data sharing for statistical purposes.
828+
829+
Call the following method to instruct the Adjust SDK to communicate the user's choice to change data sharing, to the Adjust backend:
830+
831+
```js
832+
Adjust.trackMeasurementConsent(true);
833+
```
834+
835+
Upon receiving this information, Adjust changes sharing the specific user's data to partners. The Adjust SDK will continue to work as expected.
836+
770837
### <a id="sdk-signature"></a>SDK signature
771838

772839
An account manager must activate the Adjust SDK signature. Contact Adjust support ([email protected]) if you are interested in using this feature.

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.23.1
1+
4.26.0

android/libs/adjust-android.jar

5.65 KB
Binary file not shown.

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

Lines changed: 67 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
import android.net.Uri;
1212
import android.util.Log;
13+
import java.util.List;
1314
import java.util.Map;
1415
import java.util.HashMap;
1516
import java.util.Map.Entry;
@@ -121,6 +122,8 @@ public void create(ReadableMap mapConfig) {
121122
boolean shouldLaunchDeeplink = false;
122123
boolean eventBufferingEnabled = false;
123124
boolean readMobileEquipmentIdentity = false;
125+
boolean preinstallTrackingEnabled = false;
126+
boolean needsCost = false;
124127

125128
// Suppress log level.
126129
if (checkKey(mapConfig, "logLevel")) {
@@ -248,6 +251,18 @@ && checkKey(mapConfig, "info4")) {
248251
// adjustConfig.setReadMobileEquipmentIdentity(readMobileEquipmentIdentity);
249252
// }
250253

254+
// Preinstall tracking.
255+
if (checkKey(mapConfig, "preinstallTrackingEnabled")) {
256+
preinstallTrackingEnabled = mapConfig.getBoolean("preinstallTrackingEnabled");
257+
adjustConfig.setPreinstallTrackingEnabled(preinstallTrackingEnabled);
258+
}
259+
260+
// Cost data.
261+
if (checkKey(mapConfig, "needsCost")) {
262+
needsCost = mapConfig.getBoolean("needsCost");
263+
adjustConfig.setNeedsCost(needsCost);
264+
}
265+
251266
// Launching deferred deep link.
252267
if (checkKey(mapConfig, "shouldLaunchDeeplink")) {
253268
shouldLaunchDeeplink = mapConfig.getBoolean("shouldLaunchDeeplink");
@@ -592,6 +607,54 @@ public void requestTrackingAuthorizationWithCompletionHandler(Callback callback)
592607
callback.invoke("");
593608
}
594609

610+
@ReactMethod
611+
public void updateConversionValue(int conversionValue) {
612+
// do nothing
613+
}
614+
615+
@ReactMethod
616+
public void getAppTrackingAuthorizationStatus(Callback callback) {
617+
callback.invoke("-1");
618+
}
619+
620+
@ReactMethod
621+
public void trackThirdPartySharing(ReadableMap mapThirdPartySharing) {
622+
if (mapThirdPartySharing == null) {
623+
return;
624+
}
625+
626+
Boolean isEnabled = null;
627+
List<Object> granularOptions = null;
628+
629+
// Enabled.
630+
if (checkKey(mapThirdPartySharing, "isEnabled")) {
631+
isEnabled = mapThirdPartySharing.getBoolean("isEnabled");
632+
}
633+
634+
final AdjustThirdPartySharing thirdPartySharing = new AdjustThirdPartySharing(isEnabled);
635+
636+
// Granular options.
637+
if (checkKey(mapThirdPartySharing, "granularOptions")) {
638+
granularOptions = AdjustUtil.toList(mapThirdPartySharing.getArray("granularOptions"));
639+
if (null != granularOptions) {
640+
for (int i = 0; i < granularOptions.size(); i += 3) {
641+
thirdPartySharing.addGranularOption(
642+
granularOptions.get(i).toString(),
643+
granularOptions.get(i+1).toString(),
644+
granularOptions.get(i+2).toString());
645+
}
646+
}
647+
}
648+
649+
// Track third party sharing.
650+
com.adjust.sdk.Adjust.trackThirdPartySharing(thirdPartySharing);
651+
}
652+
653+
@ReactMethod
654+
public void trackMeasurementConsent(boolean measurementConsent) {
655+
com.adjust.sdk.Adjust.trackMeasurementConsent(measurementConsent);
656+
}
657+
595658
@ReactMethod
596659
public void setAttributionCallbackListener() {
597660
this.attributionCallback = true;
@@ -669,10 +732,10 @@ public void setTestOptions(ReadableMap mapTest) {
669732
String value = mapTest.getString("subscriptionPath");
670733
testOptions.subscriptionPath = value;
671734
}
672-
if (checkKey(mapTest, "useTestConnectionOptions")) {
673-
boolean value = mapTest.getBoolean("useTestConnectionOptions");
674-
testOptions.useTestConnectionOptions = value;
675-
}
735+
// if (checkKey(mapTest, "useTestConnectionOptions")) {
736+
// boolean value = mapTest.getBoolean("useTestConnectionOptions");
737+
// testOptions.useTestConnectionOptions = value;
738+
// }
676739
if (checkKey(mapTest, "timerIntervalInMilliseconds")) {
677740
try {
678741
Long value = Long.parseLong(mapTest.getString("timerIntervalInMilliseconds"));

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ final class AdjustUtil {
2727
private static final String ATTRIBUTION_CREATIVE = "creative";
2828
private static final String ATTRIBUTION_CLICK_LABEL = "clickLabel";
2929
private static final String ATTRIBUTION_ADID = "adid";
30+
private static final String ATTRIBUTION_COST_TYPE = "costType";
31+
private static final String ATTRIBUTION_COST_AMOUNT = "costAmount";
32+
private static final String ATTRIBUTION_COST_CURRENCY = "costCurrency";
3033

3134
private static final String EVENT_SUCCESS_MESSAGE = "message";
3235
private static final String EVENT_SUCCESS_TIMESTAMP = "timestamp";
@@ -68,6 +71,9 @@ public static WritableMap attributionToMap(AdjustAttribution attribution) {
6871
map.putString(ATTRIBUTION_CREATIVE, null != attribution.creative ? attribution.creative : "");
6972
map.putString(ATTRIBUTION_CLICK_LABEL, null != attribution.clickLabel ? attribution.clickLabel : "");
7073
map.putString(ATTRIBUTION_ADID, null != attribution.adid ? attribution.adid : "");
74+
map.putString(ATTRIBUTION_COST_TYPE, null != attribution.costType ? attribution.costType : "");
75+
map.putDouble(ATTRIBUTION_COST_AMOUNT, null != attribution.costAmount && !attribution.costAmount.isNaN() ? attribution.costAmount : 0);
76+
map.putString(ATTRIBUTION_COST_CURRENCY, null != attribution.costCurrency ? attribution.costCurrency : "");
7177
return map;
7278
}
7379

example/.eslintrc.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)