To return the current version of the Campaign extension, use the following APIs:
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.
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.
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);
+ (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)