Returns the running version of the Campaign Standard extension.
{% tabs %} {% tab title="Android" %}
Syntax
public String extensionVersion()
Example
Campaign.extensionVersion();
{% endtab %}
{% tab title="iOS (AEP 3.x)" %}
Syntax
static var extensionVersion: String
Example
let campaignVersion = Campaign.extensionVersion
Syntax
+ (NSString * _Nonnull)extensionVersion
Example
NSString *campaignVersion = [AEPMobileCampaign extensionVersion];
{% endtab %}
{% tab title="iOS (ACP 1.x)" %}
Syntax
+ (nonnull NSString*) extensionVersion;
Example
let campaignVersion = ACPCampaign.extensionVersion()
Syntax
+ (NSString * _Nonnull)extensionVersion
Example
NSString *campaignVersion = [ACPCampaign extensionVersion];
{% endtab %}
{% tab title="React Native" %}
Syntax
extensionVersion(): Promise<string>
Example
ACPCampaign.extensionVersion().then(version => console.log("AdobeExperienceSDK: ACPCampaign version: " + version));
{% endtab %} {% endtabs %}
Registers the Campaign Standard extension with the Mobile Core.
{% tabs %} {% tab title="Android" %}
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)" %}
Syntax
+ (void) registerExtension
Example
ACPCampaign.registerExtension()
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 %}
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" %}
Syntax
public static void resetLinkageFields()
Example
Campaign.resetLinkageFields()
{% endtab %}
{% tab title="iOS (AEP 3.x)" %}
Syntax
static func resetLinkageFields()
Example
Campaign.resetLinkageFields()
Syntax
+ (void) resetLinkageFields
Example
[AEPMobileCampaign resetLinkageFields];
{% endtab %}
{% tab title="iOS (ACP 1.x)" %}
Syntax
+ (void) resetLinkageFields
Example
ACPCampaign.resetLinkageFields()
Syntax
+ (void) resetLinkageFields
Example
[ACPCampaign resetLinkageFields];
{% endtab %}
{% tab title="React Native" %}
Syntax
resetLinkageFields()
Example
ACPCampaign.resetLinkageFields();
{% endtab %} {% endtabs %}
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" %}
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)" %}
Syntax
static func setLinkageFields(_ linkageFields: [String: String])
Example
Campaign.setLinkageFields(linkageFields: ["cusFirstName": "John", "cusLastName": "Doe", "cusEmail": "[email protected]"])
Syntax
+ (void) setLinkageFields:(NSDictionary<NSString *,NSString *> * _Nonnull)
Example
[AEPMobileCampaign setLinkageFields:@{@"cusFirstName" : @"John", @"cusLastName": @"Doe", @"cusEmail": @"[email protected]"}];
{% endtab %}
{% tab title="iOS (ACP 1.x)" %}
Syntax
+ (void) setLinkageFields: (nonnull NSDictionary<NSString*, NSString*>*) linkageFields
Example
ACPCampaign.setLinkageFields(["cusFirstName": "John", "cusLastName": "Doe", "cusEmail": "[email protected]"])
Syntax
+ (void) setLinkageFields: (NSDictionary<NSString*, NSString*>*) linkageFields
Example
[ACPCampaign setLinkageFields:@{@"cusFirstName" : @"John", @"cusLastName": @"Doe", @"cusEmail": @"[email protected]"}];
{% endtab %}
{% tab title="React Native" %}
Syntax
setLinkageFields(linkageFields: { string: string })
Example
ACPCampaign.setLinkageFields({"firstName": "John"});
{% endtab %} {% endtabs %}