To return the current version of the Campaign extension, use the following APIs:
{% tabs %} {% tab title="Android" %}
public String extensionVersion()
Campaign.extensionVersion();
{% endtab %}
{% tab title="iOS" %}
+ (nonnull NSString*) extensionVersion;
NSLog(@"ACPCampaign version: %@", [ACPCampaign extensionVersion]);
print("ACPCampaign version: ", ACPCampaign.extensionVersion())
{% endtab %}
{% tab title="React Native" %}
extensionVersion(): Promise<string>
ACPCampaign.extensionVersion().then(version => console.log("AdobeExperienceSDK: ACPCampaign version: " + version));
{% endtab %} {% endtabs %}
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.
{% tabs %} {% tab title="Android" %}
public static void resetLinkageFields()
Campaign.resetLinkageFields()
{% endtab %}
{% tab title="iOS" %}
+ (void) resetLinkageFields;
[ACPCampaign resetLinkageFields];
ACPCampaign.resetLinkageFields()
{% endtab %}
{% tab title="React Native" %}
resetLinkageFields();
ACPCampaign.resetLinkageFields();
{% endtab %} {% endtabs %}
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 about setting up linkage fields in Campaign, see Extending the subscriptions to an application resource.
{% tabs %} {% tab title="Android" %}
public static void setLinkageFields(final Map<String, String> linkageFields)
- linkageFields is a map that contains the linkage field key-value pairs.
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" %}
+ (void) setLinkageFields: (nonnull NSDictionary<NSString*, NSString*>*) linkageFields;
- linkageFields is a dictionary that contains the linkage field key-value pairs.
[ACPCampaign setLinkageFields:@{@"cusFirstName" : @"John", @"cusLastName": @"Doe", @"cusEmail": @"[email protected]"}];
var linkageFields = [String: String]()
linkageFields["cusFirstName"] = "John"
linkageFields["cusLastName"] = "Doe"
linkageFields["cusEmail"] = "[email protected]"
ACPCampaign.setLinkageFields(linkageFields)
{% endtab %}
{% tab title="React Native" %}
setLinkageFields(linkageFields: { string: string })
- linkageFields is a map that contains the linkage field key-value pairs.
ACPCampaign.setLinkageFields({"firstName": "John"});
{% endtab %} {% endtabs %}