Skip to content

Latest commit

 

History

History
164 lines (116 loc) · 3.34 KB

adobe-campaign-standard-api-reference.md

File metadata and controls

164 lines (116 loc) · 3.34 KB

Adobe Campaign Standard API reference

Get extension version

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

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

Java

Example

Campaign.getExtensionVersion();

{% endtab %}

{% tab title="iOS" %}

Objective-C

Syntax

+ (nonnull NSString*) extensionVersion;

Example

NSLog([ACPCore extensionVersion]);

Swift

Syntax

class func extensionVersion() -> String {}

Example

print(ACPCore.extensionVersion());

{% endtab %}

{% tab title="React Native" %}

JavaScript

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

{% endtab %} {% endtabs %}

Set linkage fields

Allows Campaign to connect fields from separate databases and create a more developed and personalized messaging experience. Profile template-based messages that contain PII-based personalization are downloaded. The linkage fields are stored as a base64-encoded JSON string in memory and sent in a custom HTTP header, X-InApp-Auth, in all future Campaign rules download requests until ACPCampaign::resetLinkageFields is invoked. The linkage fields are cleared when the app is gracefully closed, crashed, or the privacy status is changed to opt out. For more information, see Preparing and sending an In-App message.

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

Syntax

public 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" %}

Syntax

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

Objective-C

Example

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

Swift

var linkageFields = [String: String]()
linkageFields["cusFirstName"] = "John"
linkageFields["cusLastName"] = "Doe"
linkageFields["cusEmail"] = "[email protected]"
ACPCampaign.setLinkageFields(linkageFields)

{% endtab %}

{% tab title="React Native" %}

JavaScript

ACPCampaign.setLinkageFields({"linkageKey": "linkageValue"});

{% endtab %} {% endtabs %}

Reset linkage fields

Removes the previously stored linkage fields in the SDK and triggers the Campaign rules download again. Personalized messages stored in cache before are erased.

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

Syntax

public void resetLinkageFields()

Example

Campaign.resetLinkageFields()

{% endtab %}

{% tab title="iOS" %}

Syntax

+ (void) resetLinkageFields;

Objective-C

Example

[ACPCampaign resetLinkageFields];

Swift

ACPCampaign.resetLinkageFields();

{% endtab %}

{% tab title="React Native" %}

JavaScript

ACPCampaign.resetLinkageFields();

{% endtab %} {% endtabs %}