Adobe Campaign Standard API reference

extensionVersion

Returns the running version of the Campaign Standard extension.
Android
iOS (AEP 3.x)
iOS (ACP 1.x)
React Native

Java

Syntax
1
public String extensionVersion()
Copied!
Example
1
Campaign.extensionVersion();
Copied!

Swift

Syntax
1
static var extensionVersion: String
Copied!
Example
1
let campaignVersion = Campaign.extensionVersion
Copied!

Objective-C

Syntax
1
+ (NSString * _Nonnull)extensionVersion
Copied!
Example
1
NSString *campaignVersion = [AEPMobileCampaign extensionVersion];
Copied!

Swift

Syntax
1
+ (nonnull NSString*) extensionVersion;
Copied!
Example
1
let campaignVersion = ACPCampaign.extensionVersion()
Copied!

Objective-C

Syntax
1
+ (NSString * _Nonnull)extensionVersion
Copied!
Example
1
NSString *campaignVersion = [ACPCampaign extensionVersion];
Copied!

JavaScript

Syntax
1
extensionVersion(): Promise<string>
Copied!
Example
1
ACPCampaign.extensionVersion().then(version => console.log("AdobeExperienceSDK: ACPCampaign version: " + version));
Copied!

registerExtension

Registers the Campaign Standard extension with the Mobile Core.
Android
iOS (AEP 3.x)
iOS (ACP 1.x)
React Native

Java

Syntax
1
public static void registerExtension()
Copied!
Example
1
Campaign.registerExtension();
Copied!
This API no longer exists in the AEP 3.x Adobe Campaign Standard extension. Instead, the extension should be registered by calling the registerExtensions API in the MobileCore. Please see the updated SDK initialization steps at the migrate to Swift tutorial.

Swift

Syntax
1
+ (void) registerExtension
Copied!
Example
1
ACPCampaign.registerExtension()
Copied!

Objective-C

Syntax
1
+ (void) registerExtension
Copied!
Example
1
[ACPCampaign registerExtension];
Copied!
When using React Native, register the Adobe Campaign Standard extension with Mobile Core in native code as shown on the Android and iOS tabs.

resetLinkageFields

Clears previously stored linkage fields in the mobile SDK and triggers a Campaign rules download request to the configured Campaign server.
This method unregisters any previously registered rules with the Rules Engine and clears cached rules from the most recent rules download.
Android
iOS (AEP 3.x)
iOS (ACP 1.x)
React Native

Java

Syntax
1
public static void resetLinkageFields()
Copied!
Example
1
Campaign.resetLinkageFields()
Copied!

Swift

Syntax
1
static func resetLinkageFields()
Copied!
Example
1
Campaign.resetLinkageFields()
Copied!

Objective-C

Syntax
1
+ (void) resetLinkageFields
Copied!
Example
1
[AEPMobileCampaign resetLinkageFields];
Copied!

Swift

Syntax
1
+ (void) resetLinkageFields
Copied!
Example
1
ACPCampaign.resetLinkageFields()
Copied!

Objective-C

Syntax
1
+ (void) resetLinkageFields
Copied!
Example
1
[ACPCampaign resetLinkageFields];
Copied!

JavaScript

Syntax
1
resetLinkageFields()
Copied!
Example
1
ACPCampaign.resetLinkageFields();
Copied!

setLinkageFields

Sets the Campaign linkage fields (CRM IDs) in the mobile SDK to be used for downloading personalized messages from Campaign.
The set linkage fields are stored as a base64 encoded JSON string in memory and they are sent in a custom HTTP header X-InApp-Auth.
Android
iOS (AEP 3.x)
iOS (ACP 1.x)
React Native

Java

Syntax
1
public static void setLinkageFields(final Map<String, String> linkageFields)
Copied!
Example
1
HashMap<String, String> linkageFields = new HashMap<String, String>();
2
linkageFields.put("cusFirstName", "John");
3
linkageFields.put("cusLastName", "Doe");
4
linkageFields.put("cusEmail", "[email protected]");
5
Campaign.setLinkageFields(linkageFields);
Copied!

Swift

Syntax
1
static func setLinkageFields(_ linkageFields: [String: String])
Copied!
Example
1
Campaign.setLinkageFields(linkageFields: ["cusFirstName": "John", "cusLastName": "Doe", "cusEmail": "[email protected]"])
Copied!

Objective-C

Syntax
1
+ (void) setLinkageFields:(NSDictionary<NSString *,NSString *> * _Nonnull)
Copied!
Example
1
[AEPMobileCampaign setLinkageFields:@{@"cusFirstName" : @"John", @"cusLastName": @"Doe", @"cusEmail": @"[email protected]"}];
Copied!

Swift

Syntax
1
+ (void) setLinkageFields: (nonnull NSDictionary<NSString*, NSString*>*) linkageFields
Copied!
Example
1
ACPCampaign.setLinkageFields(["cusFirstName": "John", "cusLastName": "Doe", "cusEmail": "[email protected]"])
Copied!

Objective-C

Syntax
1
+ (void) setLinkageFields: (NSDictionary<NSString*, NSString*>*) linkageFields
Copied!
Example
1
[ACPCampaign setLinkageFields:@{@"cusFirstName" : @"John", @"cusLastName": @"Doe", @"cusEmail": @"[email protected]"}];
Copied!

JavaScript

Syntax
1
setLinkageFields(linkageFields: { string: string })
Copied!
Example
1
ACPCampaign.setLinkageFields({"firstName": "John"});
Copied!