Adobe Campaign Standard API reference

extensionVersion

To return the current version of the Campaign extension, use the following APIs:

Android
iOS
React Native
Android

Java

Syntax

public String extensionVersion()

Example

Campaign.extensionVersion();
iOS

Syntax

+ (nonnull NSString*) extensionVersion;

Objective-C

Example

NSLog(@"ACPCampaign version: %@", [ACPCampaign extensionVersion]);

Swift

Example

print("ACPCampaign version: ", ACPCampaign.extensionVersion())
React Native

JavaScript

Syntax

extensionVersion(): Promise<string>

Example

ACPCampaign.extensionVersion().then(version => console.log("AdobeExperienceSDK: ACPCampaign version: " + version));

resetLinkageFields

This method clears the cached rules from the previous download before triggering a rule download request to the configured Campaign server. If the current SDK privacy status is not OPT_IN, no rules download occurs.

Android
iOS
React Native
Android

Java

Syntax

public static void resetLinkageFields()

Example

Campaign.resetLinkageFields()
iOS

Syntax

+ (void) resetLinkageFields;

Objective-C

Example

[ACPCampaign resetLinkageFields];

Swift

ACPCampaign.resetLinkageFields()
React Native

JavaScript

Syntax

resetLinkageFields();

Example

ACPCampaign.resetLinkageFields();

setLinkageFields

This API sets the Campaign linkage fields (CRM IDs) in the Mobile SDK that are used to download 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 in all future Campaign rules download requests until resetLinkageFields is invoked. These in-memory variables are lost in the following scenarios:

  • When an application crash event occurs.

  • After a graceful termination of the application.

  • When the privacy status is updated to OPT_OUT. For more information, see Set and Get Privacy Status

For more information on setting up linkage fields in Campaign, see Extending the subscriptions to an application resource.

Android
iOS
React Native
Android

Java

Syntax

public static void setLinkageFields(final Map<String, String> linkageFields)
  • linkageFields is a map that contains the linkage field key-value pairs.

Example

HashMap<String, String> linkageFields = new HashMap<String, String>();
linkageFields.put("cusFirstName", "John");
linkageFields.put("cusLastName", "Doe");
linkageFields.put("cusEmail", "john.doe@email.com");
Campaign.setLinkageFields(linkageFields);
iOS

Syntax

+ (void) setLinkageFields: (nonnull NSDictionary<NSString*, NSString*>*) linkageFields;
  • linkageFields is a dictionary that contains the linkage field key-value pairs.

Example

Objective-C

[ACPCampaign setLinkageFields:@{@"cusFirstName" : @"John", @"cusLastName": @"Doe", @"cusEmail": @"john.doe@email.com"}];

Swift

var linkageFields = [String: String]()
linkageFields["cusFirstName"] = "John"
linkageFields["cusLastName"] = "Doe"
linkageFields["cusEmail"] = "john.doe@email.com"
ACPCampaign.setLinkageFields(linkageFields)
React Native

JavaScript

Syntax

setLinkageFields(linkageFields: { string: string })
  • linkageFields is a map that contains the linkage field key-value pairs.

Example

ACPCampaign.setLinkageFields({"firstName": "John"});