Skip to content

Commit

Permalink
Merge pull request #51 from adjust/v4180
Browse files Browse the repository at this point in the history
Version 4.18.0
  • Loading branch information
uerceg authored Nov 26, 2019
2 parents ea16a71 + 4f08d68 commit ff626bf
Show file tree
Hide file tree
Showing 80 changed files with 1,077 additions and 337 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ DerivedData
*.dSYM
*.a
*.pfx
ext/iOS/AdjustSdk.framework
ext/iOS/src/AdjustExtension/include/Adjust/AdjustSdk.framework
ext/Android/adjust-android.jar
ext/ios/AdjustSdk.framework
ext/ios/src/AdjustExtension/include/Adjust/AdjustSdk.framework
ext/android/adjust-android.jar

### Android Studio ###
local.properties
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
### Version 4.18.0 (26th November 2019)
#### Added
- Added 64-bit support to ANE for Android platform.
- Added `trackAdRevenue` method to `Adjust` interface to allow tracking of ad revenue. With this release added support for `MoPub` ad revenue tracking.

#### Native SDKs
- [iOS@v4.18.3][ios_sdk_v4.18.3]
- [Android@v4.18.4][android_sdk_v4.18.4]

---

### Version 4.17.2 (21st February 2019)
#### Changed
- Increased **ios_version_min** to **8.0** from **6.0** (for reference: https://github.com/adjust/adobe_air_sdk/issues/46).
Expand Down Expand Up @@ -407,6 +418,7 @@
[ios_sdk_v4.13.0]: https://github.com/adjust/ios_sdk/tree/v4.13.0
[ios_sdk_v4.14.1]: https://github.com/adjust/ios_sdk/tree/v4.14.1
[ios_sdk_v4.17.1]: https://github.com/adjust/ios_sdk/tree/v4.17.1
[ios_sdk_v4.18.3]: https://github.com/adjust/ios_sdk/tree/v4.18.3

[android_sdk_v2.1.3]: https://github.com/adjust/android_sdk/tree/v2.1.3
[android_sdk_v2.1.4]: https://github.com/adjust/android_sdk/tree/v2.1.4
Expand All @@ -426,3 +438,4 @@
[android_sdk_v4.13.0]: https://github.com/adjust/android_sdk/tree/v4.13.0
[android_sdk_v4.14.0]: https://github.com/adjust/android_sdk/tree/v4.14.0
[android_sdk_v4.17.0]: https://github.com/adjust/android_sdk/tree/v4.17.0
[android_sdk_v4.18.4]: https://github.com/adjust/android_sdk/tree/v4.18.4
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.17.2
4.18.0
4 changes: 4 additions & 0 deletions default/src/com/adjust/sdk/Adjust.as
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ package com.adjust.sdk {
trace("Adjust: gdprForgetMe called");
}

public static function trackAdRevenue(source:String, payload:String):void {
trace("Adjust: trackAdRevenue called");
}

public static function setTestOptions(testOptions:AdjustTestOptions):void {
trace("Adjust: setTestOptions called");
}
Expand Down
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 Adobe AIR to 4.17.2 from 3.4.3
## Migrate your adjust SDK for Adobe AIR to 4.18.0 from 3.4.3

### SDK initialization

Expand Down
9 changes: 2 additions & 7 deletions example/Main-app.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://ns.adobe.com/air/application/28.0">
<application xmlns="http://ns.adobe.com/air/application/32.0">
<id>com.adjust.examples</id>
<versionNumber>4.17.2</versionNumber>
<versionNumber>4.18.0</versionNumber>
<filename>Adjust AIR SDK Demo</filename>

<initialWindow>
Expand Down Expand Up @@ -56,11 +56,6 @@
</intent-filter>
</activity>
<!-- Comment this if you don't want to use Google Play Services -->
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version"/>
<receiver
android:name="com.adjust.sdk.AdjustReferrerReceiver"
android:permission="android.permission.INSTALL_PACKAGES"
Expand Down
Binary file removed example/lib/Adjust-4.17.0.ane
Binary file not shown.
Binary file added example/lib/Adjust-4.18.0.ane
Binary file not shown.
2 changes: 1 addition & 1 deletion ext/android/sdk
Submodule sdk updated 127 files
2 changes: 1 addition & 1 deletion ext/android/src/AdjustExtension/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.android.tools.build:gradle:3.5.1'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
8 changes: 4 additions & 4 deletions ext/android/src/AdjustExtension/extension/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ android {
}

task makeDebugJar(type: Copy) {
dependsOn 'build'
dependsOn 'assembleDebug'

from('build/intermediates/intermediate-jars/debug/')
from('build/intermediates/packaged-classes/debug/')
into('build/libs/debug/')
include('classes.jar')
rename('classes.jar', "adjust-android.jar")
}

task makeReleaseJar(type: Copy) {
dependsOn 'build'
dependsOn 'assembleRelease'

from('build/intermediates/intermediate-jars/release/')
from('build/intermediates/packaged-classes/release/')
into('build/libs/release/')
include('classes.jar')
rename('classes.jar', "adjust-android.jar")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import com.adjust.sdk.scheduler.TimerCycle;
import com.adjust.sdk.scheduler.TimerOnce;

import org.json.JSONObject;

import java.io.InputStream;
import java.util.ArrayList;
import java.util.LinkedHashMap;
Expand Down Expand Up @@ -606,6 +608,17 @@ public void run() {
});
}

@Override
public void trackAdRevenue(final String source, final JSONObject adRevenueJson) {
executor.submit(new Runnable() {
@Override
public void run() {
trackAdRevenueI(source, adRevenueJson);
}
});
}


@Override
public void gotOptOutResponse() {
executor.submit(new Runnable() {
Expand Down Expand Up @@ -1866,6 +1879,20 @@ private void gdprForgetMeI() {
}
}

private void trackAdRevenueI(String source, JSONObject adRevenueJson) {
if (!checkActivityStateI(activityState)) { return; }
if (!isEnabledI()) { return; }
if (activityState.isGdprForgotten) { return; }

long now = System.currentTimeMillis();

PackageBuilder packageBuilder = new PackageBuilder(adjustConfig, deviceInfo, activityState, sessionParameters, now);

ActivityPackage adRevenuePackage = packageBuilder.buildAdRevenuePackage(source, adRevenueJson);
packageHandler.addPackage(adRevenuePackage);
packageHandler.sendFirstPackage();
}

private void gotOptOutResponseI() {
activityState.isGdprForgotten = true;
writeActivityStateI();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.adjust.sdk;

public enum ActivityKind {
UNKNOWN, SESSION, EVENT, CLICK, ATTRIBUTION, REVENUE, REATTRIBUTION, INFO, GDPR;
UNKNOWN, SESSION, EVENT, CLICK, ATTRIBUTION, REVENUE, REATTRIBUTION, INFO, GDPR, AD_REVENUE;

public static ActivityKind fromString(String string) {
if ("session".equals(string)) {
Expand All @@ -16,6 +16,8 @@ public static ActivityKind fromString(String string) {
return INFO;
} else if ("gdpr".equals(string)) {
return GDPR;
} else if ("ad_revenue".equals(string)) {
return AD_REVENUE;
} else {
return UNKNOWN;
}
Expand All @@ -36,6 +38,8 @@ public String toString() {
return "info";
case GDPR:
return "gdpr";
case AD_REVENUE:
return "ad_revenue";
default:
return "unknown";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import android.content.Context;
import android.net.Uri;

import org.json.JSONObject;

/**
* The main interface to Adjust.
* Use the methods of this class to tell Adjust about the usage of your app.
Expand Down Expand Up @@ -30,7 +32,7 @@ private Adjust() {
*/
public static synchronized AdjustInstance getDefaultInstance() {
@SuppressWarnings("unused")
String VERSION = "!SDK-VERSION-STRING!:com.adjust.sdk:adjust-android:4.17.0";
String VERSION = "!SDK-VERSION-STRING!:com.adjust.sdk:adjust-android:4.18.4";

if (defaultInstance == null) {
defaultInstance = new AdjustInstance();
Expand Down Expand Up @@ -237,6 +239,17 @@ public static void gdprForgetMe(final Context context) {
adjustInstance.gdprForgetMe(context);
}

/**
* Track ad revenue from a source provider
*
* @param source Source of ad revenue information, see AdjustConfig.AD_REVENUE_* for some possible sources
* @param payload JsonObject content of the ad revenue information
*/
public static void trackAdRevenue(final String source, final JSONObject payload) {
AdjustInstance adjustInstance = Adjust.getDefaultInstance();
adjustInstance.trackAdRevenue(source, payload);
}

/**
* Called to get value of Google Play Advertising Identifier.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,25 @@ public class AdjustConfig {
public static final String ENVIRONMENT_SANDBOX = "sandbox";
public static final String ENVIRONMENT_PRODUCTION = "production";

public static final String AD_REVENUE_MOPUB = "mopub";
public static final String AD_REVENUE_ADMOB = "admob";
public static final String AD_REVENUE_FB_NATIVE_AD = "facebook_native_ad";
public static final String AD_REVENUE_IRONSOURCE = "ironsource";
public static final String AD_REVENUE_FYBER = "fyber";
public static final String AD_REVENUE_AERSERV = "aerserv";
public static final String AD_REVENUE_APPODEAL = "appodeal";
public static final String AD_REVENUE_ADINCUBE = "adincube";
public static final String AD_REVENUE_FUSE_POWERED = "fusepowered";
public static final String AD_REVENUE_ADDAPTR = "addapptr";
public static final String AD_REVENUE_MILLENNIAL_MEDITATION = "millennial_mediation";
public static final String AD_REVENUE_FLURRY = "flurry";
public static final String AD_REVENUE_ADMOST = "admost";
public static final String AD_REVENUE_DELTADNA = "deltadna";
public static final String AD_REVENUE_UPSIGHT = "upsight";
public static final String AD_REVENUE_UNITYADS = "unityads";
public static final String AD_REVENUE_ADTOAPP = "adtoapp";
public static final String AD_REVENUE_TAPDAQ = "tapdaq";

public AdjustConfig(Context context, String appToken, String environment) {
init(context, appToken, environment, false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public class AdjustContext extends FREContext {
public static String GetAttribution = "getAttribution";
public static String GetSdkVersion = "getSdkVersion";
public static String GdprForgetMe = "gdprForgetMe";
public static String TrackAdRevenue = "trackAdRevenue";
// iOS methods.
public static String GetIdfa = "getIdfa";
// Test methods.
Expand Down Expand Up @@ -70,6 +71,7 @@ public Map<String, FREFunction> getFunctions() {
functions.put(AdjustContext.GetAttribution, new AdjustFunction(AdjustContext.GetAttribution));
functions.put(AdjustContext.GetSdkVersion, new AdjustFunction(AdjustContext.GetSdkVersion));
functions.put(AdjustContext.GdprForgetMe, new AdjustFunction(AdjustContext.GdprForgetMe));
functions.put(AdjustContext.TrackAdRevenue, new AdjustFunction(AdjustContext.TrackAdRevenue));
// iOS methods.
functions.put(AdjustContext.GetIdfa, new AdjustFunction(AdjustContext.GetIdfa));
// Test methods.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ private static boolean checkEventToken(String eventToken, ILogger logger) {
logger.error("Missing Event Token");
return false;
}
if (eventToken.length() != 6) {
logger.error("Malformed Event Token '%s'", eventToken);
if (eventToken.length() <= 0) {
logger.error("Event Token can't be empty");
return false;
}
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.adobe.fre.*;
import android.net.Uri;
import android.util.Log;
import org.json.JSONObject;

public class AdjustFunction implements FREFunction,
OnAttributionChangedListener,
Expand Down Expand Up @@ -88,6 +89,9 @@ public FREObject call(FREContext freContext, FREObject[] freObjects) {
if (functionName == AdjustContext.SendFirstPackages) {
return SendFirstPackages(freContext, freObjects);
}
if (functionName == AdjustContext.TrackAdRevenue) {
return TrackAdRevenue(freContext, freObjects);
}
if (functionName == AdjustContext.GetAdid) {
return GetAdid(freContext, freObjects);
}
Expand Down Expand Up @@ -449,6 +453,19 @@ private FREObject SendFirstPackages(FREContext freContext, FREObject[] freObject
return null;
}

private FREObject TrackAdRevenue(FREContext freContext, FREObject[] freObjects) {
try {
String source = freObjects[0].getAsString();
String payload = freObjects[1].getAsString();
JSONObject jsonPayload = new JSONObject(payload);
Adjust.trackAdRevenue(source, jsonPayload);
} catch (Exception e) {
Log.e(AdjustExtension.LogTag, e.getMessage());
}

return null;
}

private FREObject SetOfflineMode(FREContext freContext, FREObject[] freObjects) {
try {
Boolean isOffline = freObjects[0].getAsBool();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import android.net.Uri;
import android.content.Context;

import org.json.JSONObject;

import java.util.List;
import java.util.ArrayList;

Expand Down Expand Up @@ -387,6 +389,19 @@ public void gdprForgetMe(final Context context) {
}
}

/**
* Track ad revenue from a source provider
*
* @param source Source of ad revenue information, see AdjustConfig.AD_REVENUE_* for some possible sources
* @param adRevenueJson JsonObject content of the ad revenue information
*/
public void trackAdRevenue(String source, JSONObject adRevenueJson) {
if (!checkActivityHandler()) {
return;
}
activityHandler.trackAdRevenue(source, adRevenueJson);
}

/**
* Called to get value of unique Adjust device identifier.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public interface Constants {
String GDPR_URL = "https://gdpr.adjust.com";
String SCHEME = "https";
String AUTHORITY = "app.adjust.com";
String CLIENT_SDK = "android4.17.0";
String CLIENT_SDK = "android4.18.4";
String LOGTAG = "Adjust";
String REFTAG = "reftag";
String INSTALL_REFERRER = "install_referrer";
Expand Down
Loading

0 comments on commit ff626bf

Please sign in to comment.