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 given authentication state 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 %} {% 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 containing:- Experience Cloud ID (ECID)
- Experience Cloud Org ID
- A timestamp taken when this request was made
- The optional adobe_aa_vid attribute is the URL encoded Analytics Custom Visitor ID, if available
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 containing:
- Experience Cloud ID (ECID)
- Experience Cloud Org ID
- A timestamp taken when this request was made
- The optional
adobe_aa_vid
attribute is the URL-encoded Analytics Custom Visitor ID, if available.
+ (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 %} {% endtabs %}
{% tabs %} {% tab title="Android" %}
Returns all customer identifiers which 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 %} {% 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 %} {% 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 identity.adidEnabled set to false, then the advertising identifier is not set or stored. Also, if the current SDK privacy status is optedout, then the advertising identifier is not set. {% 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 %} {% 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 %} {% endtabs %}
{% tabs %} {% tab title="Android" %}
This class provides the interface to receive results when the async APIs perform the requested action. For more information about these methods, see Identity Service methods in Android.
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 %} {% endtabs %}