Skip to content

Commit c8e7aa5

Browse files
authored
Merge pull request #217 from adjust/v4350
Version 4.35.0
2 parents 8c944ce + 83b81fd commit c8e7aa5

Some content is hidden

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

75 files changed

+4565
-2815
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.35.0 (6th October 2023)
2+
#### Added
3+
- 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.
4+
- 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.
5+
- 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.
6+
- Added support for SigV3 library. Update authorization header building logic to use `adj_signing_id`.
7+
- 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).
8+
9+
#### Native SDKs
10+
- [[email protected]][ios_sdk_v4.35.1]
11+
- [[email protected]][android_sdk_v4.35.0]
12+
13+
---
14+
115
### Version 4.33.0 (15th January 2023)
216
#### Added
317
- Added support for SKAdNetwork 4.0.
@@ -564,6 +578,7 @@
564578
[ios_sdk_v4.31.0]: https://github.com/adjust/ios_sdk/tree/v4.31.0
565579
[ios_sdk_v4.32.1]: https://github.com/adjust/ios_sdk/tree/v4.32.1
566580
[ios_sdk_v4.33.3]: https://github.com/adjust/ios_sdk/tree/v4.33.3
581+
[ios_sdk_v4.35.1]: https://github.com/adjust/ios_sdk/tree/v4.35.1
567582

568583
[android_sdk_v4.10.4]: https://github.com/adjust/android_sdk/tree/v4.10.4
569584
[android_sdk_v4.11.0]: https://github.com/adjust/android_sdk/tree/v4.11.0
@@ -596,3 +611,4 @@
596611
[android_sdk_v4.31.0]: https://github.com/adjust/android_sdk/tree/v4.31.0
597612
[android_sdk_v4.32.0]: https://github.com/adjust/android_sdk/tree/v4.32.0
598613
[android_sdk_v4.33.2]: https://github.com/adjust/android_sdk/tree/v4.33.2
614+
[android_sdk_v4.35.0]: https://github.com/adjust/android_sdk/tree/v4.35.0

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,18 +153,24 @@ The Adjust SDK by default adds two permissions to your app's `AndroidManifest.xm
153153
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
154154
```
155155

156-
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.
156+
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.
157157

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

160-
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.
160+
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:
161161

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

166166
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).
167167

168+
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:
169+
170+
```xml
171+
<uses-permission android:name="com.google.android.gms.permission.AD_ID" tools:node="remove"/>
172+
```
173+
168174
### <a id="android-gps"></a>Google Play Services
169175

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

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.33.0
1+
4.35.0

android/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ apply plugin: 'com.android.library'
22

33
def _ext = rootProject.ext
44

5-
def _compileSdkVersion = _ext.has('compileSdkVersion') ? _ext.compileSdkVersion : 26
6-
def _buildToolsVersion = _ext.has('buildToolsVersion') ? _ext.buildToolsVersion : "26.0.3"
5+
def _compileSdkVersion = _ext.has('compileSdkVersion') ? _ext.compileSdkVersion : 33
6+
def _buildToolsVersion = _ext.has('buildToolsVersion') ? _ext.buildToolsVersion : "33.0.0"
77
def _minSdkVersion = _ext.has('minSdkVersion') ? _ext.minSdkVersion : 16
8-
def _targetSdkVersion = _ext.has('targetSdkVersion') ? _ext.targetSdkVersion : 26
8+
def _targetSdkVersion = _ext.has('targetSdkVersion') ? _ext.targetSdkVersion : 33
99

1010
android {
1111
compileSdkVersion _compileSdkVersion

android/libs/adjust-android.jar

14.2 KB
Binary file not shown.

android/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.adjust.nativemodule">
33
<uses-permission android:name="android.permission.INTERNET" />
4-
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
54
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
5+
<uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
66

77
<application>
88
<receiver

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

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ public void create(ReadableMap mapConfig) {
127127
boolean needsCost = false;
128128
boolean playStoreKidsAppEnabled = false;
129129
boolean coppaCompliantEnabled = false;
130+
boolean finalAndroidAttributionEnabled = false;
130131

131132
// Suppress log level.
132133
if (checkKey(mapConfig, "logLevel")) {
@@ -304,6 +305,12 @@ && checkKey(mapConfig, "info4")) {
304305
adjustConfig.setCoppaCompliantEnabled(coppaCompliantEnabled);
305306
}
306307

308+
// Final Android attribution.
309+
if (checkKey(mapConfig, "finalAndroidAttributionEnabled")) {
310+
finalAndroidAttributionEnabled = mapConfig.getBoolean("finalAndroidAttributionEnabled");
311+
adjustConfig.setFinalAttributionEnabled(finalAndroidAttributionEnabled);
312+
}
313+
307314
// Attribution callback.
308315
if (attributionCallback) {
309316
adjustConfig.setOnAttributionChangedListener(this);
@@ -349,6 +356,8 @@ public void trackEvent(ReadableMap mapEvent) {
349356
String eventToken = null;
350357
String currency = null;
351358
String transactionId = null;
359+
String productId = null;
360+
String purchaseToken = null;
352361
String callbackId = null;
353362
Map<String, Object> callbackParameters = null;
354363
Map<String, Object> partnerParameters = null;
@@ -408,6 +417,22 @@ public void trackEvent(ReadableMap mapEvent) {
408417
}
409418
}
410419

420+
// Product ID.
421+
if (checkKey(mapEvent, "productId")) {
422+
productId = mapEvent.getString("productId");
423+
if (null != productId) {
424+
event.setProductId(productId);
425+
}
426+
}
427+
428+
// Purchase token.
429+
if (checkKey(mapEvent, "purchaseToken")) {
430+
purchaseToken = mapEvent.getString("purchaseToken");
431+
if (null != purchaseToken) {
432+
event.setPurchaseToken(purchaseToken);
433+
}
434+
}
435+
411436
// Track event.
412437
com.adjust.sdk.Adjust.trackEvent(event);
413438
}
@@ -786,6 +811,47 @@ public void trackMeasurementConsent(boolean measurementConsent) {
786811
com.adjust.sdk.Adjust.trackMeasurementConsent(measurementConsent);
787812
}
788813

814+
@ReactMethod
815+
public void verifyPlayStorePurchase(ReadableMap mapEvent, Callback callback) {
816+
if (mapEvent == null) {
817+
return;
818+
}
819+
820+
String productId = null;
821+
String purchaseToken = null;
822+
823+
// Product ID.
824+
if (checkKey(mapEvent, "productId")) {
825+
productId = mapEvent.getString("productId");
826+
}
827+
828+
// Purchase token.
829+
if (checkKey(mapEvent, "purchaseToken")) {
830+
purchaseToken = mapEvent.getString("purchaseToken");
831+
}
832+
833+
// Create purchase instance.
834+
final AdjustPurchase purchase = new AdjustPurchase(productId, purchaseToken);
835+
836+
// Verify purchase.
837+
com.adjust.sdk.Adjust.verifyPurchase(purchase, new OnPurchaseVerificationFinishedListener() {
838+
@Override
839+
public void onVerificationFinished(AdjustPurchaseVerificationResult verificationResult) {
840+
if (callback != null) {
841+
WritableMap map = Arguments.createMap();
842+
if (null == verificationResult) {
843+
callback.invoke(map);
844+
return;
845+
}
846+
map.putString("verificationStatus", null != verificationResult.getVerificationStatus() ? verificationResult.getVerificationStatus() : "");
847+
map.putString("code", String.valueOf(verificationResult.getCode()));
848+
map.putString("message", null != verificationResult.getMessage() ? verificationResult.getMessage() : "");
849+
callback.invoke(map);
850+
}
851+
}
852+
});
853+
}
854+
789855
@ReactMethod
790856
public void checkForNewAttStatus() {
791857
// do nothing
@@ -861,6 +927,10 @@ public void setTestOptions(ReadableMap mapTest) {
861927
String value = mapTest.getString("subscriptionUrl");
862928
testOptions.subscriptionUrl = value;
863929
}
930+
if (checkKey(mapTest, "purchaseVerificationUrl")) {
931+
String value = mapTest.getString("purchaseVerificationUrl");
932+
testOptions.purchaseVerificationUrl = value;
933+
}
864934
if (checkKey(mapTest, "basePath")) {
865935
String value = mapTest.getString("basePath");
866936
testOptions.basePath = value;
@@ -873,6 +943,10 @@ public void setTestOptions(ReadableMap mapTest) {
873943
String value = mapTest.getString("subscriptionPath");
874944
testOptions.subscriptionPath = value;
875945
}
946+
if (checkKey(mapTest, "purchaseVerificationPath")) {
947+
String value = mapTest.getString("purchaseVerificationPath");
948+
testOptions.purchaseVerificationPath = value;
949+
}
876950
// if (checkKey(mapTest, "useTestConnectionOptions")) {
877951
// boolean value = mapTest.getBoolean("useTestConnectionOptions");
878952
// testOptions.useTestConnectionOptions = value;

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ final class AdjustUtil {
5858
private static final String SESSION_FAILED_WILL_RETRY = "willRetry";
5959
private static final String SESSION_FAILED_JSON_RESPONSE = "jsonResponse";
6060

61+
private static final String PURCHAE_VERIFICATION_STATUS = "verificationStatus";
62+
private static final String PURCHAE_VERIFICATION_CODE = "code";
63+
private static final String PURCHAE_VERIFICATION_MESSAGE = "message";
64+
6165
public static WritableMap attributionToMap(AdjustAttribution attribution) {
6266
WritableMap map = Arguments.createMap();
6367
if (null == attribution) {

example/App.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ const App: () => React$Node = () => {
4343
// adjustConfig.setUserAgent("Custom Adjust User Agent");
4444
// adjustConfig.setUrlStrategy(AdjustConfig.UrlStrategyChina);
4545
// adjustConfig.deactivateSKAdNetworkHandling();
46-
adjustConfig.setNeedsCost(true);
46+
// adjustConfig.setNeedsCost(true);
47+
// adjustConfig.setAttConsentWaitingInterval(16);
48+
// adjustConfig.setFinalAndroidAttributionEnabled(true);
4749

4850
adjustConfig.setAttributionCallbackListener(function(attribution) {
4951
console.log("Attribution callback received");

example/ios/AdjustExample/Info.plist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5+
<key>NSUserTrackingUsageDescription</key>
6+
<string>For testing purposes to be able to show ATT dialog.</string>
57
<key>CFBundleDevelopmentRegion</key>
68
<string>en</string>
79
<key>CFBundleDisplayName</key>

0 commit comments

Comments
 (0)