Updates the specified customer ID with the Adobe Experience Cloud ID service.
This API synchronizes the provided customer identifier type key and value with the AuthenticationState to the Adobe Experience Cloud ID Service. If the specified customer ID type exists in the service, this ID type is updated with the new ID and authentication state. Otherwise, a new customer ID is added. This ID is preserved between app upgrades, is saved and restored during the standard application backup process, and is removed at uninstall. If the current SDK privacy status is optedout
, calling this method results in no operations being performed.
{% tabs %} {% tab title="Android" %}
public static void syncIdentifier(final String identifierType,
final String identifier,
final VisitorID.AuthenticationState authenticationState);
Identity.syncIdentifier("idType", "idValue", VisitorID.AuthenticationState.AUTHENTICATED);
Tip: The identifiers
map contains IDs with the Identifier type as the key, and the string identifier as the value.
public static void syncIdentifiers(final Map<String, String> identifiers,
final VisitorID.AuthenticationState authenticationState)
Map<String, String> identifiers = new HashMap<String, String>();
identifiers.put("idType", "idValue");
Identity.syncIdentifier(identifiers, VisitorID.AuthenticationState.AUTHENTICATED);
Tip: All given customer IDs are given the default authentication state of UNKNOWN
.
These IDs are preserved between app upgrades, are saved and restored during the standard application backup process, and are removed at uninstall. If the current SDK privacy status is optedout
, calling this method results in no operations being performed.
Tip: The identifiers
dictionary contains IDs with the Identifier type as the key, and the string identifier as the value.
public static void syncIdentifiers(final Map<String, String> identifiers);
Map<String, String> identifiers = new HashMap<String, String>();
identifiers.put("idType", "idValue");
Identity.syncIdentifier(identifiers);
{% endtab %}
{% tab title="iOS" %}
Updates the provided customer ID with the Adobe Experience Cloud ID Service.
This API synchronizes the provided customer identifier type key and value with the provided authentication state to the Adobe Experience Cloud ID Service. If this customer ID type exists in the service, this type is updated with the new ID and authentication state. Otherwise a new customer ID is added. This ID is preserved between app upgrades, is saved and restored during the standard application backup process, and is removed at uninstall. If the current SDK privacy status is optedout
, calling this method results in no operations being performed.
+ (void) syncIdentifier: (nonnull NSString*) identifierType
identifier: (nonnull NSString*) identifier
authentication: (ADBMobileVisitorAuthenticationState) authenticationState;
Objective-C
[ACPIdentity syncIdentifier:@"idType" identifier:@"idValue" authentication:ACPMobileVisitorAuthenticationStateUnknown];
Swift
ACPIdentity.syncIdentifier("idType", identifier: "idValue", authentication: ACPMobileVisitorAuthenticationState.unknown)
Updates the provided customer IDs with the Adobe Experience Cloud ID Service.
This API synchronizes the provided customer identifiers to the Adobe Experience Cloud ID Service. If a customer ID type matches an existing ID type, it is updated with the new ID value and authentication state. New customer IDs are added. These IDs are preserved between app upgrades, are saved and restored during the standard application backup process, and are removed at uninstall. If the current SDK privacy status is optedout
, calling this method results in no operations being performed.
Tip: The identifiers
dictionary contains IDs with the Identifier type as the key, and the string identifier as the value.
+ (void) syncIdentifiers: (nullable NSDictionary*) identifiers;
Objective-C
NSDictionary *ids = @{@"idType":@"idValue"};
[ACPIdentity syncIdentifiers:ids];
Swift
let identifiers : [String: String] = ["idType1":"idValue1", "idType2":"idValue2"];
ACPIdentity.syncIdentifiers(identifiers)
Updates the provided customer IDs with the Adobe Experience Cloud ID Service.
This API synchronizes the provided customer identifiers to the Adobe Experience Cloud ID Service. If a customer ID type matches an existing ID type, the customer ID is updated with the new ID value and authentication state. New customer IDs are added. These IDs are preserved between app upgrades, are saved and restored during the standard application backup process, and are removed at uninstall. If the current SDK privacy status is optedout
, calling this method results in no operations being performed.
Tip: The identifiers
dictionary contains IDs with the Identifier type as the key, and the string identifier as the value.
+ (void) syncIdentifiers: (nullable NSDictionary*) identifiers
authentication: (ACPMobileVisitorAuthenticationState) authenticationState;
Objective-C
NSDictionary *ids = @{@"idType":@"idValue"};
[ACPIdentity syncIdentifiers:ids authentication:ACPMobileVisitorAuthenticationStateAuthenticated];
Swift
let identifiers : [String: String] = ["idType1":"idValue1", "idType2":"idValue2"];ACPIdentity.syncIdentifiers(identifiers, authentication:
ACPMobileVisitorAuthenticationState.authenticated)
{% endtab %}
{% tab title="React Native" %}
Updates the provided customer ID with the Adobe Experience Cloud ID Service.
This API synchronizes the provided customer identifier type key and value with the provided authentication state to the Adobe Experience Cloud ID Service. If this customer ID type exists in the service, this type is updated with the new ID and authentication state. Otherwise a new customer ID is added. This ID is preserved between app upgrades, is saved and restored during the standard application backup process, and is removed at uninstall. If the current SDK privacy status is optedout
, calling this method results in no operations being performed.
ACPIdentity.syncIdentifier(identifierType, identifier, authenticationState);
ACPIdentity.syncIdentifiers({"id1": "identifier1"});
import {ACPMobileVisitorAuthenticationState} from '@adobe/react-native-acpcore';
ACPIdentity.syncIdentifiersWithAuthState({"id1": "identifier1"}, ACPMobileVisitorAuthenticationState.UNKNOWN);
Note: ACPMobileVisitorAuthenticationState
contains the following getters:
const AUTHENTICATED = "ACP_VISITOR_AUTH_STATE_AUTHENTICATED";
const LOGGED_OUT = "ACP_VISITOR_AUTH_STATE_LOGGED_OUT";
const UNKNOWN = "ACP_VISITOR_AUTH_STATE_UNKNOWN";
{% endtab %} {% endtabs %}
{% tabs %} {% tab title="Android" %}
Appends Adobe visitor data to a URL string. If the provided URL is null or empty, it is returned as is. Otherwise, the following information is added to the URL string that is returned in the AdobeCallback instance:
- The
adobe_mc
attribute is an URL encoded list that contains:MCMID
- Experience Cloud ID (ECID)MCORGID
- Experience Cloud Org IDMCAID
- Analytics Tracking ID (AID), if available from the Analytics extensionTS
- A timestamp taken when this request was made
- The optional
adobe_aa_vid
attribute is the URL-encoded Analytics Custom Visitor ID (VID), if previously set in the Analytics extension.
public static void appendVisitorInfoForURL(final String baseURL, final AdobeCallback<String> callback);
Identity.appendVisitorInfoForURL("http://myurl.com", new AdobeCallback<String>() {
@Override
public void call(String urlWithAdobeVisitorInfo) {
//handle the new URL here
//For example, open the URL on the device browser
//
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(urlWithAdobeVisitorInfo));
startActivity(i);
}
});
{% endtab %}
{% tab title="iOS" %}
Appends Adobe visitor data to a URL.
If the provided URL is nil or empty, it is returned as is. Otherwise, the following information is added to the url string that is returned via the callback:
- The adobe_mc attribute is an URL encoded list that contains:
MCMID
- Experience Cloud ID (ECID)MCORGID
- Experience Cloud Org IDMCAID
- Analytics Tracking ID (AID), if available from the Analytics extensionTS
- A timestamp taken when this request was made
- The optional
adobe_aa_vid
attribute is the URL-encoded Analytics Custom Visitor ID (VID), if previously set in the Analytics extension.
+ (void) appendToUrl: (nullable NSURL*) baseUrl withCallback: (nullable void (^) (NSURL* __nullable urlWithVisitorData)) callback;
Objective-C
NSURL* url = [[NSURL alloc] initWithString:@"www.myUrl.com"];
[ACPIdentity appendToUrl:url withCallback:^(NSURL * _Nullable urlWithVisitorData) {
// handle the appended url here}
}];
Swift
ACPIdentity.append(to:URL(string: "www.myUrl.com"), withCallback: {(appendedURL) in
// handle the appended url here
});
{% endtab %}
{% tab title="React Native" %}
Appends Adobe visitor information to the given URL.
If the given url is nil or empty, it is returned as is. Otherwise, the following information is added to the query section of the given URL. The attribute adobe_mc
is an URL encoded list containing the Experience Cloud ID, Experience Cloud Org ID, and a timestamp when this request was made. The attribute adobe_aa_vid
is the URL encoded Visitor ID, however the attribute is only included if the Visitor ID was previously set.
ACPIdentity.appendVisitorInfoForURL(baseURL);
{% endtab %} {% endtabs %}
{% tabs %} {% tab title="Android" %}
added in Identity v1.1.0
Retrieve Adobe visitor data as a URL query parameter string for consumption in hybrid mobile applications. There is no leading "?" or "&" punctuation, as the caller is responsible for placing the string in the correct location of their resulting URL. The following information is added to the string that is returned in the AdobeCallback instance:
- The
adobe_mc
attribute is an URL encoded list that contains:MCMID
- Experience Cloud ID (ECID)MCORGID
- Experience Cloud Org IDMCAID
- Analytics Tracking ID (AID), if available from the Analytics extensionTS
- A timestamp taken when this request was made
- The optional
adobe_aa_vid
attribute is the URL-encoded Analytics Custom Visitor ID (VID), if previously set in the Analytics extension.
public static void getUrlVariables(final AdobeCallback<String> callback);
Identity.getUrlVariables(new AdobeCallback<String>() {
@Override
public void call(String stringWithAdobeVisitorInfo) {
//handle the URL query parameter string here
//For example, open the URL on the device browser
//
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse("http://myUrl.com?" + urlWithAdobeVisitorInfo));
startActivity(i);
}
});
{% endtab %}
{% tab title="iOS" %}
added in ACPIdentity v2.1.0
Retrieve Adobe visitor data as a URL query parameter string for consumption in hybrid mobile applications. There is no leading "?" or "&" punctuation, as the caller is responsible for placing the string in the correct location of their resulting URL. The following information is added to the string that is returned via the callback:
- The adobe_mc attribute is an URL encoded list that contains:
MCMID
- Experience Cloud ID (ECID)MCORGID
- Experience Cloud Org IDMCAID
- Analytics Tracking ID (AID), if available from the Analytics extensionTS
- A timestamp taken when this request was made
- The optional
adobe_aa_vid
attribute is the URL-encoded Analytics Custom Visitor ID (VID), if previously set in the Analytics extension.
+ (void) getUrlVariables: (nonnull void (^) (NSString* __nullable urlVariables)) callback;
Objective-C
[ACPIdentity getUrlVariables:^(NSString * _Nullable urlVariables) {
// handle the URL query parameter string here
NSString* urlString = @"http://myUrl.com";
NSString* urlStringWithVisitorData = [NSString stringWithFormat:@"%@?%@", urlString, urlVariables];
NSURL* urlWithVisitorData = [NSURL URLWithString:urlStringWithVisitorData];
[[UIApplication sharedApplication] openURL:urlWithVisitorData options:@{} completionHandler:^(BOOL success) {
// handle openURL success
}];
}];
Swift
ACPIdentity.getUrlVariables {(urlVariables) in
// URL query parameter string
let urlStringWithVisitorData : String = "http://myUrl.com?" + urlVariables!
let urlWithVisitorData : NSURL = NSURL(string: urlStringWithVisitorData)!
UIApplication.shared.open(urlWithVisitorData as URL,
options: [:],
completionHandler: {(complete) in
// handle open success
})
}
{% endtab %} {% endtabs %}
{% tabs %} {% tab title="Android" %}
Returns all customer identifiers that were previously synced with the Adobe Experience Cloud.
The values are returned through the AdobeCallback.
public static void getIdentifiers(final AdobeCallback<List<VisitorID>> callback);
Identity.getIdentifiers(new AdobeCallback<List<VisitorID>>() {
@Override
public void call(List<VisitorID> idList) {
//Process the IDs here
}
});
{% endtab %}
{% tab title="iOS" %}
Returns all customer identifiers which were previously synced with the Adobe Experience Cloud.
+ (void) getIdentifiers: (nonnull void (^) (NSArray<ADBMobileVisitorId*>* __nullable visitorIDs)) callback;
Objective-C
[ACPIdentity getIdentifiers:^(NSArray<ACPMobileVisitorId *> * _Nullable retrievedVisitorIds) {
// handle the retrieved Identifiers here
}];
Swift
ACPIdentity.getIdentifiers { (retrievedVisitorIds) in
// handle the retrieved Identifiers here
}
{% endtab %}
{% tab title="React Native" %}
Returns all customer identifiers which were previously synced with the Adobe Experience Cloud.
ACPIdentity.getIdentifiers().then(identifiers => console.log("AdobeExperienceSDK: Identifiers = " + identifiers));
{% endtab %} {% endtabs %}
{% tabs %} {% tab title="Android" %}
Retrieves the Experience Cloud ID from the Experience Cloud ID Service.
The Experience Cloud ID is generated at initial launch and is stored and used from that point forward. This ID is preserved between app upgrades, is saved and restored during the standard application backup process, and is removed at uninstall. The values are returned via the AdobeCallback.
public static void getExperienceCloudId(final AdobeCallback<String> callback);
Identity.getExperienceCloudId(new AdobeCallback<String>() {
@Override
public void call(String id) {
//Handle the ID returned here
}
});
{% endtab %}
{% tab title="iOS" %}
Retrieves the Adobe Experience Cloud Visitor ID from the Adobe Experience Cloud ID Service.
The Experience Cloud ID is generated at initial launch and is stored and used from that point. This ID is preserved between app upgrades, is saved and restored during the standard application backup process, and is removed at uninstall.
+ (void) getExperienceCloudId: (nonnull void (^) (NSString* __nullable experienceCloudId)) callback;
Objective-C
[ACPIdentity getExperienceCloudId:^(NSString * _Nullable retrievedCloudId) {
// handle the retrieved Id here
}];
Swift
ACPIdentity.getExperienceCloudId { (retrievedCloudId) in
// handle the retrieved Id here
}
{% endtab %}
{% tab title="React Native" %}
Retrieves the Adobe Experience Cloud Visitor ID from the Adobe Experience Cloud ID Service.
ACPIdentity.getExperienceCloudId().then(cloudId => console.log("AdobeExperienceSDK: CloudID = " + cloudId));
{% endtab %} {% endtabs %}
The advertising ID is preserved between app upgrades, is saved and restored during the standard application backup process, available via Signals, and is removed at uninstall.
{% hint style="info" %}
If the current SDK privacy status is optedout
, the advertising identifier is not set or stored.
{% endhint %}
{% tabs %} {% tab title="Android" %}
public static void setAdvertisingIdentifier(final String advertisingIdentifier);
MobileCore.setAdvertisingIdentifier("advertising_identifier");
{% endtab %}
{% tab title="iOS" %}
+ (void) setAdvertisingIdentifier: (nullable NSString*) adId;
Examples
[ACPCore setAdvertisingIdentifier:@"AdvertisingId"];
Swift
ACPCore.setAdvertisingIdentifier("AdvertisingId")
{% endtab %}
{% tab title="React Native" %}
ACPCore.setAdvertisingIdentifier("adID");
{% endtab %} {% endtabs %}
This API sets the device token for push notifications in the SDK. If the current SDK privacy status is optedout
, the push identifier is not set.
{% tabs %} {% tab title="Android" %}
public static void setPushIdentifier(final String pushIdentifier);
//Retrieve the token from either GCM or FCM, and pass it to the SDK
MobileCore.setPushIdentifier(token);
{% endtab %}
{% tab title="iOS" %}
+ (void) setPushIdentifier: (nullable NSData*) deviceToken;
Example
// Set the deviceToken that the APNS has assigned to the device
[ACPCore setPushIdentifier:deviceToken];
// Set the deviceToken that the APNs has assigned to the device
ACPCore.setPushIdentifier(deviceToken)
{% endtab %}
{% tab title="React Native" %}
ACPCore.setPushIdentifier("pushIdentifier");
{% endtab %} {% endtabs %}
{% tabs %} {% tab title="Android" %}
This class provides the interface to receive results when the async APIs perform the requested action.
public interface AdobeCallback<T> {
void call(final T value);
}
An identifier to be used with the Experience Cloud Visitor ID Service.
public class VisitorID {
//Constructor
public VisitorID(String idOrigin, String idType, String id, VisitorID.AuthenticationState authenticationState);
public VisitorID.AuthenticationState getAuthenticationState();
public final String getId();
public final String getIdOrigin();
public final String getIdType();
}
Used to indicate the authentication state for the current VisitorID
.
public enum AuthenticationState {
UNKNOWN,
AUTHENTICATED,
LOGGED_OUT;
}
{% endtab %}
{% tab title="iOS" %}
An identifier to be used with the Experience Cloud Visitor ID Service.
Contains the origin, the type, a value, and the authentication state of the visitor ID.
@interface ACPMobileVisitorId : NSObject
@property(nonatomic, strong, nullable) NSString* idOrigin;
@property(nonatomic, strong, nullable) NSString* idType;
@property(nonatomic, strong, nullable) NSString* identifier;
@property(nonatomic, readwrite) ACPMobileVisitorAuthenticationState authenticationState;
@end
Used to indicate the authentication state for the current VisitorID
.
typedef NS_ENUM(NSUInteger,
ADBMobileVisitorAuthenticationState) {
ACPMobileVisitorAuthenticationStateUnknown = 0,
ACPMobileVisitorAuthenticationStateAuthenticated = 1,
ACPMobileVisitorAuthenticationStateLoggedOut = 2 };
{% endtab %}
{% tab title="React Native" %}
import {ACPVisitorID} from '@adobe/react-native-acpcore';
var visitorId = new ACPVisitorID(idOrigin?: string, idType: string, id?: string, authenticationState?: ACPMobileVisitorAuthenticationState)
{% endtab %} {% endtabs %}