Skip to content

Latest commit

 

History

History
367 lines (246 loc) · 5.81 KB

adobe-campaign-standard-api-reference.md

File metadata and controls

367 lines (246 loc) · 5.81 KB

Adobe Campaign Standard API reference

extensionVersion

Returns the running version of the Campaign Standard extension.

{% tabs %} {% tab title="Android" %}

Java

Syntax

public String extensionVersion()

Example

Campaign.extensionVersion();

{% endtab %}

{% tab title="iOS (AEP 3.x)" %}

Swift

Syntax

static var extensionVersion: String

Example

let campaignVersion = Campaign.extensionVersion

Objective-C

Syntax

+ (NSString * _Nonnull)extensionVersion

Example

NSString *campaignVersion = [AEPMobileCampaign extensionVersion];

{% endtab %}

{% tab title="iOS (ACP 1.x)" %}

Swift

Syntax

+ (nonnull NSString*) extensionVersion;

Example

let campaignVersion = ACPCampaign.extensionVersion()

Objective-C

Syntax

+ (NSString * _Nonnull)extensionVersion

Example

NSString *campaignVersion = [ACPCampaign extensionVersion];

{% endtab %}

{% tab title="React Native" %}

JavaScript

Syntax

extensionVersion(): Promise<string>

Example

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

{% endtab %} {% endtabs %}

registerExtension

Registers the Campaign Standard extension with the Mobile Core.

{% tabs %} {% tab title="Android" %}

Java

Syntax

public static void registerExtension()

Example

Campaign.registerExtension();

{% endtab %}

{% tab title="iOS (AEP 3.x)" %}

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.

{% endtab %}

{% tab title="iOS (ACP 1.x)" %}

Swift

Syntax

+ (void) registerExtension

Example

ACPCampaign.registerExtension()

Objective-C

Syntax

+ (void) registerExtension

Example

[ACPCampaign registerExtension];

{% endtab %}

{% tab title="React Native" %} When using React Native, register the Adobe Campaign Standard extension with Mobile Core in native code as shown on the Android and iOS tabs. {% endtab %} {% endtabs %}

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.

{% tabs %} {% tab title="Android" %}

Java

Syntax

public static void resetLinkageFields()

Example

Campaign.resetLinkageFields()

{% endtab %}

{% tab title="iOS (AEP 3.x)" %}

Swift

Syntax

static func resetLinkageFields()

Example

Campaign.resetLinkageFields()

Objective-C

Syntax

+ (void) resetLinkageFields

Example

[AEPMobileCampaign resetLinkageFields];

{% endtab %}

{% tab title="iOS (ACP 1.x)" %}

Swift

Syntax

+ (void) resetLinkageFields

Example

ACPCampaign.resetLinkageFields()

Objective-C

Syntax

+ (void) resetLinkageFields

Example

[ACPCampaign resetLinkageFields];

{% endtab %}

{% tab title="React Native" %}

JavaScript

Syntax

resetLinkageFields()

Example

ACPCampaign.resetLinkageFields();

{% endtab %} {% endtabs %}

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.

{% tabs %} {% tab title="Android" %}

Java

Syntax

public static void setLinkageFields(final Map<String, String> linkageFields)

Example

HashMap<String, String> linkageFields = new HashMap<String, String>();
linkageFields.put("cusFirstName", "John");
linkageFields.put("cusLastName", "Doe");
linkageFields.put("cusEmail", "[email protected]");
Campaign.setLinkageFields(linkageFields);

{% endtab %}

{% tab title="iOS (AEP 3.x)" %}

Swift

Syntax

static func setLinkageFields(_ linkageFields: [String: String])

Example

Campaign.setLinkageFields(linkageFields: ["cusFirstName": "John", "cusLastName": "Doe", "cusEmail": "[email protected]"])

Objective-C

Syntax

+ (void) setLinkageFields:(NSDictionary<NSString *,NSString *> * _Nonnull)

Example

[AEPMobileCampaign setLinkageFields:@{@"cusFirstName" : @"John", @"cusLastName": @"Doe", @"cusEmail": @"[email protected]"}];

{% endtab %}

{% tab title="iOS (ACP 1.x)" %}

Swift

Syntax

+ (void) setLinkageFields: (nonnull NSDictionary<NSString*, NSString*>*) linkageFields

Example

ACPCampaign.setLinkageFields(["cusFirstName": "John", "cusLastName": "Doe", "cusEmail": "[email protected]"])

Objective-C

Syntax

+ (void) setLinkageFields: (NSDictionary<NSString*, NSString*>*) linkageFields

Example

[ACPCampaign setLinkageFields:@{@"cusFirstName" : @"John", @"cusLastName": @"Doe", @"cusEmail": @"[email protected]"}];

{% endtab %}

{% tab title="React Native" %}

JavaScript

Syntax

setLinkageFields(linkageFields: { string: string })

Example

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

{% endtab %} {% endtabs %}