Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
### Version 4.23.0 (28th August 2020)
#### Added
- Added communication with SKAdNetwork framework by default on iOS 14.
- Added method `deactivateSKAdNetworkHandling` method to `AdjustConfig` to switch off default communication with SKAdNetwork framework in iOS 14.
- Added wrapper method `requestTrackingAuthorizationWithCompletionHandler` to `Adjust` to allow asking for user's consent to be tracked in iOS 14 and immediate propagation of user's choice to backend.
- Added handling of new iAd framework error codes introduced in iOS 14.
- Added sending of value of user's consent to be tracked with each package.
- Added `setUrlStrategy` method to `AdjustConfig` class to allow selection of URL strategy for specific market.

⚠️ **Note**: iOS 14 beta versions prior to 5 appear to have an issue when trying to use iAd framework API like described in [here](https://github.com/adjust/ios_sdk/issues/452). For testing of v4.23.0 version of SDK in iOS, please make sure you're using **iOS 14 beta 5 or later**.

#### Native SDKs
- [[email protected]][ios_sdk_v4.23.0]
- [[email protected]][android_sdk_v4.24.0]

---

### Version 4.22.0 (6th June 2020)
#### Added
- Added subscription tracking feature.
Expand Down Expand Up @@ -354,6 +371,7 @@
[ios_sdk_v4.21.0]: https://github.com/adjust/ios_sdk/tree/v4.21.0
[ios_sdk_v4.21.3]: https://github.com/adjust/ios_sdk/tree/v4.21.3
[ios_sdk_v4.22.1]: https://github.com/adjust/ios_sdk/tree/v4.22.1
[ios_sdk_v4.23.0]: https://github.com/adjust/ios_sdk/tree/v4.23.0

[android_sdk_v4.10.4]: https://github.com/adjust/android_sdk/tree/v4.10.4
[android_sdk_v4.11.0]: https://github.com/adjust/android_sdk/tree/v4.11.0
Expand All @@ -374,3 +392,4 @@
[android_sdk_v4.21.0]: https://github.com/adjust/android_sdk/tree/v4.21.0
[android_sdk_v4.21.1]: https://github.com/adjust/android_sdk/tree/v4.21.1
[android_sdk_v4.22.0]: https://github.com/adjust/android_sdk/tree/v4.22.0
[android_sdk_v4.24.0]: https://github.com/adjust/android_sdk/tree/v4.24.0
77 changes: 75 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@ This is the React Native SDK of Adjust™. You can read more about Adjust™ at
* [Install referrer](#android-referrer)
* [Google Play Referrer API](#android-referrer-gpr-api)
* [Google Play Store intent](#android-referrer-gps-intent)
* [Huawei Referrer API](#android-huawei-referrer-api)
* [iOS frameworks](#ios-frameworks)
* [Additional features](#additional-features)
* [AppTrackingTransparency framework](#att-framework)
* [App-tracking authorisation wrapper](#ata-wrapper)
* [SKAdNetwork framework](#skadn-framework)
* [Event tracking](#event-tracking)
* [Revenue tracking](#revenue-tracking)
* [Revenue deduplication](#revenue-deduplication)
Expand Down Expand Up @@ -271,20 +275,89 @@ The Google Play Store `INSTALL_REFERRER` intent should be captured with a broadc

Please bear in mind that, if you are using your own broadcast receiver which handles the `INSTALL_REFERRER` intent, you don't need to add the Adjust broadcast receiver to your manifest file. You can remove it, but inside your own receiver add the call to the Adjust broadcast receiver as described in our [Android guide][broadcast-receiver-custom].

#### <a id="android-huawei-referrer-api"></a>Huawei Referrer API

As of v4.22.0, the Adjust SDK supports install tracking on Huawei devices with Huawei App Gallery version 10.4 and higher. No additional integration steps are needed to start using the Huawei Referrer API.

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

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` and `CoreTelephony.framework`. Change the `Status` of both frameworks to `Optional`. Adjust SDK uses these frameworks with following purpose:
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:

* `iAd.framework` - in case you are running iAd campaigns
* `AdSupport.framework` - for reading iOS Advertising Id (IDFA)
* `CoreTelephony.framework` - for reading MCC and MNC information
* `StoreKit.framework` - for communication with SKAdNetwork framework
* `AppTrackingTransparency.framework` - to ask for user's consent to be tracked and obtain status of that consent

If you are not running any iAd campaigns, you can feel free to remove the `iAd.framework` dependency.
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).

## <a id="additional-features"></a>Additional features

You can take advantage of the following features once the Adjust SDK is integrated into your project.

### <a id="att-framework"></a>AppTrackingTransparency framework

**Note**: This feature exists only in iOS platform.

For each package sent, the Adjust backend receives one of the following four (4) states of consent for access to app-related data that can be used for tracking the user or the device:

- Authorized
- Denied
- Not Determined
- Restricted

After a device receives an authorization request to approve access to app-related data, which is used for user device tracking, the returned status will either be Authorized or Denied.

Before a device receives an authorization request for access to app-related data, which is used for tracking the user or device, the returned status will be Not Determined.

If authorization to use app tracking data is restricted, the returned status will be Restricted.

The SDK has a built-in mechanism to receive an updated status after a user responds to the pop-up dialog, in case you don't want to customize your displayed dialog pop-up. To conveniently and efficiently communicate the new state of consent to the backend, Adjust SDK offers a wrapper around the app tracking authorization method described in the following chapter, App-tracking authorization wrapper.

### <a id="ata-wrapper"></a>App-tracking authorisation wrapper

**Note**: This feature exists only in iOS platform.

Adjust SDK offers the possibility to use it for requesting user authorization in accessing their app-related data. Adjust SDK has a wrapper built on top of the [requestTrackingAuthorizationWithCompletionHandler:](https://developer.apple.com/documentation/apptrackingtransparency/attrackingmanager/3547037-requesttrackingauthorizationwith?language=objc) method, where you can as well define the callback method to get information about a user's choice. Also, with the use of this wrapper, as soon as a user responds to the pop-up dialog, it's then communicated back using your callback method. The SDK will also inform the backend of the user's choice. Integer value will be delivered via your callback method with the following meaning:

- 0: `ATTrackingManagerAuthorizationStatusNotDetermined`
- 1: `ATTrackingManagerAuthorizationStatusRestricted`
- 2: `ATTrackingManagerAuthorizationStatusDenied`
- 3: `ATTrackingManagerAuthorizationStatusAuthorized`

To use this wrapper, you can call it as such:

```js
Adjust.requestTrackingAuthorizationWithCompletionHandler(function(status) {
switch (status) {
case 0:
// ATTrackingManagerAuthorizationStatusNotDetermined case
break;
case 1:
// ATTrackingManagerAuthorizationStatusRestricted case
break;
case 2:
// ATTrackingManagerAuthorizationStatusDenied case
break;
case 3:
// ATTrackingManagerAuthorizationStatusAuthorized case
break;
}
});
```

### <a id="skadn-framework"></a>SKAdNetwork framework

**Note**: This feature exists only in iOS platform.

If you have implemented the Adjust iOS SDK v4.23.0 or above and your app is running on iOS 14, the communication with SKAdNetwork will be set on by default, although you can choose to turn it off. When set on, Adjust automatically registers for SKAdNetwork attribution when the SDK is initialized. If events are set up in the Adjust dashboard to receive conversion values, the Adjust backend sends the conversion value data to the SDK. The SDK then sets the conversion value. After Adjust receives the SKAdNetwork callback data, it is then displayed in the dashboard.

In case you don't want the Adjust SDK to automatically communicate with SKAdNetwork, you can disable that by calling the following method on configuration object:

```js
adjustConfig.deactivateSKAdNetworkHandling();
```

### <a id="event-tracking"></a>Event tracking

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:
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.22.0
4.23.0
Binary file modified android/libs/adjust-android.jar
Binary file not shown.
16 changes: 16 additions & 0 deletions android/src/main/java/com/adjust/sdk/Adjust.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ public void create(ReadableMap mapConfig) {
String processName = null;
String defaultTracker = null;
String externalDeviceId = null;
String urlStrategy = null;
long secretId = 0L;
long info1 = 0L;
long info2 = 0L;
Expand Down Expand Up @@ -196,6 +197,16 @@ public void create(ReadableMap mapConfig) {
adjustConfig.setExternalDeviceId(externalDeviceId);
}

// URL strategy.
if (checkKey(mapConfig, "urlStrategy")) {
urlStrategy = mapConfig.getString("urlStrategy");
if (urlStrategy.equalsIgnoreCase("china")) {
adjustConfig.setUrlStrategy(AdjustConfig.URL_STRATEGY_CHINA);
} else if (urlStrategy.equalsIgnoreCase("india")) {
adjustConfig.setUrlStrategy(AdjustConfig.URL_STRATEGY_INDIA);
}
}

// User agent.
if (checkKey(mapConfig, "userAgent")) {
userAgent = mapConfig.getString("userAgent");
Expand Down Expand Up @@ -576,6 +587,11 @@ public void convertUniversalLink(final String url, final String scheme, final Ca
callback.invoke("");
}

@ReactMethod
public void requestTrackingAuthorizationWithCompletionHandler(Callback callback) {
callback.invoke("");
}

@ReactMethod
public void setAttributionCallbackListener() {
this.attributionCallback = true;
Expand Down
24 changes: 24 additions & 0 deletions example/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ const App: () => React$Node = () => {
// adjustConfig.setDelayStart(6.0);
// adjustConfig.setEventBufferingEnabled(true);
// adjustConfig.setUserAgent("Custom Adjust User Agent");
adjustConfig.setUrlStrategy(AdjustConfig.UrlStrategyChina);
adjustConfig.deactivateSKAdNetworkHandling();

adjustConfig.setAttributionCallbackListener(function(attribution) {
console.log("Attribution callback received");
Expand Down Expand Up @@ -108,6 +110,28 @@ const App: () => React$Node = () => {
// Adjust.resetSessionCallbackParameters();
// Adjust.resetSessionPartnerParameters();

Adjust.requestTrackingAuthorizationWithCompletionHandler(function (status) {
console.log("Authorization status update");
switch (status) {
case 0:
// ATTrackingManagerAuthorizationStatusNotDetermined case
console.log("Authorization status: ATTrackingManagerAuthorizationStatusNotDetermined");
break;
case 1:
// ATTrackingManagerAuthorizationStatusRestricted case
console.log("Authorization status: ATTrackingManagerAuthorizationStatusRestricted");
break;
case 2:
// ATTrackingManagerAuthorizationStatusDenied case
console.log("Authorization status: ATTrackingManagerAuthorizationStatusDenied");
break;
case 3:
// ATTrackingManagerAuthorizationStatusAuthorized case
console.log("Authorization status: ATTrackingManagerAuthorizationStatusAuthorized");
break;
}
});

AdjustOaid.readOaid();
Adjust.create(adjustConfig);

Expand Down
2 changes: 1 addition & 1 deletion example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "4.22.0"
versionName "4.23.0"
}
splits {
abi {
Expand Down
29 changes: 27 additions & 2 deletions example/ios/Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
2DCD954D1E0B4F2C00145EB5 /* ExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* ExampleTests.m */; };
4839C605884D648B39FDABCA /* libPods-Example-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E087459BCF5409F7E05C62AF /* libPods-Example-tvOS.a */; };
9D2606D524F8831600E6A596 /* AppTrackingTransparency.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9D2606D424F8831600E6A596 /* AppTrackingTransparency.framework */; };
9D2606D924F8832300E6A596 /* StoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9D2606D824F8832300E6A596 /* StoreKit.framework */; };
9D2606DB24F8832900E6A596 /* AdSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9D2606DA24F8832900E6A596 /* AdSupport.framework */; };
9D2606DD24F8832D00E6A596 /* iAd.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9D2606DC24F8832D00E6A596 /* iAd.framework */; };
9D2606DF24F8833300E6A596 /* CoreTelephony.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9D2606DE24F8833300E6A596 /* CoreTelephony.framework */; };
BCB9158A9F5778C9BEE6E144 /* libPods-Example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 59AFA88E5DB9499067C92687 /* libPods-Example.a */; };
F3CD60700218F6B493962DC1 /* libPods-Example-ExampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 621EEB5BA88EA61B55791395 /* libPods-Example-ExampleTests.a */; };
/* End PBXBuildFile section */
Expand Down Expand Up @@ -60,6 +65,12 @@
621EEB5BA88EA61B55791395 /* libPods-Example-ExampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Example-ExampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
7CC442113DDDE77A0E4B4D86 /* Pods-Example-tvOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example-tvOS.release.xcconfig"; path = "Target Support Files/Pods-Example-tvOS/Pods-Example-tvOS.release.xcconfig"; sourceTree = "<group>"; };
845150E1D833B4F50A639E53 /* libPods-Example-tvOSTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Example-tvOSTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
9D2606D424F8831600E6A596 /* AppTrackingTransparency.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppTrackingTransparency.framework; path = System/Library/Frameworks/AppTrackingTransparency.framework; sourceTree = SDKROOT; };
9D2606D624F8831A00E6A596 /* StoreKitTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = StoreKitTest.framework; path = Developer/Library/Frameworks/StoreKitTest.framework; sourceTree = SDKROOT; };
9D2606D824F8832300E6A596 /* StoreKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = StoreKit.framework; path = System/Library/Frameworks/StoreKit.framework; sourceTree = SDKROOT; };
9D2606DA24F8832900E6A596 /* AdSupport.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AdSupport.framework; path = System/Library/Frameworks/AdSupport.framework; sourceTree = SDKROOT; };
9D2606DC24F8832D00E6A596 /* iAd.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = iAd.framework; path = System/Library/Frameworks/iAd.framework; sourceTree = SDKROOT; };
9D2606DE24F8833300E6A596 /* CoreTelephony.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreTelephony.framework; path = System/Library/Frameworks/CoreTelephony.framework; sourceTree = SDKROOT; };
A973B9CBB5673BAA3EAD0A64 /* Pods-Example-tvOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example-tvOS.debug.xcconfig"; path = "Target Support Files/Pods-Example-tvOS/Pods-Example-tvOS.debug.xcconfig"; sourceTree = "<group>"; };
B1CF934BC273C8EE588D6E39 /* Pods-Example-ExampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example-ExampleTests.release.xcconfig"; path = "Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests.release.xcconfig"; sourceTree = "<group>"; };
CEADF439DD607D632E350619 /* Pods-Example-ExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example-ExampleTests.debug.xcconfig"; path = "Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests.debug.xcconfig"; sourceTree = "<group>"; };
Expand All @@ -82,7 +93,12 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
9D2606D924F8832300E6A596 /* StoreKit.framework in Frameworks */,
9D2606DD24F8832D00E6A596 /* iAd.framework in Frameworks */,
9D2606DB24F8832900E6A596 /* AdSupport.framework in Frameworks */,
BCB9158A9F5778C9BEE6E144 /* libPods-Example.a in Frameworks */,
9D2606DF24F8833300E6A596 /* CoreTelephony.framework in Frameworks */,
9D2606D524F8831600E6A596 /* AppTrackingTransparency.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -139,6 +155,12 @@
2D16E6871FA4F8E400B85C8A /* Frameworks */ = {
isa = PBXGroup;
children = (
9D2606DE24F8833300E6A596 /* CoreTelephony.framework */,
9D2606DC24F8832D00E6A596 /* iAd.framework */,
9D2606DA24F8832900E6A596 /* AdSupport.framework */,
9D2606D824F8832300E6A596 /* StoreKit.framework */,
9D2606D624F8831A00E6A596 /* StoreKitTest.framework */,
9D2606D424F8831600E6A596 /* AppTrackingTransparency.framework */,
ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
ED2971642150620600B7C4FE /* JavaScriptCore.framework */,
59AFA88E5DB9499067C92687 /* libPods-Example.a */,
Expand Down Expand Up @@ -291,6 +313,7 @@
TestTargetID = 13B07F861A680F5B00A75B9A;
};
13B07F861A680F5B00A75B9A = {
DevelopmentTeam = QGUGW9AUMK;
LastSwiftMigration = 1120;
};
2D02E47A1E0B4A5D006451C7 = {
Expand Down Expand Up @@ -629,14 +652,15 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = QGUGW9AUMK;
ENABLE_BITCODE = NO;
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
"FB_SONARKIT_ENABLED=1",
);
INFOPLIST_FILE = Example/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 4.22.0;
MARKETING_VERSION = 4.23.0;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand All @@ -657,9 +681,10 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = QGUGW9AUMK;
INFOPLIST_FILE = Example/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 4.22.0;
MARKETING_VERSION = 4.23.0;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down
Loading