diff --git a/AdjustAdobeExtension/adobeextension/build.gradle b/AdjustAdobeExtension/adobeextension/build.gradle index 1e11693..7bf20f3 100644 --- a/AdjustAdobeExtension/adobeextension/build.gradle +++ b/AdjustAdobeExtension/adobeextension/build.gradle @@ -4,11 +4,11 @@ apply plugin: 'signing' android { namespace 'com.adjust.adobeextension' - compileSdk 34 + compileSdk 35 defaultConfig { - minSdkVersion 19 - targetSdkVersion 34 + minSdkVersion 21 + targetSdkVersion 35 consumerProguardFiles "consumer-rules.pro" } @@ -22,15 +22,15 @@ android { } dependencies { - implementation 'androidx.test.ext:junit:1.1.5' - implementation 'com.adjust.sdk:adjust-android:4.38.1' - implementation 'com.adobe.marketing.mobile:core:2.6.1' + implementation 'androidx.test.ext:junit:1.2.1' + implementation 'com.adjust.sdk:adjust-android:5.0.1' + implementation 'com.adobe.marketing.mobile:core:3.2.0' } // init def libGroupId = 'com.adjust.adobeextension' def libArtifactId = 'adobeextension' -def libVersion = '2.0.0' +def libVersion = '3.0.0' def libName = 'Adjust Extension for Adobe Experience SDK' def libDesc = 'This is the Android Adobe Mobile Extension of Adjust.' def libUrl = 'https://github.com/adjust/android_adobe_extension' diff --git a/AdjustAdobeExtension/adobeextension/src/main/AndroidManifest.xml b/AdjustAdobeExtension/adobeextension/src/main/AndroidManifest.xml index 5e4420e..acefe0a 100644 --- a/AdjustAdobeExtension/adobeextension/src/main/AndroidManifest.xml +++ b/AdjustAdobeExtension/adobeextension/src/main/AndroidManifest.xml @@ -2,10 +2,6 @@ - diff --git a/AdjustAdobeExtension/adobeextension/src/main/java/com/adjust/adobeextension/ActivityLifecycleProvider.java b/AdjustAdobeExtension/adobeextension/src/main/java/com/adjust/adobeextension/ActivityLifecycleProvider.java deleted file mode 100644 index ae8f752..0000000 --- a/AdjustAdobeExtension/adobeextension/src/main/java/com/adjust/adobeextension/ActivityLifecycleProvider.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.adjust.adobeextension; - -import android.content.ContentProvider; -import android.content.ContentValues; -import android.database.Cursor; -import android.net.Uri; - -public class ActivityLifecycleProvider - extends ContentProvider -{ - @Override - public boolean onCreate() { - return AdjustSdkApiHandler.getInstance(). - registerActivityLifecycleCallbacks(getContext()); - } - - @Override - public Cursor query(final Uri uri, - final String[] projection, - final String selection, - final String[] selectionArgs, - final String sortOrder) - { - return null; - } - - @Override - public String getType(final Uri uri) { - return null; - } - - @Override - public Uri insert(final Uri uri, final ContentValues values) { - return null; - } - - @Override - public int delete(final Uri uri, - final String selection, - final String[] selectionArgs) - { - return 0; - } - - @Override - public int update(final Uri uri, - final ContentValues values, - final String selection, - final String[] selectionArgs) - { - return 0; - } -} diff --git a/AdjustAdobeExtension/adobeextension/src/main/java/com/adjust/adobeextension/AdjustAdobeExtension.java b/AdjustAdobeExtension/adobeextension/src/main/java/com/adjust/adobeextension/AdjustAdobeExtension.java index 19eb032..6273409 100644 --- a/AdjustAdobeExtension/adobeextension/src/main/java/com/adjust/adobeextension/AdjustAdobeExtension.java +++ b/AdjustAdobeExtension/adobeextension/src/main/java/com/adjust/adobeextension/AdjustAdobeExtension.java @@ -2,10 +2,6 @@ import static com.adjust.adobeextension.AdjustAdobeExtensionConstants.LOG_EXTENSION; -import android.content.Context; -import android.net.Uri; - -import com.adjust.sdk.Adjust; import com.adobe.marketing.mobile.services.Log; /** @@ -59,19 +55,7 @@ public static void setConfiguration(final AdjustAdobeExtensionConfig config) { Log.debug(LOG_EXTENSION, LOG_SOURCE, "Adjust Adobe Extension initialized"); } - /** - * Method used to process deep link. - * - * @param url Deep link URL to process - * @param context Application context - */ - public static void openUrl(Uri url, Context context) { - // Pass deep link to Adjust in order to potentially reattribute user. - Log.debug(LOG_EXTENSION, LOG_SOURCE, "openUrl: " + url); - Adjust.appWillOpenUrl(url, context); - } - - /** +/** * Method used to get Adjust Adobe Extension Config. * @return AdjustAdobeExtensionConfig config to initialize Adjust Sdk */ diff --git a/AdjustAdobeExtension/adobeextension/src/main/java/com/adjust/adobeextension/AdjustAdobeExtensionConfig.java b/AdjustAdobeExtension/adobeextension/src/main/java/com/adjust/adobeextension/AdjustAdobeExtensionConfig.java index ed812cd..08dbecb 100644 --- a/AdjustAdobeExtension/adobeextension/src/main/java/com/adjust/adobeextension/AdjustAdobeExtensionConfig.java +++ b/AdjustAdobeExtension/adobeextension/src/main/java/com/adjust/adobeextension/AdjustAdobeExtensionConfig.java @@ -2,7 +2,7 @@ import com.adjust.sdk.AdjustConfig; import com.adjust.sdk.OnAttributionChangedListener; -import com.adjust.sdk.OnDeeplinkResponseListener; +import com.adjust.sdk.OnDeferredDeeplinkResponseListener; /** * Class for Adjust Adobe Extension Config. @@ -25,6 +25,16 @@ public class AdjustAdobeExtensionConfig { */ private final String environment; + /** + * An external identifier for a device or user. + */ + private String externalDeviceId; + + /** + * A default tracker for preinstall attribution. + */ + private String defaultTracker; + /** * Callback to listen for attribution change. */ @@ -33,7 +43,7 @@ public class AdjustAdobeExtensionConfig { /** * Callback to listen for deeplink response. */ - private OnDeeplinkResponseListener onDeeplinkResponseListener; + private OnDeferredDeeplinkResponseListener onDeferredDeeplinkResponseListener; /** * Primary constructor. @@ -42,6 +52,20 @@ public AdjustAdobeExtensionConfig(final String environment) { this.environment = environment; } + /** + * Method to set an external identifier for a device or user. + */ + public void setExternalDeviceId(String externalDeviceId) { + this.externalDeviceId = externalDeviceId; + } + + /** + * Method to set a default tracker for preinstall attribution. + */ + public void setDefaultTracker(String defaultTracker) { + this.defaultTracker = defaultTracker; + } + /** * Method to set callback for attribution change. */ @@ -54,10 +78,10 @@ public void setOnAttributionChangedListener( /** * Method to set callback for deeplink response. */ - public void setOnDeeplinkResponseListener( - final OnDeeplinkResponseListener onDeeplinkResponseListener) + public void setOnDeferredDeeplinkResponseListener( + final OnDeferredDeeplinkResponseListener onDeferredDeeplinkResponseListener) { - this.onDeeplinkResponseListener = onDeeplinkResponseListener; + this.onDeferredDeeplinkResponseListener = onDeferredDeeplinkResponseListener; } /** @@ -67,6 +91,20 @@ public String getEnvironment() { return environment; } + /** + * Method to get the external identifier set for a device or user. + */ + public String getExternalDeviceId() { + return externalDeviceId; + } + + /** + * Method to get the default tracker set for preinstall attribution. + */ + public String getDefaultTracker() { + return defaultTracker; + } + /** * Method to get attribution change callback listener */ @@ -77,7 +115,7 @@ public OnAttributionChangedListener getOnAttributionChangedListener() { /** * Method to get deeplink response callback listener */ - public OnDeeplinkResponseListener getOnDeeplinkResponseListener() { - return onDeeplinkResponseListener; + public OnDeferredDeeplinkResponseListener getOnDeferredDeeplinkResponseListener() { + return onDeferredDeeplinkResponseListener; } } diff --git a/AdjustAdobeExtension/adobeextension/src/main/java/com/adjust/adobeextension/AdjustAdobeExtensionConstants.java b/AdjustAdobeExtension/adobeextension/src/main/java/com/adjust/adobeextension/AdjustAdobeExtensionConstants.java index 1827a2d..17463e3 100644 --- a/AdjustAdobeExtension/adobeextension/src/main/java/com/adjust/adobeextension/AdjustAdobeExtensionConstants.java +++ b/AdjustAdobeExtension/adobeextension/src/main/java/com/adjust/adobeextension/AdjustAdobeExtensionConstants.java @@ -3,7 +3,7 @@ class AdjustAdobeExtensionConstants { static final String LOG_EXTENSION = "AdjustAdobeExtension"; static final String EXTENSION_NAME = "com.adjust.adobeextension"; - static final String EXTENSION_VERSION = "adobe_ext2.0.0"; + static final String EXTENSION_VERSION = "adobe_ext3.0.0"; static final String ADOBE_MODULE_CONFIGURATION = "com.adobe.module.configuration"; static final String ADOBE_SHARED_STATE_OWNER = "stateowner"; diff --git a/AdjustAdobeExtension/adobeextension/src/main/java/com/adjust/adobeextension/AdjustSdkApiHandler.java b/AdjustAdobeExtension/adobeextension/src/main/java/com/adjust/adobeextension/AdjustSdkApiHandler.java index ece846c..20f8172 100644 --- a/AdjustAdobeExtension/adobeextension/src/main/java/com/adjust/adobeextension/AdjustSdkApiHandler.java +++ b/AdjustAdobeExtension/adobeextension/src/main/java/com/adjust/adobeextension/AdjustSdkApiHandler.java @@ -9,10 +9,10 @@ import static com.adjust.adobeextension.AdjustAdobeExtensionConstants.ADJUST_KEY_PUSH_TOKEN_PARAM; import static com.adjust.adobeextension.AdjustAdobeExtensionConstants.LOG_EXTENSION; -import android.app.Activity; import android.app.Application; import android.content.Context; -import android.os.Bundle; + +import com.adjust.sdk.Util; import com.adobe.marketing.mobile.services.Log; import com.adjust.sdk.Adjust; @@ -42,11 +42,6 @@ class AdjustSdkApiHandler { */ private static boolean sdkInitialised = false; - /** - * Toggle flag to indicate whether Android Activity has been resumed or paused - */ - private static boolean activityResumed = false; - /** * Application instance */ @@ -95,12 +90,7 @@ protected void initSdk(final String appToken, final boolean shouldTrackAttributi AdjustConfig adjustConfig = getAdjustConfig(application.getApplicationContext(), appToken, shouldTrackAttribution, adjustAdobeExtensionConfig); adjustConfig.setSdkPrefix(AdjustAdobeExtensionConstants.EXTENSION_VERSION); - Adjust.onCreate(adjustConfig); - - // there might be a moment when activity is already resumed before Sdk initialization - if (activityResumed) { - Adjust.onResume(); - } + Adjust.initSdk(adjustConfig); sdkInitialised = true; } @@ -194,39 +184,7 @@ protected boolean isSdkInitialised() { * @return String Adjust sdk version */ protected String getVersion() { - return Adjust.getSdkVersion(); - } - - /** - * This registers AdjustLifecycleCallbacks to activity lifecycle callbacks - * It allows tracking of activity lifecycle states - */ - protected boolean registerActivityLifecycleCallbacks(final Context context) { - if (application != null) { - Log.debug(LOG_EXTENSION, LOG_SOURCE,"Cannot register activity lifecycle callbacks more than once"); - return false; - } - - if (context == null) { - Log.debug(LOG_EXTENSION, LOG_SOURCE,"Cannot register activity lifecycle callbacks without context"); - return false; - } - - final Context applicationContext = context.getApplicationContext(); - - if (!(applicationContext instanceof Application)) { - Log.debug(LOG_EXTENSION, LOG_SOURCE,"Cannot register activity lifecycle callbacks " - + "without application context as Application"); - return false; - } - - Log.debug(LOG_EXTENSION, LOG_SOURCE,"Registering activity lifecycle callbacks"); - - - application = (Application) applicationContext; - application.registerActivityLifecycleCallbacks(new AdjustLifecycleCallbacks()); - - return true; + return Util.getSdkVersion(); } /** @@ -258,6 +216,10 @@ private AdjustConfig getAdjustConfig( break; } + adjustConfig.setExternalDeviceId(adjustAdobeExtensionConfig.getExternalDeviceId()); + + adjustConfig.setDefaultTracker(adjustAdobeExtensionConfig.getDefaultTracker()); + adjustConfig.setOnAttributionChangedListener(new OnAttributionChangedListener() { @Override public @@ -291,48 +253,9 @@ void onAttributionChanged(final AdjustAttribution attribution) { } }); - adjustConfig.setOnDeeplinkResponseListener( - adjustAdobeExtensionConfig.getOnDeeplinkResponseListener()); + adjustConfig.setOnDeferredDeeplinkResponseListener( + adjustAdobeExtensionConfig.getOnDeferredDeeplinkResponseListener()); return adjustConfig; } - - private static final class AdjustLifecycleCallbacks - implements Application.ActivityLifecycleCallbacks - { - @Override - public void onActivityResumed(final Activity activity) { - activityResumed = true; - - // there might be a moment when Sdk is not initialized while Activity resumed - if (sdkInitialised) { - Adjust.onResume(); - } - } - - @Override - public void onActivityPaused(final Activity activity) { - activityResumed = false; - - // there might be a moment when Sdk is not initialized while Activity paused - if (sdkInitialised) { - Adjust.onPause(); - } - } - - @Override - public void onActivityStopped(final Activity activity) {} - - @Override - public void onActivitySaveInstanceState(final Activity activity, final Bundle outState) {} - - @Override - public void onActivityDestroyed(final Activity activity) {} - - @Override - public void onActivityCreated(final Activity activity, final Bundle savedInstanceState) {} - - @Override - public void onActivityStarted(final Activity activity) {} - } } diff --git a/AdjustAdobeExtension/build.gradle b/AdjustAdobeExtension/build.gradle index 2b81b0e..26cebe8 100644 --- a/AdjustAdobeExtension/build.gradle +++ b/AdjustAdobeExtension/build.gradle @@ -5,7 +5,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:8.1.4' + classpath 'com.android.tools.build:gradle:8.7.1' } } diff --git a/AdjustAdobeExtension/example-app/build.gradle b/AdjustAdobeExtension/example-app/build.gradle index fdb7eee..40cb973 100644 --- a/AdjustAdobeExtension/example-app/build.gradle +++ b/AdjustAdobeExtension/example-app/build.gradle @@ -11,12 +11,12 @@ repositories { android { namespace 'com.adjust.examples' - compileSdk 34 + compileSdk 35 defaultConfig { applicationId "com.adjust.examples" - minSdkVersion 19 - targetSdkVersion 34 + minSdkVersion 21 + targetSdkVersion 35 versionCode 1 versionName "1.0" @@ -37,21 +37,21 @@ android { dependencies { - implementation 'androidx.appcompat:appcompat:1.6.1' - implementation 'com.google.android.material:material:1.11.0' + implementation 'androidx.appcompat:appcompat:1.7.0' + implementation 'com.google.android.material:material:1.12.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' - implementation 'androidx.navigation:navigation-fragment:2.7.6' - implementation 'androidx.navigation:navigation-ui:2.7.6' + implementation 'androidx.navigation:navigation-fragment:2.8.2' + implementation 'androidx.navigation:navigation-ui:2.8.2' testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.1.5' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' + androidTestImplementation 'androidx.test.ext:junit:1.2.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1' - implementation 'com.adobe.marketing.mobile:core:2.6.1' - implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1' + implementation 'com.adobe.marketing.mobile:core:3.2.0' + implementation 'com.google.android.gms:play-services-ads-identifier:18.1.0' implementation 'com.android.installreferrer:installreferrer:2.2' - implementation 'com.adjust.sdk:adjust-android:4.38.1' + implementation 'com.adjust.sdk:adjust-android:5.0.1' implementation project(path: ':adobeextension') - //implementation 'com.adjust.adobeextension:adobeextension:2.0.0' + //implementation 'com.adjust.adobeextension:adobeextension:3.0.0' } \ No newline at end of file diff --git a/AdjustAdobeExtension/example-app/src/main/java/com/adjust/examples/MainActivity.java b/AdjustAdobeExtension/example-app/src/main/java/com/adjust/examples/MainActivity.java index 2ebc4ff..179e24e 100644 --- a/AdjustAdobeExtension/example-app/src/main/java/com/adjust/examples/MainActivity.java +++ b/AdjustAdobeExtension/example-app/src/main/java/com/adjust/examples/MainActivity.java @@ -8,6 +8,8 @@ import androidx.appcompat.app.AppCompatActivity; import com.adjust.adobeextension.AdjustAdobeExtension; +import com.adjust.sdk.Adjust; +import com.adjust.sdk.AdjustDeeplink; import com.adobe.marketing.mobile.MobileCore; import java.util.HashMap; @@ -23,7 +25,8 @@ void onCreate(Bundle savedInstanceState) { Intent intent = getIntent(); Uri data = intent.getData(); - AdjustAdobeExtension.openUrl(data, getApplicationContext()); + AdjustDeeplink adjustDeeplink = new AdjustDeeplink(data); + Adjust.processDeeplink(adjustDeeplink, getApplicationContext()); } public void trackSimpleEvent(View view) { diff --git a/AdjustAdobeExtension/example-app/src/main/java/com/adjust/examples/MainApp.java b/AdjustAdobeExtension/example-app/src/main/java/com/adjust/examples/MainApp.java index ad49068..0ba01f4 100644 --- a/AdjustAdobeExtension/example-app/src/main/java/com/adjust/examples/MainApp.java +++ b/AdjustAdobeExtension/example-app/src/main/java/com/adjust/examples/MainApp.java @@ -6,9 +6,10 @@ import com.adjust.adobeextension.AdjustAdobeExtension; import com.adjust.adobeextension.AdjustAdobeExtensionConfig; +import com.adjust.sdk.Adjust; import com.adjust.sdk.AdjustAttribution; import com.adjust.sdk.OnAttributionChangedListener; -import com.adjust.sdk.OnDeeplinkResponseListener; +import com.adjust.sdk.OnDeferredDeeplinkResponseListener; import com.adobe.marketing.mobile.AdobeCallback; import com.adobe.marketing.mobile.Extension; import com.adobe.marketing.mobile.LoggingMode; @@ -67,11 +68,11 @@ public void onAttributionChanged(AdjustAttribution attribution) { }); // Evaluate deferred deep link to be launched. - config.setOnDeeplinkResponseListener(new OnDeeplinkResponseListener() { + config.setOnDeferredDeeplinkResponseListener(new OnDeferredDeeplinkResponseListener() { @Override - public boolean launchReceivedDeeplink(Uri deeplink) { + public boolean launchReceivedDeeplink(Uri uri) { Log.d("example", "Deferred deep link callback called!"); - Log.d("example", "Deep link URL: " + deeplink); + Log.d("example", "Deep link URL: " + uri); return true; } @@ -82,5 +83,13 @@ public boolean launchReceivedDeeplink(Uri deeplink) { } catch (Exception e) { } + + // Add global callback parameters. + Adjust.addGlobalCallbackParameter("gc_foo", "gc_bar"); + Adjust.addGlobalCallbackParameter("gc_key", "gc_value"); + + // Add global partner parameters. + Adjust.addGlobalPartnerParameter("gp_foo", "gp_bar"); + Adjust.addGlobalPartnerParameter("gp_key", "gp_value"); } } diff --git a/AdjustAdobeExtension/gradle/wrapper/gradle-wrapper.properties b/AdjustAdobeExtension/gradle/wrapper/gradle-wrapper.properties index 4bbf50d..1c224db 100644 --- a/AdjustAdobeExtension/gradle/wrapper/gradle-wrapper.properties +++ b/AdjustAdobeExtension/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Tue Oct 27 12:12:25 CET 2020 +#Fri Oct 04 15:25:42 CEST 2024 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip diff --git a/CHANGELOG.md b/CHANGELOG.md index d6936b4..bd20ee6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +### Version 3.0.0 (21st November 2024) + +We're excited to release our new major Android Adobe Extension version (v3). Among many internal improvements, our spoofing protection solution is now included out of the box, reinforcing our commitment to accurate, actionable, and fraud-free data. + +To try out Android Adobe extension v3 in your app, you can follow our new v2 to v3 [migration guide](https://dev.adjust.com/en/sdk/migration/adobe-extension/android). + +#### Native Android SDK +- [Android@v5.0.1](https://github.com/adjust/android_sdk/tree/v5.0.1) + +--- + ### Version 2.0.0 (30th January 2024) ### Added - Added support for the latest Adobe Experience Platform Core SDK version 2.0 and above. diff --git a/LICENSE b/LICENSE index dd79c02..d9c294e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2020 Adjust GmbH, http://www.adjust.com +Copyright (c) 2020-Present Adjust GmbH, http://www.adjust.com Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/README.md b/README.md index 201f806..e7a8794 100644 --- a/README.md +++ b/README.md @@ -1,431 +1,7 @@ -# Adjust Extension for Adobe Experience SDK +# Adjust Android Extension for Adobe Experience Platform SDK -This is the Android Adobe Mobile Extension of Adjust™. You can read more about Adjust™ at [adjust.com]. +This is the [Adjust](https://adjust.com)™ SDK for Adjust Android Extension for Adobe Experience Platform SDK (AEP SDK). Documentation is available on our [developer docs](https://dev.adjust.com/en/sdk/adobe-extension/android). -## Table of contents - -### Quick start - - * [Example app](#qs-example-app) - * [Getting started](#qs-getting-started) - * [Add the Extension to your project](#qs-add-extension) - * [Add Google Play Services](#qs-gps) - * [Add permissions](#qs-permissions) - * [Proguard settings](#qs-proguard) - * [Install referrer](#qs-install-referrer) - * [Google Play Referrer API](#qs-gpr-api) - * [Integrate the Adjust SDK Extension into your app](#qs-integrate-extension) - * [Basic setup](#qs-basic-setup) - * [Session tracking](#qs-session-tracking) - * [Attribution](#qs-attribution) - * [Adjust logging](#qs-adjust-logging) - * [Build your app](#qs-build-the-app) - -### Event tracking - - * [Track event](#et-tracking) - * [Track revenue](#et-revenue) - -### Custom parameters - - * [Custom parameters overview](#cp) - * [Event parameters](#cp-event-parameters) - * [Event callback parameters](#cp-event-callback-parameters) - * [Event partner parameters](#cp-event-partner-parameters) - -### Additional features - - * [Attribution callback](#af-attribution-callback) - * [Deferred deep linking callback](#af-deferred-deep-linking-callback) - * [Push token (uninstall tracking)](#af-push-token) - - -## Quick start - -### Example app - -There is an Android example app inside the [example-app][example-app] directory. You can open the Android project to see the example on how the Adjust Adobe Extension can be integrated. - -### Getting started - -These are the minimum required steps to integrate the Adjust Extension in your Android app. We assume that you are using Android Studio for your Android development. The minimum supported Android API level for the Adjust Extension for Adobe Experience SDK integration is **19 (KitKat)**. - -### Add the Extension to your project - -If you are using [`Maven`][maven], add the following to your `build.gradle` file: - -```gradle -implementation 'com.adjust.adobeextension:adobeextension:2.0.0' -implementation 'com.adjust.sdk:adjust-android:4.38.1' -implementation 'com.adobe.marketing.mobile:core:2.6.1' -implementation 'com.android.installreferrer:installreferrer:2.2' -``` - -### Add Google Play Services - -Apps in the Google Play Store must use the [Google Advertising ID][google-ad-id] to uniquely identify devices. To enable the Google Advertising ID for our SDK, you must integrate [Google Play Services][google-play-services]. If you haven't done this yet, please add dependency to the Google Play Services library by adding the following dependecy to your `dependencies` block of app's `build.gradle` file: - -```gradle -implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1' -``` - -**Note**: The Adjust Extension is not tied to any specific version of the `play-services-ads-identifier` part of the Google Play Services library. You can use the latest version of the library, or any other version you need. - -### Add permissions - -The Adjust Extension requires the following permissions. Please add them to your `AndroidManifest.xml` file if they are not already present: - -```xml - - -``` - -#### 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 `AndroidManifest.xml` to enable the permission. - -```xml - -``` - -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). - -### Proguard settings - -If you are using Proguard, add these lines to your Proguard file: - -``` --keep class com.adjust.sdk.** { *; } --keep class com.google.android.gms.common.ConnectionResult { - int SUCCESS; -} --keep class com.google.android.gms.ads.identifier.AdvertisingIdClient { - com.google.android.gms.ads.identifier.AdvertisingIdClient$Info getAdvertisingIdInfo(android.content.Context); -} --keep class com.google.android.gms.ads.identifier.AdvertisingIdClient$Info { - java.lang.String getId(); - boolean isLimitAdTrackingEnabled(); -} --keep public class com.android.installreferrer.** { *; } -``` - -If you are **not publishing your app in the Google Play Store**, use the following package rules: - -``` --keep class com.adjust.sdk.** { *; } -``` - -### Install referrer - -In order to correctly attribute an app install to its source, Adjust needs information about the **install referrer**. We can achieve this by using the **Google Play Referrer API** for apps on Google Play Store and by using the **Huawei Referrer API** for apps on Huawei Mobile Store. - -#### Google Play Referrer API - -In order to support the Google Play Referrer API in your app, please make sure that you have followed our chapter on [adding the Extension to your project](#qs-add-extension) correctly and that you have following line added to your `build.gradle` file: - -``` -implementation 'com.android.installreferrer:installreferrer:2.2' -``` - -Please follow the directions for your [Proguard settings](#qs-proguard) carefully. Confirm that you have added all the rules mentioned in it, especially the one needed for this feature: - -``` --keep public class com.android.installreferrer.** { *; } -``` - -### Integrate the Adjust Extension into your app - -First, we'll set up basic session tracking. - -### Basic setup - -We recommend using a global Android [Application][android-application] class to register the Extension. If you don't have one in your app, follow these steps: - -- Create a class that extends the `Application`. -- Open the `AndroidManifest.xml` file of your app and locate the `` element. -- Add the attribute `android:name` and set it to the name of your new application class. - -In our example app, we use an `Application` class named `MainApp`. Therefore, we configure the manifest file as: -```xml - - -``` - -- In your `Application` class, find or create the `onCreate` method. Add the following code to register the Adjust Extension: - -```java -import android.app.Application; -import android.net.Uri; -import android.util.Log; - -import com.adjust.adobeextension.AdjustAdobeExtension; -import com.adjust.adobeextension.AdjustAdobeExtensionConfig; -import com.adobe.marketing.mobile.AdobeCallback; -import com.adobe.marketing.mobile.Analytics; -import com.adobe.marketing.mobile.Extension; -import com.adobe.marketing.mobile.Identity; -import com.adobe.marketing.mobile.LoggingMode; -import com.adobe.marketing.mobile.MobileCore; - - -public class MainApp extends Application { - @Override - public void onCreate() { - super.onCreate(); - - // basic Adobe extension setup - MobileCore.setApplication(this); - MobileCore.setLogLevel(LoggingMode.VERBOSE); - - // configure Adjust Adobe extension - try { - MobileCore.configureWithAppID("your_adobe_app_id"); - - AdjustAdobeExtensionConfig config = - new AdjustAdobeExtensionConfig(AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX); - - // register the Adjust SDK extension - AdjustAdobeExtension.setConfiguration(config); - } catch (Exception e) { - Log.e("example", "Exception while configuration: " + e.getMessage()); - } - - // register extensions - try { - List> extensions = Arrays.asList( - Analytics.EXTENSION, - Identity.EXTENSION, - AdjustAdobeExtension.EXTENSION); - MobileCore.registerExtensions(extensions, new AdobeCallback() { - @Override - public void call(Object o) { - Log.d("example", "Adjust Adobe Extension SDK initialized"); - } - }); - } catch (Exception e) { - Log.e("example", "Exception while registering Extension: " + e.getMessage()); - } - } -} -``` - -Replace `{your_adobe_app_id}` with your app id from Adobe Experience Platform Launch. - -Next, you must set the `environment` to either sandbox or production mode: - -```java -String environment = AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX; -String environment = AdjustAdobeExtensionConfig.ENVIRONMENT_PRODUCTION; -``` - -**Important:** Set the value to `AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX` if (and only if) you or someone else is testing your app. Make sure to set the environment to `AdjustAdobeExtensionConfig.ENVIRONMENT_PRODUCTION` before you publish the app. Set it back to `AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX` if you start developing and testing it again. - -We use this environment to distinguish between real traffic and test traffic from test devices. Keeping the environment updated according to your current status is very important! - - -### Session tracking - -Adjust SDK can track sessions in your app based on Activity lifecycle. - -### Attribution - -The option to share attribution data with Adobe is in the Launch dashboard under the extensions configuration and is on by default. Adjust tracks the action name `Adjust Campaign Data Received` with the following attribution information from Adjust: - -* `Adjust Network` -* `Adjust Campaign` -* `Adjust AdGroup` -* `Adjust Creative` - -### Adjust logging - -You can increase or decrease the amount of logs that you see during testing by calling `setLogLevel` on Adobe Mobile Core instance with one of the following parameters: - -```java -MobileCore.setLogLevel(LogLevel.VERBOSE); // enable all logs -MobileCore.setLogLevel(LogLevel.DEBUG); // disable verbose logs -MobileCore.setLogLevel(LogLevel.WARNING); // disable debug logs -MobileCore.setLogLevel(LogLevel.ERROR); // disable warning logs -``` - -### Build your app - -Build and run your Android app. In your `LogCat` viewer, set the filter `tag:Adjust` to hide all other logs. After your app has launched you should see the following Adjust log: `Install tracked`. - -## Event tracking - -### Track event - -You can use Adobe `MobileCore.trackAction` API for [`event tracking`][event-tracking]. Suppose you want to track every tap on a button. To do so, you'll create a new event token in your [dashboard]. Let's say that the event token is `abc123`. In your button's `onClick` method, add the following lines to track the click: - -```java -String action = AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT; -Map contextData= new HashMap(); -contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_TOKEN, "abc123"); - -MobileCore.trackAction(action, contextData); -``` - -**Note**: The key used for eventToken is prefixed with **adj.** - -### Track revenue - -If your users can generate revenue by tapping on advertisements or making in-app purchases, you can track those revenues too with events. Let's say a tap is worth one Euro cent. You can track the revenue event like this: - -```java -String action = AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT; -Map contextData= new HashMap(); -contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_TOKEN, "abc123"); -contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_REVENUE, "0.01"); -contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_CURRENCY, "EUR"); - -MobileCore.trackAction(action, contextData); -``` - -**Note**: The key used are prefixed with **adj.** - -## Custom parameters - -### Custom parameters overview - -In addition to the data points the Adjust SDK collects by default, you can use the extension to track and add as many custom values as you need (user IDs, product IDs, etc.) to the event or session. Custom parameters are only available as raw data and will **not** appear in your Adjust dashboard. - -You should use **callback parameters** for the values you collect for your own internal use, and **partner parameters** for those you share with external partners. If a value (e.g. product ID) is tracked both for internal use and external partner use, we recommend you track it with both callback and partner parameters. - - -### Event parameters - -### Event callback parameters - -You can register a callback URL for your events in your [dashboard]. We will send a GET request to that URL whenever the event is tracked. You can add callback parameters to that event by adding them as key value pair to the context data map before tracking it. We will then append these parameters to your callback URL. - -For example, if you've registered the URL `http://www.example.com/callback`, then you would track an event like this: - -```java -String action = AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT; -Map contextData= new HashMap(); -contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_TOKEN, "abc123"); -contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_CALLBACK_PARAM_PREFIX + "key1", "value1"); -contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_CALLBACK_PARAM_PREFIX + "key2", "value2"); - -MobileCore.trackAction(action, contextData); -``` - -In this case we would track the event and send a request to: - -``` -http://www.example.com/callback?key1=value1&key2=value2 -``` - -Adjust supports a variety of placeholders, for example `{gps_adid}`, which can be used as parameter values. In the resulting callback, we would replace the placeholder (in this case) with the Google Play Services ID of the current device. Please note that we don't store any of your custom parameters. We **only** append them to your callbacks. If you haven't registered a callback for an event, we will not even read these parameters. - -You can read more about URL callbacks (including a full list of available values) in our [callbacks guide][callbacks-guide]. - -### Event partner parameters - -When your parameters are activated in the Adjust dashboard, you have the option to transmit them to your network partners. - -This works similarly to the callback parameters mentioned above; - -```java -String action = AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT; -Map contextData= new HashMap(); -contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_TOKEN, "abc123"); -contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_PARTNER_PARAM_PREFIX + "key1", "value1"); -contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_PARTNER_PARAM_PREFIX + "key2", "value2"); - -MobileCore.trackAction(action, contextData); -``` - -You can read more about special partners and these integrations in our [guide to special partners][special-partners]. - -## Additional features - -Once you have integrated the Adjust Extension for Adobe Experience SDK into your project, you can take advantage of the following features: - -### Attribution callback - -You can register a listener to be notified of tracker attribution changes. Due to the different sources we consider for attribution, we cannot provide this information synchronously. - -Please see our [attribution data policies][attribution-data] for more information. - -With the extension config instance, add the attribution callback before you start the SDK: - -```java -AdjustAdobeExtensionConfig config = new AdjustAdobeExtensionConfig(environment); - -config.setOnAttributionChangedListener(new OnAttributionChangedListener() { - @Override - public void onAttributionChanged(AdjustAttribution attribution) {} -}); - -AdjustAdobeExtension.setConfiguration(config); -``` - -The listener function is called after the SDK receives the final attribution data. Within the listener function, you'll have access to the `attribution` parameter. - -### Direct deep linking (reattribution) - -Deep links are URLs that direct users to a specific page in your app without any additional navigation. You can use them throughout your marketing funnel to improve user acquisition, engagement, and retention. You can also re-engage your users via deep links which can potentially change their attribution. In order for Adjust to be able to properly reattribute your users via deep links, you need to make sure to pass the deep link to Adjust Adobe extension like desrcribed below: - -```java -Intent intent = getIntent(); -Uri data = intent.getData(); -AdjustAdobeExtension.openUrl(data, getApplicationContext()); -``` - -### Deferred deep linking callback - -The Adjust SDK opens the deferred deep link by default. There is no extra configuration needed. But if you wish to control whether the Adjust SDK will open the deferred deep link or not, you can do it with a callback method in the config object. - -With the extension config instance, add the deferred deep linking callback before you start the SDK: - -```java -AdjustAdobeExtensionConfig config = new AdjustAdobeExtensionConfig(environment); - -config.setOnDeeplinkResponseListener(new OnDeeplinkResponseListener() { - @Override - public boolean launchReceivedDeeplink(Uri deeplink) { - // ... - if (shouldAdjustSdkLaunchTheDeeplink(deeplink)) { - return true; - } else { - return false; - } - } -}); - -AdjustAdobeExtension.setConfiguration(config); -``` - -After the Adjust SDK receives the deep link information from our backend, the SDK will deliver you its content via the listener and expect the boolean return value from you. This return value represents your decision on whether or not the Adjust SDK should launch the activity to which you have assigned the scheme name from the deeplink. - -### Push token (uninstall tracking) - -Push tokens are used for Audience Builder and client callbacks; they are also required for uninstall and reinstall tracking. - -To send us the push notification token, add the following call to Adjust once you have obtained your token (or whenever its value changes): - -```java -String action = AdjustAdobeExtension.ADOBE_ADJUST_ACTION_SET_PUSH_TOKEN; -Map contextData= new HashMap(); -contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_PUSH_TOKEN, "your_push_token"); - -MobileCore.trackAction(action, contextData); -``` - -[dashboard]: http://adjust.com -[adjust.com]: http://adjust.com - -[example-app]: AdjustAdobeExtension/example-app - -[maven]: http://maven.org -[google-ad-id]: https://support.google.com/googleplay/android-developer/answer/6048248?hl=en -[event-tracking]: https://docs.adjust.com/en/event-tracking -[callbacks-guide]: https://docs.adjust.com/en/callbacks -[special-partners]: https://docs.adjust.com/en/special-partners -[attribution-data]: https://github.com/adjust/sdks/blob/master/doc/attribution-data.md -[android-application]: http://developer.android.com/reference/android/app/Application.html -[google-play-services]: http://developer.android.com/google/play-services/setup.html +## License +Distributed under the [`MIT license`](LICENSE). diff --git a/VERSION b/VERSION index 9084fa2..4a36342 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.1.0 +3.0.0 diff --git a/docs/migrate.md b/docs/migrate.md deleted file mode 100644 index bb27227..0000000 --- a/docs/migrate.md +++ /dev/null @@ -1,210 +0,0 @@ -## Migrate Adjust Android Extension for Adobe Experience Platform SDK from v1.1.0 to v2.0.0 - -### Migration procedure - -Go to your app's `build.gradle` and update the dependencies as below: - -``` -implementation 'com.adjust.adobeextension:adobeextension:2.0.0 -implementation 'com.adobe.marketing.mobile:core:2.6.1' -``` - -In case your app's minimum SDK version is below API 19, update it to 19 in `build.gradle` as below: - -``` -minSdkVersion 19 -``` - -### SDK initialization - -We have changed how you configure and register the Adjust Extension. The following steps should now be -taken to configure the Adjust Extension: - -1. Create an instance of an `AdjustAdobeExtensionConfig` config object with environment. -2. Optionally, you can call methods of the `AdjustAdobeExtensionConfig` object to specify available - options same as earlier. -3. Set the `AdjustAdobeExtensionConfig` config object to the Adjust Adobe Extension by invoking - `AdjustAdobeExtensionConfig.setConfiguration` with the config object. -4. Register Adjust Adobe Extention with Adobe's Mobile Core SDK by invoking - `MobileCore.registerExtension` method. - -Here is an example of how the setup might look before and after the migration: - -##### Before - -You needed to edit app's `Application` class and to replace the code as below. - -```java -String environment = AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX; -AdjustAdobeExtensionConfig config = new AdjustAdobeExtensionConfig(environment); -AdjustAdobeExtension.registerExtension(config); - - // start Adobe core - MobileCore.start(new AdobeCallback () { - @Override - public void call(Object o) { - MobileCore.configureWithAppID("your_adobe_app_id"); - } -}); -``` - -##### After - -```java -// configure Adjust Adobe extension -try { - MobileCore.configureWithAppID("your_adobe_app_id"); - String environment = AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX; - AdjustAdobeExtensionConfig config = new AdjustAdobeExtensionConfig(environment); - - // register the Adjust SDK extension - AdjustAdobeExtension.setConfiguration(config); -} catch (Exception e) { - Log.e("example", "Exception while configuration: " + e.getMessage()); -} - -// register extensions -try { - List> extensions = Arrays.asList(AdjustAdobeExtension.EXTENSION); - MobileCore.registerExtensions(extensions, new AdobeCallback() { - @Override - public void call(Object o) { - Log.d("example", "Adjust Adobe Extension SDK initialized"); - } - }); -} catch (Exception e) { - Log.e("example", "Exception while registering Extension: " + e.getMessage()); -} -``` - -### Event tracking - -We also introduced proper constants to use. Again, an example of how it might look like before and after: - -##### Before - -```java -String action = "adj.trackEvent"; -Map contextData= new HashMap(); -contextData.put("adj.eventToken", "{EventToken}"); - -MobileCore.trackAction(action, contextData); -``` - -##### After - -```java -String action = AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT; -Map contextData= new HashMap(); -contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_TOKEN, "{EventToken}"); - -MobileCore.trackAction(action, contextData); -``` - -### Revenue tracking - -We also introduced proper constants to use. Again, an example of how it might look like before and after: - -##### Before - -```java -String action = "adj.trackEvent"; -Map contextData= new HashMap(); -contextData.put("adj.eventToken", "{EventToken}"); -contextData.put("adj.revenue", "{RevenueAmount}"); -contextData.put("adj.currency", "{RevenueCurrency}"); - -MobileCore.trackAction(action, contextData); -``` - -##### After - -```java -String action = AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT; -Map contextData= new HashMap(); -contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_TOKEN, "{EventToken}"); -contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_REVENUE, "{RevenueAmount}"); -contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_CURRENCY, "{RevenueCurrency}"); - -MobileCore.trackAction(action, contextData); -``` - -### Event callback parameters - -We also introduced proper constants to use. Again, an example of how it might look like before and after: - -##### Before - -```java -String action = "adj.trackEvent"; -Map contextData= new HashMap(); -contextData.put("adj.eventToken", "{EventToken}"); -contextData.put("adj.event.callback.key1", "value1"); -contextData.put("adj.event.callback.key2", "value2"); - -MobileCore.trackAction(action, contextData); -``` - -##### After - -```java -String action = AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT; -Map contextData= new HashMap(); -contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_TOKEN, "{EventToken}"); -contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_CALLBACK_PARAM_PREFIX + "key1", "value1"); -contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_CALLBACK_PARAM_PREFIX + "key2", "value2"); - -MobileCore.trackAction(action, contextData); -``` - -### Event partner parameters - -We also introduced proper constants to use. Again, an example of how it might look like before and after: - -##### Before - -```java -String action = "adj.trackEvent"; -Map contextData= new HashMap(); -contextData.put("adj.eventToken", "{EventToken}"); -contextData.put("adj.event.partner.key1", "value1"); -contextData.put("adj.event.partner.key2", "value2"); - -MobileCore.trackAction(action, contextData); -``` - -##### After - -```java -String action = AdjustAdobeExtension.ADOBE_ADJUST_ACTION_TRACK_EVENT; -Map contextData= new HashMap(); -contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_TOKEN, "{EventToken}"); -contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_PARTNER_PARAM_PREFIX + "key1", "value1"); -contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_EVENT_PARTNER_PARAM_PREFIX + "key2", "value2"); - -MobileCore.trackAction(action, contextData); -``` - -### Push token (uninstall tracking) - -We also introduced proper constants to use. Again, an example of how it might look like before and after: - -##### Before - -```java -String action = "adj.setPushToken"; -Map contextData= new HashMap(); -contextData.put("adj.pushToken", "{PushToken}"); - -MobileCore.trackAction(action, contextData); -``` - -##### After - -```java -String action = AdjustAdobeExtension.ADOBE_ADJUST_ACTION_SET_PUSH_TOKEN; -Map contextData= new HashMap(); -contextData.put(AdjustAdobeExtension.ADOBE_ADJUST_PUSH_TOKEN, "{PushToken}"); - -MobileCore.trackAction(action, contextData); -``` \ No newline at end of file