Edit in GitHubLog an issue

Java

  1. Add the Campaign Classic extension to your project using the app's Gradle file.
Copied to your clipboard
implementation 'com.adobe.marketing.mobile:campaignclassic:1.+'

or you can manually include the binaries found in the acp-sdks repo on GitHub.

  1. Import the Campaign Classic and Lifecycle extensions in your application's main activity.
Copied to your clipboard
import com.adobe.marketing.mobile.CampaignClassic;
import com.adobe.marketing.mobile.Lifecycle;
  1. Add the Campaign Classic and Mobile Core libraries to your project.

You can manually include the Mobile Core and Campaign Classic libraries found in Github or add the following pods to your Podfile:

Copied to your clipboard
pod 'ACPCampaignClassic'
pod 'ACPLifecycle'
pod 'ACPCore'
  1. In the Xcode project, import the Mobile Core and Campaign Classic extensions:

Objective-C

Copied to your clipboard
#import "ACPCore.h"
#import "ACPCampaignClassic.h"
#import "ACPLifecycle.h"

Swift

Copied to your clipboard
import ACPCore
import ACPCampaignClassic
import ACPLifecycle

In your app's OnCreate method, register the Campaign Classic and Lifecycle extensions:

Copied to your clipboard
public class CampaignClassicTestApp extends Application {
@Override
public void onCreate() {
super.onCreate();
MobileCore.setApplication(this);
MobileCore.setLogLevel(LoggingMode.VERBOSE);
try {
CampaignClassic.registerExtension();
Lifecycle.registerExtension();
MobileCore.start(null);
} catch (Exception e) {
Log.e("CampaignClassicTestApp", e.getMessage());
}
}
}

In your app's application:didFinishLaunchingWithOptions: method, register the Campaign Classic and Lifecycle extensions:

Swift

Copied to your clipboard
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
ACPCampaignClassic.registerExtension();
ACPLifecycle.registerExtension();
// Override point for customization after application launch.
return true;
}

Objective-C

Copied to your clipboard
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[ACPCampaignClassic registerExtension];
[ACPLifecycle registerExtension];
// Override point for customization after application launch.
return YES;
}
Was this helpful?
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.