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
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
### Version 4.35.0 (6th October 2023)
#### Added
- Added ability to read App Set ID on Android platform in case you opt in by adding the `com.google.android.gms:play-services-appset` dependency to your Android app.
- Added ability to delay SDK start on iOS platform in order to wait for an answer to the ATT dialog. You can set the number of seconds to wait (capped internally to 120) by calling the `setAttConsentWaitingInterval` method of the `AdjustConfig` instance.
- Added support for purchase verification. In case you are using this feature, you can now use it by calling `verifyAppStorePurchase` (for iOS) and `verifyPlayStorePurchase` (for Android) methods of the `Adjust` instance.
- Added support for SigV3 library. Update authorization header building logic to use `adj_signing_id`.
- Added `setAndroidFinalAttributionEnabled` method to `AdjustConfig` to indicate if only final Android attribution is needed in attribution callback (by default attribution callback return intermediate attribution as well before final attribution if not enabled with this setter method).

#### Native SDKs
- [[email protected]][ios_sdk_v4.35.1]
- [[email protected]][android_sdk_v4.35.0]

---

### Version 4.33.0 (15th January 2023)
#### Added
- Added support for SKAdNetwork 4.0.
Expand Down Expand Up @@ -564,6 +578,7 @@
[ios_sdk_v4.31.0]: https://github.com/adjust/ios_sdk/tree/v4.31.0
[ios_sdk_v4.32.1]: https://github.com/adjust/ios_sdk/tree/v4.32.1
[ios_sdk_v4.33.3]: https://github.com/adjust/ios_sdk/tree/v4.33.3
[ios_sdk_v4.35.1]: https://github.com/adjust/ios_sdk/tree/v4.35.1

[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 Down Expand Up @@ -596,3 +611,4 @@
[android_sdk_v4.31.0]: https://github.com/adjust/android_sdk/tree/v4.31.0
[android_sdk_v4.32.0]: https://github.com/adjust/android_sdk/tree/v4.32.0
[android_sdk_v4.33.2]: https://github.com/adjust/android_sdk/tree/v4.33.2
[android_sdk_v4.35.0]: https://github.com/adjust/android_sdk/tree/v4.35.0
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,18 +153,24 @@ The Adjust SDK by default adds two permissions to your app's `AndroidManifest.xm
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
```

The `INTERNET` permission might be needed by our SDK at any point in time. The `ACCESS_WIFI_STATE` permission is needed by the Adjust SDK if your app is not targeting the Google Play Store and doesn't use Google Play Services. If you are targeting the Google Play Store and you are using Google Play Services, the Adjust SDK doesn't need this permission and, if you don't need it anywhere else in your app, you can remove it.
The `INTERNET` permission might be needed by our SDK at any point in time. The `ACCESS_NETWORK_STATE` permission is needed for reading type of network device is connected to.

#### <a id="gps-adid-permission"></a>Add permission to gather Google advertising ID

If you are targeting Android 12 and above (API level 31), you need to add the `com.google.android.gms.AD_ID` permission to read the device's advertising ID. Add the following line to your `AndroidManifest.xml` to enable the permission.
If you are targeting Android 12 and above (API level 31), you need to add the `com.google.android.gms.AD_ID` permission to read the device's advertising ID. This will be done automatically by the Adjust SDK for you:

```xml
<uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
```

For more information, see [Google's `AdvertisingIdClient.Info` documentation](https://developers.google.com/android/reference/com/google/android/gms/ads/identifier/AdvertisingIdClient.Info#public-string-getid).

In case you don't want this permission to be part of your app, you can remove it by adding following line to your `AndroidManifest.xml` file:

```xml
<uses-permission android:name="com.google.android.gms.permission.AD_ID" tools:node="remove"/>
```

### <a id="android-gps"></a>Google Play Services

Since August 1, 2014, apps in the Google Play Store must use the [Google Advertising ID][google-ad-id] to uniquely identify devices. To allow the Adjust SDK to use the Google Advertising ID, you must integrate [Google Play Services][google-play-services].
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.33.0
4.35.0
6 changes: 3 additions & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ apply plugin: 'com.android.library'

def _ext = rootProject.ext

def _compileSdkVersion = _ext.has('compileSdkVersion') ? _ext.compileSdkVersion : 26
def _buildToolsVersion = _ext.has('buildToolsVersion') ? _ext.buildToolsVersion : "26.0.3"
def _compileSdkVersion = _ext.has('compileSdkVersion') ? _ext.compileSdkVersion : 33
def _buildToolsVersion = _ext.has('buildToolsVersion') ? _ext.buildToolsVersion : "33.0.0"
def _minSdkVersion = _ext.has('minSdkVersion') ? _ext.minSdkVersion : 16
def _targetSdkVersion = _ext.has('targetSdkVersion') ? _ext.targetSdkVersion : 26
def _targetSdkVersion = _ext.has('targetSdkVersion') ? _ext.targetSdkVersion : 33

android {
compileSdkVersion _compileSdkVersion
Expand Down
Binary file modified android/libs/adjust-android.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.adjust.nativemodule">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="com.google.android.gms.permission.AD_ID"/>

<application>
<receiver
Expand Down
74 changes: 74 additions & 0 deletions android/src/main/java/com/adjust/sdk/Adjust.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ public void create(ReadableMap mapConfig) {
boolean needsCost = false;
boolean playStoreKidsAppEnabled = false;
boolean coppaCompliantEnabled = false;
boolean finalAndroidAttributionEnabled = false;

// Suppress log level.
if (checkKey(mapConfig, "logLevel")) {
Expand Down Expand Up @@ -304,6 +305,12 @@ && checkKey(mapConfig, "info4")) {
adjustConfig.setCoppaCompliantEnabled(coppaCompliantEnabled);
}

// Final Android attribution.
if (checkKey(mapConfig, "finalAndroidAttributionEnabled")) {
finalAndroidAttributionEnabled = mapConfig.getBoolean("finalAndroidAttributionEnabled");
adjustConfig.setFinalAttributionEnabled(finalAndroidAttributionEnabled);
}

// Attribution callback.
if (attributionCallback) {
adjustConfig.setOnAttributionChangedListener(this);
Expand Down Expand Up @@ -349,6 +356,8 @@ public void trackEvent(ReadableMap mapEvent) {
String eventToken = null;
String currency = null;
String transactionId = null;
String productId = null;
String purchaseToken = null;
String callbackId = null;
Map<String, Object> callbackParameters = null;
Map<String, Object> partnerParameters = null;
Expand Down Expand Up @@ -408,6 +417,22 @@ public void trackEvent(ReadableMap mapEvent) {
}
}

// Product ID.
if (checkKey(mapEvent, "productId")) {
productId = mapEvent.getString("productId");
if (null != productId) {
event.setProductId(productId);
}
}

// Purchase token.
if (checkKey(mapEvent, "purchaseToken")) {
purchaseToken = mapEvent.getString("purchaseToken");
if (null != purchaseToken) {
event.setPurchaseToken(purchaseToken);
}
}

// Track event.
com.adjust.sdk.Adjust.trackEvent(event);
}
Expand Down Expand Up @@ -786,6 +811,47 @@ public void trackMeasurementConsent(boolean measurementConsent) {
com.adjust.sdk.Adjust.trackMeasurementConsent(measurementConsent);
}

@ReactMethod
public void verifyPlayStorePurchase(ReadableMap mapEvent, Callback callback) {
if (mapEvent == null) {
return;
}

String productId = null;
String purchaseToken = null;

// Product ID.
if (checkKey(mapEvent, "productId")) {
productId = mapEvent.getString("productId");
}

// Purchase token.
if (checkKey(mapEvent, "purchaseToken")) {
purchaseToken = mapEvent.getString("purchaseToken");
}

// Create purchase instance.
final AdjustPurchase purchase = new AdjustPurchase(productId, purchaseToken);

// Verify purchase.
com.adjust.sdk.Adjust.verifyPurchase(purchase, new OnPurchaseVerificationFinishedListener() {
@Override
public void onVerificationFinished(AdjustPurchaseVerificationResult verificationResult) {
if (callback != null) {
WritableMap map = Arguments.createMap();
if (null == verificationResult) {
callback.invoke(map);
return;
}
map.putString("verificationStatus", null != verificationResult.getVerificationStatus() ? verificationResult.getVerificationStatus() : "");
map.putString("code", String.valueOf(verificationResult.getCode()));
map.putString("message", null != verificationResult.getMessage() ? verificationResult.getMessage() : "");
callback.invoke(map);
}
}
});
}

@ReactMethod
public void checkForNewAttStatus() {
// do nothing
Expand Down Expand Up @@ -861,6 +927,10 @@ public void setTestOptions(ReadableMap mapTest) {
String value = mapTest.getString("subscriptionUrl");
testOptions.subscriptionUrl = value;
}
if (checkKey(mapTest, "purchaseVerificationUrl")) {
String value = mapTest.getString("purchaseVerificationUrl");
testOptions.purchaseVerificationUrl = value;
}
if (checkKey(mapTest, "basePath")) {
String value = mapTest.getString("basePath");
testOptions.basePath = value;
Expand All @@ -873,6 +943,10 @@ public void setTestOptions(ReadableMap mapTest) {
String value = mapTest.getString("subscriptionPath");
testOptions.subscriptionPath = value;
}
if (checkKey(mapTest, "purchaseVerificationPath")) {
String value = mapTest.getString("purchaseVerificationPath");
testOptions.purchaseVerificationPath = value;
}
// if (checkKey(mapTest, "useTestConnectionOptions")) {
// boolean value = mapTest.getBoolean("useTestConnectionOptions");
// testOptions.useTestConnectionOptions = value;
Expand Down
4 changes: 4 additions & 0 deletions android/src/main/java/com/adjust/sdk/AdjustUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ final class AdjustUtil {
private static final String SESSION_FAILED_WILL_RETRY = "willRetry";
private static final String SESSION_FAILED_JSON_RESPONSE = "jsonResponse";

private static final String PURCHAE_VERIFICATION_STATUS = "verificationStatus";
private static final String PURCHAE_VERIFICATION_CODE = "code";
private static final String PURCHAE_VERIFICATION_MESSAGE = "message";

public static WritableMap attributionToMap(AdjustAttribution attribution) {
WritableMap map = Arguments.createMap();
if (null == attribution) {
Expand Down
4 changes: 3 additions & 1 deletion example/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ const App: () => React$Node = () => {
// adjustConfig.setUserAgent("Custom Adjust User Agent");
// adjustConfig.setUrlStrategy(AdjustConfig.UrlStrategyChina);
// adjustConfig.deactivateSKAdNetworkHandling();
adjustConfig.setNeedsCost(true);
// adjustConfig.setNeedsCost(true);
// adjustConfig.setAttConsentWaitingInterval(16);
// adjustConfig.setFinalAndroidAttributionEnabled(true);

adjustConfig.setAttributionCallbackListener(function(attribution) {
console.log("Attribution callback received");
Expand Down
2 changes: 2 additions & 0 deletions example/ios/AdjustExample/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSUserTrackingUsageDescription</key>
<string>For testing purposes to be able to show ATT dialog.</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
Expand Down
5 changes: 5 additions & 0 deletions example/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,10 @@ target 'AdjustExample' do
post_install do |installer|
react_native_post_install(installer)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)', '_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION']
end
end
end
end
22 changes: 11 additions & 11 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PODS:
- Adjust (4.33.3):
- Adjust/Core (= 4.33.3)
- Adjust/Core (4.33.3)
- Adjust (4.35.1):
- Adjust/Core (= 4.35.1)
- Adjust/Core (4.35.1)
- boost (1.76.0)
- CocoaAsyncSocket (7.6.5)
- DoubleConversion (1.1.6)
Expand Down Expand Up @@ -287,8 +287,8 @@ PODS:
- React-jsinspector (0.69.4)
- React-logger (0.69.4):
- glog
- react-native-adjust (4.33.0):
- Adjust (= 4.33.3)
- react-native-adjust (4.35.0):
- Adjust (= 4.35.1)
- React-Core
- React-perflogger (0.69.4)
- React-RCTActionSheet (0.69.4):
Expand Down Expand Up @@ -356,7 +356,7 @@ PODS:
- React-jsi (= 0.69.4)
- React-logger (= 0.69.4)
- React-perflogger (= 0.69.4)
- SocketRocket (0.6.0)
- SocketRocket (0.6.1)
- Yoga (1.14.0)
- YogaKit (1.18.1):
- Yoga (~> 1.14)
Expand Down Expand Up @@ -508,7 +508,7 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/yoga"

SPEC CHECKSUMS:
Adjust: 41d0d5c031409aebe7fb1f5703ff0d3306133439
Adjust: 63c56c81b420738f927fbc19e5cf4f34fd39d572
boost: a7c83b31436843459a1961bfd74b96033dc77234
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54
Expand Down Expand Up @@ -541,7 +541,7 @@ SPEC CHECKSUMS:
React-jsiexecutor: a27badbbdbc0ff781813370736a2d1c7261181d4
React-jsinspector: 8a3d3f5dcd23a91e8c80b1bf0e96902cd1dca999
React-logger: 1088859f145b8f6dd0d3ed051a647ef0e3e80fad
react-native-adjust: 5f5966b51459bf8cb074bf8ebc1307a2bfb7b1da
react-native-adjust: 9812c952950dd8dc8eff4f5b42fe1a7d659683c9
React-perflogger: cb386fd44c97ec7f8199c04c12b22066b0f2e1e0
React-RCTActionSheet: f803a85e46cf5b4066c2ac5e122447f918e9c6e5
React-RCTAnimation: 19c80fa950ccce7f4db76a2a7f2cf79baae07fc7
Expand All @@ -554,10 +554,10 @@ SPEC CHECKSUMS:
React-RCTVibration: 9adb4a3cbb598d1bbd46a05256f445e4b8c70603
React-runtimeexecutor: 61ee22a8cdf8b6bb2a7fb7b4ba2cc763e5285196
ReactCommon: 8f67bd7e0a6afade0f20718f859dc8c2275f2e83
SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
Yoga: ff994563b2fd98c982ca58e8cd9db2cdaf4dda74
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

PODFILE CHECKSUM: 9e9743fe52beedb026f101e19db1b71cabea428f
PODFILE CHECKSUM: 3e8fef6186a492afd4504d65ef4a2ad6fbbb9ab4

COCOAPODS: 1.11.3
COCOAPODS: 1.12.1
Loading