The Adobe Journey Optimizer extension for Adobe Experience Platform Mobile SDKs powers push notifications for your mobile apps. This extension helps you collects user push tokens and manages interaction measurement with Adobe Experience Platform services.
The following documentation details how to use the extension as well as the required configuration across Adobe Experience Platform services, app stores, and your apps to get started with push notifications for Adobe Journey Optimizer.
- Follow the steps in this page to configure push channel in Adobe 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 Configure datastreams in Adobe Experience Platform Data Collection, then:
Select the pre-created CJM Push Profile Dataset in Profile Dataset dropdown (under Adobe Experience Platform section) and select Save.
Navigate to Experience Platform Data Collection - 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.
- Click 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, see Set up schemas and datasets. {% endhint %}
Follow these steps to integrate the Adobe Journey Optimizer extension.
{% tabs %} {% tab title="Android" %}
-
Add the Mobile Core, Edge, EdgeIdentity 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, EdgeIdentity and Messaging extensions in your application class.
import com.adobe.marketing.mobile.*; import com.adobe.marketing.mobile.edge.identity.Identity;
{% endtab %}
{% tab title="iOS" %}
-
Add the Mobile Core, Edge, EdgeIdentity and Messaging extensions to your project using Cocoapods. Add following pods in your
Podfile:use_frameworks! target 'YourTargetApp' do pod 'AEPCore' pod 'AEPEdge' pod 'AEPEdgeIdentity' pod 'AEPMessaging' end -
Import the Mobile Core, Edge, EdgeIdentity and Messaging libraries:
// AppDelegate.swift
import AEPCore
import AEPEdge
import AEPEdgeIdentity
import AEPMessaging// AppDelegate.h
@import AEPCore;
@import AEPEdge;
@import AEPEdgeIdentity;
@import AEPMessaging;
{% endtab %} {% endtabs %}
{% tabs %} {% tab title="Android" %}
public class MobileApp extends Application {
@Override
public void onCreate() {
super.onCreate();
MobileCore.setApplication(this);
MobileCore.configureWithAppID("yourLaunchEnvironmentID");
try {
Edge.registerExtension();
Identity.registerExtension();
Messaging.registerExtension(); // register Messaging
MobileCore.start(new AdobeCallback() {
@Override
public void call(final Object o) {
// processing after start
}});
} catch (Exception e) {
//Log the exception
}
}
}{% endtab %}
{% tab title="iOS" %}
// AppDelegate.swift
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
MobileCore.registerExtensions([Identity.self, Edge.self, Messaging.self], {
MobileCore.configureWith(appId: "yourLaunchEnvironmentID")
})
...
}// AppDelegate.m
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[AEPMobileCore registerExtensions:@[AEPMobileEdgeIdentity.class, AEPMobileEdge.class, AEPMobileMessaging.class] completion:^{
[AEPMobileCore configureWithAppId: @"yourLaunchEnvironmentID"];
}];
...
}
{% endtab %} {% endtabs %}
Use the setPushIdentifier API to sync user push token from the device with Adobe Experience Platform services.
{% tabs %} {% tab title="Android" %} To retrieve the push token from Firebase Messaging Service follow this Firebase documentation. After retrieving the push token use the below core API to sync it with profile in platform.
public static void setPushIdentifier(final String pushIdentifier);- pushIdentifier - A
Stringvalue denoting the push token.
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" %}
To retrieve the push token in iOS, checkout the apple documentation Apple's documentation.
After retrieving the push token use the below core API to sync it with profile in platform.
public static func setPushIdentifier(_ deviceToken: Data?)- deviceToken - A
Datavalue denoting the push token.
func application(_: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
MobileCore.setPushIdentifier(deviceToken)
}public static func setPushIdentifier(_ deviceToken: Data?)
- deviceToken - A
Datavalue denoting the push token.
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
[AEPMobileCore setPushIdentifier:deviceToken];
}
{% endtab %} {% endtabs %}
To update the SDK configuration programmatically, use the following information to change the Messaging configuration values.
| Key | Required | Description | Data Type | Platform |
|---|---|---|---|---|
| messaging.eventDataset | Yes | Experience Event Dataset Id which can be found from experience platform | String | Android/iOS |
| messaging.useSandbox | No | See more details in the Messaging documentation | Boolean | iOS |

