Skip to content

Commit

Permalink
Merge pull request #146 from adjust/v4291
Browse files Browse the repository at this point in the history
Version 4.29.1
  • Loading branch information
uerceg authored Sep 23, 2021
2 parents 5834fed + fc95ebb commit 02ef5e2
Show file tree
Hide file tree
Showing 26 changed files with 120 additions and 30 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
### Version 4.29.1 (23rd September 2021)
#### Added
- Added support for `Admost` ad revenue source.
- Added ability to enable native Adjust OAID plugin.

#### Native SDKs
- [iOS@v4.29.6][ios_sdk_v4.29.6]
- [Android@v4.28.5][android_sdk_v4.28.5]

---

### Version 4.29.0 (13th August 2021)
#### Added
- 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).
Expand Down Expand Up @@ -551,6 +562,7 @@
[ios_sdk_v4.26.1]: https://github.com/adjust/ios_sdk/tree/v4.26.1
[ios_sdk_v4.28.0]: https://github.com/adjust/ios_sdk/tree/v4.28.0
[ios_sdk_v4.29.4]: https://github.com/adjust/ios_sdk/tree/v4.29.4
[ios_sdk_v4.29.6]: https://github.com/adjust/ios_sdk/tree/v4.29.6

[android_sdk_v3.5.0]: https://github.com/adjust/android_sdk/tree/v3.5.0
[android_sdk_v4.1.0]: https://github.com/adjust/android_sdk/tree/v4.1.0
Expand Down Expand Up @@ -578,3 +590,4 @@
[android_sdk_v4.26.2]: https://github.com/adjust/android_sdk/tree/v4.26.2
[android_sdk_v4.27.0]: https://github.com/adjust/android_sdk/tree/v4.27.0
[android_sdk_v4.28.4]: https://github.com/adjust/android_sdk/tree/v4.28.4
[android_sdk_v4.28.5]: https://github.com/adjust/android_sdk/tree/v4.28.5
33 changes: 32 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ N.B. At the moment, Cordova SDK supports Android platform version `4.0.0 and hig
* [Deferred deep linking scenario](#deeplinking-deferred)
* [Reattribution via deep links](#deeplinking-reattribution)
* [Data residency](#data-residency)
* [OAID plugin](#oaid-plugin)
* [License](#license)


Expand Down Expand Up @@ -165,6 +166,18 @@ The Adjust SDK adds three permissions to your Android manifest file: `INTERNET`,

`INTERNET` permission is the permission that our SDK might need at any point in time. `ACCESS_WIFI_STATE` is the permission which the Adjust SDK needs in case your app is not targetting the Google Play Store and doesn't use Google Play Services. If you are targetting 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. `ACCESS_NETWORK_STATE` is needed for reading MMC and MNC parameters.

#### <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 `plugin.xml` to enable the permission.

```xml
<config-file target="AndroidManifest.xml" parent="/manifest">
<uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
</config>
```

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

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

Since the August 1, 2014, apps in the Google Play Store must use the [Google Advertising ID][google-ad-id] to uniquely identify each device. To allow the Adjust SDK to use the Google Advertising ID, you must integrate [Google Play Services][google-play-services].
Expand All @@ -184,7 +197,7 @@ To check whether the analytics part of the Google Play Services library has been
If you are using Proguard, add these lines to your Proguard file:

```
-keep public class com.adjust.sdk.** { *; }
-keep class com.adjust.sdk.** { *; }
-keep class com.google.android.gms.common.ConnectionResult {
int SUCCESS;
}
Expand All @@ -198,6 +211,12 @@ If you are using Proguard, add these lines to your Proguard file:
-keep public class com.android.installreferrer.** { *; }
```

If you are **not publishing your app in the Google Play Store**, use the following `com.adjust.sdk` package rules:

```
-keep public class com.adjust.sdk.** { *; }
```

### <a id="android-referrer"></a>Install referrer

In order to correctly attribute an install of your Android app to its source, Adjust needs information about the **install referrer**. This can be obtained by using the **Google Play Referrer API** or by catching the **Google Play Store intent** with a broadcast receiver.
Expand Down Expand Up @@ -900,6 +919,10 @@ Adjust.getIdfa(function(idfa) {


### <a id="di-gps-adid"></a>Google Play Services advertising identifier

The Google Play Services Advertising Identifier (Google advertising ID) is a unique identifier for a device. Users can opt out of sharing their Google advertising ID by toggling the "Opt out of Ads Personalization" setting on their device. When a user has enabled this setting, the Adjust SDK returns a string of zeros when trying to read the Google advertising ID.

> **Important**: If you are targeting Android 12 and above (API level 31), you need to add the [`com.google.android.gms.AD_ID` permission](#gps-adid-permission) to your app. If you do not add this permission, you will not be able to read the Google advertising ID even if the user has not opted out of sharing their ID.
If you need to obtain the Google Advertising ID, you can call the `getGoogleAdId` method of the `Adjust` instance. You need to pass a callback to that method in order to obtain the value:

Expand Down Expand Up @@ -1196,6 +1219,14 @@ adjustConfig.setUrlStrategy(AdjustConfig.DataResidencyTR); // for Turkey data re
adjustConfig.setUrlStrategy(AdjustConfig.DataResidencyUS); // for US data residency region
```

### <a id="oaid-plugin"></a>OAID plugin

You can enable **native** Adjust OAID plugin directly from Adjust Cordova SDK. In order to do that, first make sure to read [native OAID plugin docs](https://github.com/adjust/android_sdk/blob/master/doc/english/plugins/oaid.md). Since Adjust Cordova SDK is already adding the native Adjust SDK under the hood, only dependency you need to add to your app from OAID plugin docs is the OAID plugin dependency. After that has been done, you have an option to enable usage of native Adjust OAID plugin by calling `setOaidReadingEnabled` method of `AdjustConfig`:

```js
adjustConfig.setOaidReadingEnabled(true);
```

[dashboard]: http://adjust.com
[adjust.com]: http://adjust.com

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.29.0
4.29.1
2 changes: 1 addition & 1 deletion doc/migrate.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Migrate your Adjust SDK for Cordova to 4.29.0 from 3.4.1
## Migrate your Adjust SDK for Cordova to 4.29.1 from 3.4.1

### Migration procedure

Expand Down
8 changes: 4 additions & 4 deletions example-cordova/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion example-cordova/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@
"dependencies": {
"xmldom": "github:xmldom/xmldom#0.7.0"
}
}
}
2 changes: 1 addition & 1 deletion example-cordova/www/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var app = {
// adjustConfig.setDeviceKnown(true);
// adjustConfig.setUserAgent("Custom Adjust User Agent");
// adjustConfig.setNeedsCost(true);
adjustConfig.setUrlStrategy(AdjustConfig.DataResidencyUS);
// adjustConfig.setOaidReadingEnabled(true);

adjustConfig.setAttributionCallbackListener(function(attribution) {
console.log("[AdjustExample]: Attribution callback received.");
Expand Down
13 changes: 9 additions & 4 deletions ionic-native/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export class AdjustConfig {
private processName: string = null; // Android only
private preinstallTrackingEnabled: boolean = null; // Android only
private preinstallFilePath: string = null; // Android only
private oaidReadingEnabled: boolean = null; // Android only
private allowiAdInfoReading: boolean = null; // iOS only
private allowIdfaReading: boolean = null; // iOS only
private allowAdServicesInfoReading: boolean = null; // iOS only
Expand Down Expand Up @@ -142,6 +143,10 @@ export class AdjustConfig {
this.preinstallFilePath = preinstallFilePath;
}

setOaidReadingEnabled(enableOaidReading: boolean) {
this.oaidReadingEnabled = enableOaidReading;
}

setAllowiAdInfoReading(allowiAdInfoReading: boolean) {
this.allowiAdInfoReading = allowiAdInfoReading;
}
Expand Down Expand Up @@ -462,7 +467,7 @@ export enum AdjustAdRevenueSource {
*
* @usage
* ```typescript
* import { Adjust, AdjustConfig, AdjustEnvironment } from '@ionic-native/adjust';
* import { Adjust, AdjustConfig, AdjustEnvironment } from '@ionic-native/adjust/ngx';
*
* constructor(private adjust: Adjust) { }
*
Expand Down Expand Up @@ -546,9 +551,9 @@ export class Adjust extends IonicNativePlugin {
trackAdRevenue(source: AdjustAdRevenueSource, payload: string): void

/**
* This method tracks ad revenue data
* @param {AdjustAdRevenue} adRevenue Adjust ad revenue object
*/
* This method tracks ad revenue data
* @param {AdjustAdRevenue} adRevenue Adjust ad revenue object
*/
trackAdRevenue(adRevenue: AdjustAdRevenue): void

// And typescript hides this, so the client will be able call only methods above
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "4.29.0",
"version": "4.29.1",
"name": "com.adjust.sdk",
"cordova_name": "Adjust SDK Cordova Plugin",
"description": "Cordova plugin for the Adjust SDK",
Expand Down
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="com.adjust.sdk"
version="4.29.0">
version="4.29.1">

<name>Adjust</name>
<description>Adjust plugin for Cordova</description>
Expand Down
25 changes: 25 additions & 0 deletions src/android/AdjustCordova.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.adjust.sdk;

import java.lang.reflect.*;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
Expand Down Expand Up @@ -233,6 +234,7 @@ private void executeCreate(final JSONArray args) throws JSONException {
boolean shouldLaunchDeeplink = true;
boolean needsCost = false;
boolean preinstallTrackingEnabled = false;
boolean oaidReadingEnabled = false;

if (parameters.containsKey(KEY_APP_TOKEN)) {
appToken = parameters.get(KEY_APP_TOKEN).toString();
Expand Down Expand Up @@ -300,6 +302,9 @@ private void executeCreate(final JSONArray args) throws JSONException {
if (parameters.containsKey(KEY_PREINSTALL_TRACKING_ENABLED)) {
preinstallTrackingEnabled = parameters.get(KEY_PREINSTALL_TRACKING_ENABLED).toString() == "true" ? true : false;
}
if (parameters.containsKey(KEY_OAID_READING_ENABLED)) {
oaidReadingEnabled = parameters.get(KEY_OAID_READING_ENABLED).toString() == "true" ? true : false;
}

if (isFieldValid(logLevel) && logLevel.equals("SUPPRESS")) {
isLogLevelSuppress = true;
Expand Down Expand Up @@ -448,6 +453,26 @@ private void executeCreate(final JSONArray args) throws JSONException {
adjustConfig.setOnDeeplinkResponseListener(this);
}

// PLUGIN
// Check if OAID reading is enabled to potentially ping OAID plugin if added natively.
if (oaidReadingEnabled == true) {
Logger logger = (Logger)AdjustFactory.getLogger();
try {
Class clazz = Class.forName("com.adjust.sdk.oaid.AdjustOaid");
if (clazz != null) {
Method method = clazz.getMethod("readOaid", (Class<?>[]) null);
if (method != null) {
method.invoke(null, (Object[])null);
logger.info(String.format("[AdjustCordova]: Adjust OAID plugin successfully found in the app"));
logger.info(String.format("[AdjustCordova]: OAID reading enabled"));
}
}
} catch (Exception e) {
logger.error(String.format("[AdjustCordova]: OAID reading failed"));
e.printStackTrace();
}
}

// Start SDK.
Adjust.onCreate(adjustConfig);
// Needed because Cordova doesn't launch 'resume' event on app start.
Expand Down
1 change: 1 addition & 0 deletions src/android/AdjustCordovaUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class AdjustCordovaUtils {
public static final String KEY_SHOULD_LAUNCH_DEEPLINK = "shouldLaunchDeeplink";
public static final String KEY_NEEDS_COST = "needsCost";
public static final String KEY_PREINSTALL_TRACKING_ENABLED = "preinstallTrackingEnabled";
public static final String KEY_OAID_READING_ENABLED = "oaidReadingEnabled";
public static final String KEY_IS_ENABLED = "isEnabled";
public static final String KEY_GRANULAR_OPTIONS = "granularOptions";
public static final String KEY_USER_AGENT = "userAgent";
Expand Down
Binary file modified src/android/adjust-android.jar
Binary file not shown.
Binary file modified src/ios/AdjustSdk.framework/AdjustSdk
Binary file not shown.
3 changes: 2 additions & 1 deletion src/ios/AdjustSdk.framework/Headers/Adjust.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Adjust.h
// Adjust SDK
//
// V4.29.4
// V4.29.6
// Created by Christian Wellenbrock (@wellle) on 23rd July 2013.
// Copyright (c) 2012-2021 Adjust GmbH. All rights reserved.
//
Expand Down Expand Up @@ -48,6 +48,7 @@ extern NSString * __nonnull const ADJAdRevenueSourceAppLovinMAX;
extern NSString * __nonnull const ADJAdRevenueSourceMopub;
extern NSString * __nonnull const ADJAdRevenueSourceAdMob;
extern NSString * __nonnull const ADJAdRevenueSourceIronSource;
extern NSString * __nonnull const ADJAdRevenueSourceAdMost;

/**
* Constants for country app's URL strategies.
Expand Down
8 changes: 4 additions & 4 deletions test/app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions test/app/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "com.adjust.examples",
"version": "4.29.0",
"version": "4.29.1",
"displayName": "AdjustTestApp",
"cordova": {
"platforms": [
"android",
"ios"
"ios",
"android"
],
"plugins": {
"cordova-plugin-whitelist": {},
Expand Down Expand Up @@ -37,4 +37,4 @@
"cordova-android": "^9.1.0",
"cordova-ios": "^6.2.0"
}
}
}
8 changes: 8 additions & 0 deletions test/app/www/js/command_executor.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,14 @@ AdjustCommandExecutor.prototype.config = function(params) {
adjustConfig.setAllowIdfaReading(allowIdfaReading);
}

if ('allowSkAdNetworkHandling' in params) {
var allowSkAdNetworkHandlingS = getFirstParameterValue(params, 'allowSkAdNetworkHandling');
var allowSkAdNetworkHandling = allowSkAdNetworkHandlingS == 'true';
if (allowSkAdNetworkHandling == false) {
adjustConfig.deactivateSKAdNetworkHandling();
}
}

if ('attributionCallbackSendAll' in params) {
var _this = this;
adjustConfig.setAttributionCallbackListener(function(attribution) {
Expand Down
2 changes: 1 addition & 1 deletion test/app/www/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var app = {
var baseUrl = "";
var gdprUrl = "";
var subscriptionUrl = "";
var ipAddress = "192.168.86.50";
var ipAddress = "192.168.86.65";
if (device.platform === "Android") {
baseUrl = "https://" + ipAddress + ":8443";
gdprUrl = "https://" + ipAddress + ":8443";
Expand Down
2 changes: 1 addition & 1 deletion test/plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "4.29.0",
"version": "4.29.1",
"name": "com.adjust.test",
"cordova_name": "Adjust Cordova Test Plugin",
"description": "Cordova Plugin For Adjust SDK Testing",
Expand Down
2 changes: 1 addition & 1 deletion test/plugin/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="com.adjust.test"
version="4.29.0">
version="4.29.1">

<name>Adjust Test</name>
<description>Adjust Plugin For Cordova SDK Testing</description>
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion www/adjust.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ var Adjust = {
},

getSdkPrefix: function () {
return 'cordova4.29.0';
return 'cordova4.29.1';
},

addSessionCallbackParameter: function(key, value) {
Expand Down
Loading

0 comments on commit 02ef5e2

Please sign in to comment.