SDK Setup

Beta instructions

While the in-app messaging feature is in beta, the developer will need to use the Messaging extension on the staging branch of this repo.
iOS (cocoapods)
Android (gradle)
The example below shows how to point to the staging branch in a Cocoapods Podfile:
1
pod 'AEPMessaging', :git => 'https://github.com/adobe/aepsdk-messaging-ios.git', :branch => 'staging'
2
pod 'AEPOptimize', :git => 'https://github.com/adobe/aepsdk-optimize-ios.git', :branch => 'staging'
Copied!
In-app messages are enabled in Messaging SDK version 1.2.0 or newer. Libraries built from the staging branch will contain beta in the artifact name.
The Messaging SDK is available from the Sonatype snapshot repository while it is in beta. In your app's top level Gradle file, add a reference to the repository:
1
allprojects {
2
repositories {
3
// other needed repositories...
4
// add the sonatype snapshot repository
5
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
6
}
7
}
Copied!
The Messaging extension has a dependency on the Optimize extension. The Optimize extension must be added as a dependency in the app level Gradle file.
1
implementation('com.adobe.marketing.mobile:messaging:1.2.0-beta-1-SNAPSHOT')
2
implementation('com.adobe.marketing.mobile:optimize:1.0.0-SNAPSHOT')
Copied!
If you use the Messaging extension (In-App beta) alongside the Campaign Standard extension, Campaign Standard extension version 1.0.9 or newer must be used to resolve a compatibility issue:
1
implementation 'com.adobe.marketing.mobile:campaign:[1.0.9,)'
Copied!

Import and register the Messaging extension

Import the AEPMessaging framework and its dependencies, then register the Messaging extension and dependencies.
iOS
Android
In the application(_: didFinishLaunchingWithOptions:) method in the AppDelegate:
Swift
1
import AEPMessaging
2
import AEPCore
3
import AEPEdge
4
import AEPEdgeIdentity
5
import AEPOptimize
6
7
class AppDelegate: UIResponder, UIApplicationDelegate {
8
func application(_ application: UIApplication, didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
9
// optionally enable trace logging
10
MobileCore.setLogLevel(.trace)
11
12
// create a list of extensions that will be registered
13
let extensions = [
14
Messaging.self,
15
AEPEdgeIdentity.Identity.self,
16
Edge.self,
17
Optimize.self
18
]
19
20
MobileCore.registerExtensions(extensions) {
21
// use the App ID assigned for this application from Adobe Data Collection (formerly Adobe Launch)
22
MobileCore.configureWith(appId: "MY_APP_ID")
23
}
24
25
return true
26
}
27
}
Copied!
Java
1
import android.app.Application;
2
3
import com.adobe.marketing.mobile.AdobeCallback;
4
import com.adobe.marketing.mobile.Edge;
5
import com.adobe.marketing.mobile.LoggingMode;
6
import com.adobe.marketing.mobile.Messaging;
7
import com.adobe.marketing.mobile.MobileCore;
8
import com.adobe.marketing.mobile.edge.identity.Identity;
9
import com.adobe.marketing.mobile.optimize.Optimize;
10
11
public class MainApplication extends Application {
12
13
@Override
14
public void onCreate() {
15
super.onCreate();
16
17
MobileCore.setApplication(this);
18
MobileCore.setLogLevel(LoggingMode.VERBOSE);
19
20
try {
21
Messaging.registerExtension();
22
Optimize.registerExtension();
23
Identity.registerExtension();
24
Edge.registerExtension();
25
26
MobileCore.start(new AdobeCallback() {
27
@Override
28
public void call(Object o) {
29
MobileCore.configureWithAppID("MY_APP_ID");
30
}
31
});
32
} catch (Exception e) {
33
//Log the exception
34
}
35
}
36
}
Copied!
Export as PDF
Copy link
Edit on GitHub