Edit in GitHubLog an issue

Java

  1. Add the library to your project.
  2. Import the library.
Copied to your clipboard
import 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.

  1. Add the library to your project via your Podfile by adding pod 'ACPAudience'
  2. 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 clipboard
import ACPCore
import ACPAudience

Objective-C

Copied to your clipboard
#import "ACPCore.h"
#import "ACPAudience.h"
#import "ACPIdentity.h"

JavaScript

  1. Install Audience Manager in your project.
Copied to your clipboard
npm install @adobe/react-native-acpaudience
react-native link @adobe/react-native-acpaudience
  1. Import the extension.
Copied to your clipboard
import {ACPAudience} from '@adobe/react-native-acpaudience';
  1. Ensure the extension version is correct.
Copied to your clipboard
ACPAudience.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 clipboard
public class AudiencetApp extends Application {
@Override
public void onCreate() {
super.onCreate();
MobileCore.setApplication(this);
try {
Audience.registerExtension(); //Register Audience Manager with Mobile Core
Identity.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 clipboard
func 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 clipboard
import {ACPAudience} from '@adobe/react-native-acpcore';
initSDK() {
ACPAudience.registerExtension();
}
Was this helpful?
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.