Java
- Add the library to your project.
- Import the library.
Copied to your clipboardimport com.adobe.marketing.mobile.*;
Audience Manager depends on the Identity extension and is automatically included in the Core pod. When manually installing the Audience Manager extension, ensure that you add the identity-1.x.x.aar
library to your project.
- Add the library to your project via your
Podfile
by addingpod 'ACPAudience'
- Import the Audience and Identity library, using the respective language.
Please note that the Audience Manager extension depends on the Identity extension, which is automatically included in the Core pod. If you are installing the Audience Manager extension manually, ensure you add the libACPIdentity_iOS.a
library to your project.
Swift
Copied to your clipboardimport ACPCoreimport ACPAudience
Objective-C
Copied to your clipboard#import "ACPCore.h"#import "ACPAudience.h"#import "ACPIdentity.h"
JavaScript
- Install Audience Manager in your project.
Copied to your clipboardnpm install @adobe/react-native-acpaudiencereact-native link @adobe/react-native-acpaudience
- Import the extension.
Copied to your clipboardimport {ACPAudience} from '@adobe/react-native-acpaudience';
- Ensure the extension version is correct.
Copied to your clipboardACPAudience.extensionVersion().then(version => console.log("AdobeExperienceSDK: ACPAudience version: " + version));
Java
Call the setApplication()
method once in the onCreate()
method of your main activity.
For example, your code might look like the following:
Copied to your clipboardpublic class AudiencetApp extends Application {@Overridepublic void onCreate() {super.onCreate();MobileCore.setApplication(this);try {Audience.registerExtension(); //Register Audience Manager with Mobile CoreIdentity.registerExtension();MobileCore.start(null);} catch (Exception e) {//Log the exception}}}
Swift
In your app's _:didFinishLaunchingWithOptions
function, register the Audience Manager extension with the Mobile Core:
Copied to your clipboardfunc application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {ACPIdentity.registerExtension()ACPAudience.registerExtension()ACPCore.start(nil)// Override point for customization after application launch.return true;}
Objective-C
In your app's application:didFinishLaunchingWithOptions
function, register the Audience Manager extension with the Mobile Core:
Copied to your clipboard- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {[ACPIdentity registerExtension];[ACPAudience registerExtension];[ACPCore start:nil]// Override point for customization after application launch.return YES;}
JavaScript
Copied to your clipboardimport {ACPAudience} from '@adobe/react-native-acpcore';initSDK() {ACPAudience.registerExtension();}