Skip to content

Commit

Permalink
Merge pull request #11 from adtrace/update
Browse files Browse the repository at this point in the history
v2.5.1
  • Loading branch information
namini40 authored Feb 17, 2024
2 parents f6e9bd9 + 4090f71 commit 07bdfee
Show file tree
Hide file tree
Showing 22 changed files with 409 additions and 336 deletions.
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,4 @@ local.properties
gradle.properties
/android-sdk/gradle.properties
/android-sdk-plugin-oaid/gradle.properties
/android-sdk-plugin-webbridge/gradle.properties

/.idea/
/android-sdk-plugin-webbridge/gradle.properties
12 changes: 9 additions & 3 deletions CHANGE_LOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
## 2.5.0
-
## Version 2.5.1
### Added:
- Added `setReadDeviceInfoOnceEnabled(boolean)` method to `AdTraceConfig` to indicate if device info to be read only once.
- new URL strategy.

---

## Version 2.5.0
### Added:
- data residency support
- Updated Samsung Install Referrer library version to 3.0.1.
Expand All @@ -13,5 +19,5 @@
- support for Meta install referrer.
- support for Google Play Games on PC.
- Getters for certain public classes.
- `setReadDeviceInfoOnceEnabled(boolean)` method to `AdTraceConfig` to indicate if device info to be read only once.


6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,14 @@ These are the minimum required steps to integrate the AdTrace SDK in your Androi
If you are using Maven, add the following to your `build.gradle` file:

```java
implementation 'io.adtrace:android-sdk:2.5.0'
implementation 'io.adtrace:android-sdk:2.5.1'
implementation 'com.android.installreferrer:installreferrer:2.2'
```

If you would prefer to use the AdTrace SDK inside web views in your app, please include this additional dependency as well:

```java
implementation 'io.adtrace:android-sdk-plugin-webbridge:2.5.0'
implementation 'io.adtrace:android-sdk-plugin-webbridge:2.5.1'
```

**Note**: The minimum supported Android API level for the web view extension is 17 (Jelly Bean).
Expand Down Expand Up @@ -1836,7 +1836,7 @@ And a click package added to the SDK's package handler:

```
V/AdTrace: Path: /sdk_click
ClientSdk: android2.5.0
ClientSdk: android2.5.1
Parameters:
app_token adt1exadt1ex
click_time yyyy-MM-dd'T'HH:mm:ss.SSS'Z'Z
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.5.0
2.5.1
2 changes: 1 addition & 1 deletion android-sdk-imei-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dependencies {
// Add SDK via module.
compileOnly project(':android-sdk')
// Add SDK via Maven.
// implementation 'io.adtrace:android-sdk:2.5.0'
// implementation 'io.adtrace:android-sdk:2.5.1'
}

// read local properties
Expand Down
2 changes: 1 addition & 1 deletion android-sdk-plugin-oaid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ dependencies {
// Add SDK via module.
compileOnly project(':android-sdk')
// Add SDK via Maven.
// implementation 'io.adtrace:android-sdk:2.5.0'
// implementation 'io.adtrace:android-sdk:2.5.1'
implementation 'com.huawei.hms:ads-identifier:3.4.56.300'
}

Expand Down
2 changes: 1 addition & 1 deletion android-sdk-plugin-webbridge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ dependencies {
// Add SDK via module.
compileOnly project(':android-sdk')
// Add SDK via Maven.
// implementation 'io.adtrace:android-sdk:2.5.0'
// implementation 'io.adtrace:android-sdk:2.5.1'
}

// read local properties
Expand Down
2 changes: 1 addition & 1 deletion android-sdk-plugin-webbridge/src/main/assets/adtrace.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ var AdTrace = {
if (this.adtraceConfig) {
return this.adtraceConfig.getSdkPrefix();
} else {
return 'web-bridge2.5.0';
return 'web-bridge2.5.1';
}
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,16 @@ function AdTraceConfig(appToken, environment, legacy) {
this.coppaCompliantEnabled = null;
this.finalAttributionEnabled = null;
this.fbAppId = null;
this.readDeviceInfoOnceEnabled = null;
}

AdTraceConfig.EnvironmentSandbox = 'sandbox';
AdTraceConfig.EnvironmentProduction = 'production';

AdTraceConfig.UrlStrategyIndia = "url_strategy_india";
AdTraceConfig.UrlStrategyChina = "url_strategy_china";
AdTraceConfig.UrlStrategyCn = "url_strategy_cn";
AdTraceConfig.UrlStrategyCnOnly = "url_strategy_cn_only";
AdTraceConfig.DataResidencyEU = "data_residency_eu";
AdTraceConfig.DataResidencyTR = "data_residency_tr";
AdTraceConfig.DataResidencyUS = "data_residency_us";
Expand Down Expand Up @@ -267,3 +270,7 @@ AdTraceConfig.prototype.setFinalAttributionEnabled = function(isEnabled) {
AdTraceConfig.prototype.setFbAppId = function(fbAppId) {
this.fbAppId = fbAppId;
};

AdjustConfig.prototype.setReadDeviceInfoOnceEnabled = function(isEnabled) {
this.readDeviceInfoOnceEnabled = isEnabled;
};
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ public void onCreate(String adtraceConfigString) {
Object coppaCompliantEnabledField = jsonAdTraceConfig.get("coppaCompliantEnabled");
Object finalAttributionEnabledField = jsonAdTraceConfig.get("finalAttributionEnabled");
Object fbAppIdField = jsonAdTraceConfig.get("fbAppId");
Object readDeviceInfoOnceEnabledField = jsonAdTraceConfig.get("readDeviceInfoOnceEnabled");

String appToken = AdTraceBridgeUtil.fieldToString(appTokenField);
String environment = AdTraceBridgeUtil.fieldToString(environmentField);
Expand Down Expand Up @@ -418,6 +419,12 @@ public boolean launchReceivedDeeplink(Uri deeplink) {
adtraceConfig.setFbAppId(fbAppId);
}

// read device info once
Boolean readDeviceInfoOnceEnabled = AdTraceBridgeUtil.fieldToBoolean(readDeviceInfoOnceEnabledField);
if (readDeviceInfoOnceEnabled != null) {
adtraceConfig.setReadDeviceInfoOnceEnabled(readDeviceInfoOnceEnabled);
}

// Manually call onResume() because web view initialisation will happen a bit delayed.
// With this delay, it will miss lifecycle callback onResume() initial firing.
AdTrace.onCreate(adtraceConfig);
Expand Down Expand Up @@ -474,7 +481,7 @@ public void trackEvent(String adtraceEventString) {
}
}

// event parameters
// Value parameters
String[] eventParameters = AdTraceBridgeUtil.jsonArrayToArray((JSONArray)eventParametersField);
if (eventParameters != null) {
for (int i = 0; i < eventParameters.length; i += 2) {
Expand All @@ -484,7 +491,7 @@ public void trackEvent(String adtraceEventString) {
}
}

// event partner parameters
// Partner parameters
String[] partnerParameters = AdTraceBridgeUtil.jsonArrayToArray((JSONArray)partnerParametersField);
if (partnerParameters != null) {
for (int i = 0; i < partnerParameters.length; i += 2) {
Expand Down
2 changes: 1 addition & 1 deletion android-sdk-vivo-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ dependencies {
// Add SDK via module.
compileOnly project(':android-sdk')
// Add SDK via Maven.
// implementation 'io.adtrace:android-sdk:2.5.0'
// implementation 'io.adtrace:android-sdk:2.5.1'
}

// read local properties
Expand Down
2 changes: 1 addition & 1 deletion android-sdk-xiaomi-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dependencies {
// Add SDK via module.
compileOnly project(':android-sdk')
// Add SDK via Maven.
// implementation 'io.adtrace:android-sdk:2.5.0'
// implementation 'io.adtrace:android-sdk:2.5.1'

// Add xiaomi referrer lib via Maven.
implementation 'com.miui.referrer:homereferrer:1.0.0.6'
Expand Down
4 changes: 2 additions & 2 deletions android-sdk/src/main/java/io/adtrace/sdk/AdTrace.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ private AdTrace() {
*/
public static synchronized AdTraceInstance getDefaultInstance() {
@SuppressWarnings("unused")
String VERSION = "!SDK-VERSION-STRING!:io.adtrace.sdk:adtrace-android:2.5.0";
String VERSION = "!SDK-VERSION-STRING!:io.adtrace.sdk:adtrace-android:2.5.1";

if (defaultInstance == null) {
defaultInstance = new AdTraceInstance();
Expand Down Expand Up @@ -326,7 +326,7 @@ public static void getGoogleAdId(Context context, OnDeviceIdsRead onDeviceIdRead
public static String getAmazonAdId(final Context context) {
Context appContext = extractApplicationContext(context);
if (appContext != null) {
return Util.getFireAdvertisingId(appContext.getContentResolver());
return DeviceInfo.getFireAdvertisingIdBypassConditions(appContext.getContentResolver());
}

return null;
Expand Down
12 changes: 12 additions & 0 deletions android-sdk/src/main/java/io/adtrace/sdk/AdTraceConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.content.Context;


/**
* AdTrace android SDK (https://adtrace.io)
* Created by Nasser Amini (github.com/namini40) on April 2022.
Expand Down Expand Up @@ -48,13 +49,15 @@ public class AdTraceConfig {
boolean coppaCompliantEnabled;
boolean finalAttributionEnabled;
String fbAppId;
boolean readDeviceInfoOnceEnabled;

public static final String ENVIRONMENT_SANDBOX = "sandbox";
public static final String ENVIRONMENT_PRODUCTION = "production";

public static final String URL_STRATEGY_INDIA = "url_strategy_india";
public static final String URL_STRATEGY_CHINA = "url_strategy_china";
public static final String URL_STRATEGY_CN = "url_strategy_cn";
public static final String URL_STRATEGY_CN_ONLY = "url_strategy_cn_only";
public static final String DATA_RESIDENCY_EU = "data_residency_eu";
public static final String DATA_RESIDENCY_TR = "data_residency_tr";
public static final String DATA_RESIDENCY_US = "data_residency_us";
Expand Down Expand Up @@ -227,6 +230,7 @@ public void setUrlStrategy(String urlStrategy) {
if (!urlStrategy.equals(URL_STRATEGY_INDIA)
&& !urlStrategy.equals(URL_STRATEGY_CHINA)
&& !urlStrategy.equals(URL_STRATEGY_CN)
&& !urlStrategy.equals(URL_STRATEGY_CN_ONLY)
&& !urlStrategy.equals(DATA_RESIDENCY_EU)
&& !urlStrategy.equals(DATA_RESIDENCY_TR)
&& !urlStrategy.equals(DATA_RESIDENCY_US))
Expand All @@ -236,6 +240,10 @@ public void setUrlStrategy(String urlStrategy) {
this.urlStrategy = urlStrategy;
}

public void setReadDeviceInfoOnceEnabled(boolean readDeviceInfoOnceEnabled) {
this.readDeviceInfoOnceEnabled = readDeviceInfoOnceEnabled;
}

public String getBasePath() {
return basePath;
}
Expand Down Expand Up @@ -388,6 +396,10 @@ public String getFbAppId() {
return fbAppId;
}

public boolean isReadDeviceInfoOnceEnabled() {
return readDeviceInfoOnceEnabled;
}

private void setLogLevel(LogLevel logLevel, String environment) {
logger.setLogLevel(logLevel, AdTraceConfig.ENVIRONMENT_PRODUCTION.equals(environment));
}
Expand Down
2 changes: 2 additions & 0 deletions android-sdk/src/main/java/io/adtrace/sdk/AdTraceEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ public Map<String, String> getPartnerParameters() {
return partnerParameters;
}

public Map<String,String> getEventValueParameters(){return eventValueParameters;}

public String getOrderId() {
return orderId;
}
Expand Down
2 changes: 1 addition & 1 deletion android-sdk/src/main/java/io/adtrace/sdk/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public interface Constants {

String SCHEME = "https";
String AUTHORITY = "app.adtrace.io";
String CLIENT_SDK = "android2.5.0";
String CLIENT_SDK = "android2.5.1";
String LOGTAG = "AdTrace";
String REFTAG = "reftag";
String INSTALL_REFERRER = "install_referrer";
Expand Down
Loading

0 comments on commit 07bdfee

Please sign in to comment.