Skip to content

Commit

Permalink
Merge pull request #9 from adtrace/beta
Browse files Browse the repository at this point in the history
Beta
  • Loading branch information
namini40 authored Mar 30, 2023
2 parents 3757b93 + 96bd6f8 commit af2e427
Show file tree
Hide file tree
Showing 16 changed files with 82 additions and 75 deletions.
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.4.0'
implementation 'io.adtrace:android-sdk:2.4.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.4.0'
implementation 'io.adtrace:android-sdk-plugin-webbridge:2.4.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.4.0
ClientSdk: android2.4.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.4.0
2.4.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 @@ -18,7 +18,7 @@ dependencies {
// Add SDK via module.
compileOnly project(':android-sdk')
// Add SDK via Maven.
// implementation 'io.adtrace:android-sdk:2.4.0'
// implementation 'io.adtrace:android-sdk:2.4.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 @@ -18,7 +18,7 @@ dependencies {
// Add SDK via module.
compileOnly project(':android-sdk')
// Add SDK via Maven.
// implementation 'io.adtrace:android-sdk:2.4.0'
// implementation 'io.adtrace:android-sdk:2.4.1'
}

// read local properties
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 @@ -22,7 +22,7 @@ dependencies {
// Add SDK via module.
compileOnly project(':android-sdk')
// Add SDK via Maven.
// implementation 'io.adtrace:android-sdk:2.4.0'
// implementation 'io.adtrace:android-sdk:2.4.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.4.0';
return 'web-bridge2.4.1';
}
},

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

// read local properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,42 +14,46 @@
public class SamsungReferrerClient {

public static ReferrerDetails getReferrer(Context context, final ILogger logger, long maxWaitTimeInMilli) {
final InstallReferrerClient referrerClient = InstallReferrerClient.newBuilder(context).build();
final BlockingQueue<ReferrerDetails> referrerDetailsHolder = new LinkedBlockingQueue<ReferrerDetails>(1);
referrerClient.startConnection(new InstallReferrerStateListener() {
@Override
public void onInstallReferrerSetupFinished(int responseCode) {
switch (responseCode) {
case InstallReferrerClient.InstallReferrerResponse.OK:
try {
ReferrerDetails details = referrerClient.getInstallReferrer();
referrerDetailsHolder.offer(details);
} catch (Exception e) {
logger.error("SamsungReferrer getInstallReferrer: " + e.getMessage());
referrerDetailsHolder.offer(null);
} finally {
referrerClient.endConnection();
try {
final InstallReferrerClient referrerClient = InstallReferrerClient.newBuilder(context).build();
final BlockingQueue<ReferrerDetails> referrerDetailsHolder = new LinkedBlockingQueue<ReferrerDetails>(1);
referrerClient.startConnection(new InstallReferrerStateListener() {
@Override
public void onInstallReferrerSetupFinished(int responseCode) {
try {
switch (responseCode) {
case InstallReferrerClient.InstallReferrerResponse.OK:
try {
ReferrerDetails details = referrerClient.getInstallReferrer();
referrerDetailsHolder.offer(details);
} catch (Exception e) {
logger.error("SamsungReferrer getInstallReferrer: " + e.getMessage());
} finally {
referrerClient.endConnection();
}
break;
case InstallReferrerClient.InstallReferrerResponse.FEATURE_NOT_SUPPORTED:
logger.info("SamsungReferrer onInstallReferrerSetupFinished: FEATURE_NOT_SUPPORTED");
break;
case InstallReferrerClient.InstallReferrerResponse.SERVICE_UNAVAILABLE:
logger.info("SamsungReferrer onInstallReferrerSetupFinished: SERVICE_UNAVAILABLE");
break;
}
break;
case InstallReferrerClient.InstallReferrerResponse.FEATURE_NOT_SUPPORTED:
logger.info("SamsungReferrer onInstallReferrerSetupFinished: FEATURE_NOT_SUPPORTED");
break;
case InstallReferrerClient.InstallReferrerResponse.SERVICE_UNAVAILABLE:
logger.info("SamsungReferrer onInstallReferrerSetupFinished: SERVICE_UNAVAILABLE");
break;
} catch (Exception e) {
logger.error("SamsungReferrer onInstallReferrerSetupFinished: " + e.getMessage());
}
}
}

@Override
public void onInstallReferrerServiceDisconnected() {
referrerClient.endConnection();
}
});
@Override
public void onInstallReferrerServiceDisconnected() {
referrerClient.endConnection();
}
});

try {
return referrerDetailsHolder.poll(maxWaitTimeInMilli, TimeUnit.MILLISECONDS);

} catch (Exception e) {
logger.error("Exception while waiting to get referrer: ", e.getMessage());
logger.error("Exception while getting referrer: ", e.getMessage());
}

return null;
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 @@ -19,7 +19,7 @@ dependencies {
// Add SDK via module.
compileOnly project(':android-sdk')
// Add SDK via Maven.
// implementation 'io.adtrace:android-sdk:2.4.0'
// implementation 'io.adtrace:android-sdk:2.4.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 @@ -18,7 +18,7 @@ dependencies {
// Add SDK via module.
compileOnly project(':android-sdk')
// Add SDK via Maven.
// implementation 'io.adtrace:android-sdk:2.4.0'
// implementation 'io.adtrace:android-sdk:2.4.1'

// Add xiaomi referrer lib via Maven.
implementation 'com.miui.referrer:homereferrer:1.0.0.6'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,41 +15,43 @@
public class XiaomiReferrerClient {

public static GetAppsReferrerDetails getReferrer(Context context, final ILogger logger, long maxWaitTimeInMilli) {
final GetAppsReferrerClient referrerClient = new GetAppsReferrerClient.Builder(context).build();
final BlockingQueue<GetAppsReferrerDetails> referrerDetailsHolder = new LinkedBlockingQueue<GetAppsReferrerDetails>(1);
referrerClient.startConnection(new GetAppsReferrerStateListener() {
@Override
public void onGetAppsReferrerSetupFinished(int responseCode) {
switch(responseCode) {
case GetAppsReferrerResponse.OK:
try {
GetAppsReferrerDetails getAppsReferrerDetails = referrerClient.getInstallReferrer();
referrerDetailsHolder.offer(getAppsReferrerDetails);
} catch (Exception e) {
logger.error("XiaomiReferrer getInstallReferrer: " + e.getMessage());
referrerDetailsHolder.offer(null);
try {
final GetAppsReferrerClient referrerClient = new GetAppsReferrerClient.Builder(context).build();
final BlockingQueue<GetAppsReferrerDetails> referrerDetailsHolder = new LinkedBlockingQueue<GetAppsReferrerDetails>(1);
referrerClient.startConnection(new GetAppsReferrerStateListener() {
@Override
public void onGetAppsReferrerSetupFinished(int responseCode) {
try {
switch (responseCode) {
case GetAppsReferrerResponse.OK:
try {
GetAppsReferrerDetails getAppsReferrerDetails = referrerClient.getInstallReferrer();
referrerDetailsHolder.offer(getAppsReferrerDetails);
} catch (Exception e) {
logger.error("XiaomiReferrer getInstallReferrer: " + e.getMessage());
}
break;
case GetAppsReferrerResponse.FEATURE_NOT_SUPPORTED:
logger.info("XiaomiReferrer onGetAppsReferrerSetupFinished: FEATURE_NOT_SUPPORTED");
break;
case GetAppsReferrerResponse.SERVICE_UNAVAILABLE:
logger.info("XiaomiReferrer onGetAppsReferrerSetupFinished: SERVICE_UNAVAILABLE");
break;
}
break;
case GetAppsReferrerResponse.FEATURE_NOT_SUPPORTED:
logger.info("XiaomiReferrer onGetAppsReferrerSetupFinished: FEATURE_NOT_SUPPORTED");
referrerDetailsHolder.offer(null);
break;
case GetAppsReferrerResponse.SERVICE_UNAVAILABLE:
logger.info("XiaomiReferrer onGetAppsReferrerSetupFinished: SERVICE_UNAVAILABLE");
referrerDetailsHolder.offer(null);
break;
} catch (Exception e) {
logger.error("XiaomiReferrer onGetAppsReferrerSetupFinished: " + e.getMessage());
}
}
}

@Override
public void onGetAppsServiceDisconnected() {
}
});
@Override
public void onGetAppsServiceDisconnected() {
}
});

try {
return referrerDetailsHolder.poll(maxWaitTimeInMilli, TimeUnit.MILLISECONDS);

} catch (Exception e) {
logger.error("Exception while waiting to get referrer: ", e.getMessage());
logger.error("Exception while getting referrer: ", e.getMessage());
}

return null;
Expand Down
2 changes: 1 addition & 1 deletion 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.4.0";
String VERSION = "!SDK-VERSION-STRING!:io.adtrace.sdk:adtrace-android:2.4.1";

if (defaultInstance == null) {
defaultInstance = new AdTraceInstance();
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 @@ -23,7 +23,7 @@ public interface Constants {

String SCHEME = "https";
String AUTHORITY = "app.adtrace.io";
String CLIENT_SDK = "android2.4.0";
String CLIENT_SDK = "android2.4.1";
String LOGTAG = "AdTrace";
String REFTAG = "reftag";
String INSTALL_REFERRER = "install_referrer";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,7 @@ private Map<String, String> getClickParameters(String source) {
PackageBuilder.addString(parameters, "cpu_type", deviceInfo.abi);
PackageBuilder.addDateInMilliseconds(parameters, "created_at", createdAt);
PackageBuilder.addString(parameters, "deeplink", deeplink);
PackageBuilder.addString(parameters, "default_tracker", adtraceConfig.defaultTracker);
PackageBuilder.addBoolean(parameters, "device_known", adtraceConfig.deviceKnown);
PackageBuilder.addBoolean(parameters, "needs_cost", adtraceConfig.needsCost);
PackageBuilder.addString(parameters, "device_manufacturer", deviceInfo.deviceManufacturer);
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ext {
coreMinSdkVersion = 9
coreCompileSdkVersion = 33
coreTargetSdkVersion = 33
coreVersionName = '2.4.0'
coreVersionName = '2.4.1'
defaultVersionCode = 1
webbridgeMinSdkVersion = 17
samsungReferrerMinSdkVersion = 18
Expand Down
4 changes: 2 additions & 2 deletions doc/english/oaid.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ To enable the AdTrace SDK to collect and track OAID, follow these steps. To only
If you are using Maven, add the following OAID plugin dependency to your `build.gradle` file next to the existing AdTrace SDK dependency:

```groovy
implementation 'io.adtrace:android-sdk:2.4.0'
implementation 'io.adtrace:android-sdk-plugin-oaid:2.4.0'
implementation 'io.adtrace:android-sdk:2.4.1'
implementation 'io.adtrace:android-sdk-plugin-oaid:2.4.1'
```

You can also add the AdTrace OAID plugin as JAR file, which you can download from our [releases page][releases].
Expand Down

0 comments on commit af2e427

Please sign in to comment.