The Adobe Journey Optimizer (AJO) extension for Adobe Experience Platform Mobile SDKs powers push notifications for your mobile apps. This extension helps you collect user push tokens and manages interaction measurement with Adobe Experience Platform services.
The following documentation details configuration requirements and explains how to use the AJO extension. It also includes steps for implementing AJO-powered push notifications in your app.
- Read the tutorial on getting started with push configuration to learn how to configure push channels in Journey Optimizer.
- Update your app's datastream in Adobe Experience Platform Data Collection
- Integrate with following extensions:
Navigate to a previously configured datastream by following the instructions in the configure datastreams tutorial in Adobe Experience Platform Data Collection.
- For Event Dataset, select CJM Push Tracking Experience Event Dataset
- For Profile Dataset, select CJM Push Profile Dataset
Save your changes when finished.
Go to the Experience Platform Data Collection UI, select mobile property and navigate to Extensions from the left navigation panel:
- Navigate to the Catalog tab, locate the Adobe Journey Optimizer extension, and select Install
- Select the pre-created CJM Push Tracking Event Dataset from the Event Dataset dropdown.
- Select Save.
- Follow the publishing process to update SDK configuration.
{% hint style="info" %} The datasets selected should use a schema that uses the "Push Notification Tracking" XDM field group. The pre-created CJM Push Tracking Dataset contains this XDM field group in its schema definition. For more information, please read the tutorial on setting up schemas and datasets. {% endhint %}
Follow these steps to integrate the Adobe Journey Optimizer extension.
{% tabs %}
{% tab title="Android" %}
-
Add the Mobile Core, Edge, Edge Identity, and Messaging extensions to your project using the app's Gradle file.
implementation 'com.adobe.marketing.mobile:core:1.+' implementation 'com.adobe.marketing.mobile:edge:1.+' implementation 'com.adobe.marketing.mobile:edgeidentity:1.+' implementation 'com.adobe.marketing.mobile:messaging:1.+'
-
Import the Mobile Core, Edge, Edge Identity, and Messaging extensions in your application class.
import com.adobe.marketing.mobile.*; import com.adobe.marketing.mobile.edge.identity.Identity;
{% endtab %}
{% tab title="iOS (AEP 3.x)" %}
-
Add the Mobile Core, Edge, Edge Identity, and Messaging extensions to your project using Cocoapods. Add the following pods to your
Podfile
:use_frameworks! target 'YourTargetApp' do pod 'AEPCore' pod 'AEPEdge' pod 'AEPEdgeIdentity' pod 'AEPMessaging' end
-
Import the Mobile Core, Edge, Edge Identity, and Messaging libraries:
// AppDelegate.swift import AEPCore import AEPEdge import AEPEdgeIdentity import AEPMessaging
// AppDelegate.h @import AEPCore; @import AEPEdge; @import AEPEdgeIdentity; @import AEPMessaging;
{% endtab %}
{% tab title="iOS (ACP 2.x)" %}
This extension is built on the AEPCore (3.x) and it is not compatible with ACPCore (2.x). Please follow the guide for migrating to the Swift AEPCore.
{% endtab %}
{% endtabs %}
{% tabs %}
{% tab title="Android" %}
public class MobileApp extends Application {
@Override
public void onCreate() {
super.onCreate();
MobileCore.setApplication(this);
MobileCore.configureWithAppID("YOUR_APP_ID");
try {
Edge.registerExtension();
Identity.registerExtension();
Messaging.registerExtension();
MobileCore.start(new AdobeCallback() {
@Override
public void call(final Object o) {
// processing after start
}
});
} catch (Exception e) {
// handle the exception
}
}
}
{% endtab %}
{% tab title="iOS (AEP 3.x)" %}
// AppDelegate.swift
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
MobileCore.registerExtensions([Identity.self, Edge.self, Messaging.self], {
MobileCore.configureWith(appId: "YOUR_APP_ID")
})
...
}
// AppDelegate.m
- (BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[AEPMobileCore registerExtensions:@[AEPMobileEdgeIdentity.class, AEPMobileEdge.class, AEPMobileMessaging.class] completion:^{
[AEPMobileCore configureWithAppId: @"YOUR_APP_ID"];
}];
...
}
{% endtab %}
{% tab title="iOS (ACP 2.x)" %}
This extension is built on the AEPCore (3.x) and it is not compatible with ACPCore (2.x). Please follow the guide for migrating to the Swift AEPCore.
{% endtab %}
{% endtabs %}
After importing and registering the extensions with your application, you need to sync the push token with Adobe Experience Platform, by using the setPushIdentifier
API.
{% tabs %}
{% tab title="Android" %}
To retrieve the push token from Firebase Messaging Service, read the tutorial on retrieving the registration token within the Firebase documentation. After retrieving the push token, use the following API to sync it with the Profile in Platform.
Syntax
public static void setPushIdentifier(final String pushIdentifier);
Variable | Type | Description |
---|---|---|
pushIdentifier |
String | The push token value. |
Example
FirebaseMessaging.getInstance().getToken().addOnCompleteListener(new OnCompleteListener<String>() {
@Override
public void onComplete(@NonNull Task<String> task) {
if (task.isSuccessful()) {
String token = task.getResult();
MobileCore.setPushIdentifier(token);
}
}
});
{% endtab %}
{% tab title="iOS (AEP 3.x)" %}
To retrieve the push token in iOS, read the tutorial on registering your application within Apple's documentation. After retrieving the push token, use the following API to sync it with the Profile in Platform.
Syntax
public static func setPushIdentifier(_ deviceToken: Data?)
Variable | Type | Description |
---|---|---|
deviceToken |
Data | The push token value. |
Example
func application(_: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
MobileCore.setPushIdentifier(deviceToken)
}
Syntax
@objc(setPushIdentifier:)
public static func setPushIdentifier(_ deviceToken: Data?)
Variable | Type | Description |
---|---|---|
deviceToken |
Data | The push token value. |
Example
- (void) application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
[AEPMobileCore setPushIdentifier:deviceToken];
}
{% endtab %}
{% tab title="iOS (ACP 2.x)" %}
This extension is built on the AEPCore (3.x) and it is not compatible with ACPCore (2.x). Please follow the guide for migrating to the Swift AEPCore.
{% endtab %}
{% endtabs %}
You can update the SDK configuration, including the Messaging configuration values, programmatically by using the following information:
Key | Required | Description | Data Type | Operating System |
---|---|---|---|---|
messaging.eventDataset | Yes | Experience Event Dataset ID which can be found from Experience Platform | String | Android/iOS |
messaging.useSandbox | No | A variable that lets the apnsSandbox environment be used for receiving push notifications. More details can be found in the messaging documentation |
Boolean | iOS |