API Reference

getExperienceCloudId

Android
iOS — Swift

getExperienceCloudId

This API retrieves the ECID that was generated when the app was initially launched.
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.
When AdobeCallbackWithError is provided, and you are fetching the ECID from the Mobile SDK, the timeout value is 500ms. If the operation times out or an unexpected error occurs, the fail method is called with the appropriate AdobeError.
Java
Syntax
1
public static void getExperienceCloudId(final AdobeCallback<String> callback);
Copied!
  • callback is invoked after the ECID is available. The callback may be invoked on a different thread.
Example
1
Identity.getExperienceCloudId(new AdobeCallback<String>() {
2
@Override
3
public void call(String id) {
4
//Handle the ID returned here
5
}
6
});
Copied!

getExperienceCloudId

This API retrieves the ECID that was generated when the app was initially launched.
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 callback.
Syntax
1
@objc(getExperienceCloudId:)
2
static func getExperienceCloudId(completion: @escaping (String?, Error?) -> Void)
Copied!
  • completion is invoked after the ECID is available. The default timeout is 1000ms.
Examples
Objective-C
1
[AEPEdgeIdentity getExperienceCloudId:^(NSString * _Nullable ecid, NSError * error) {
2
// handle the retrieved ID here
3
}];
Copied!
Swift
1
Identity.getExperienceCloudId { (ecid, error) in
2
if let error = error {
3
// handle error here
4
} else {
5
// handle the retrieved ID here
6
}
7
}
Copied!

getIdentities

Android
iOS — Swift

getIdentities

Get all identities in the Identity for Edge Network extension, including customer identifiers which were previously added.
When AdobeCallbackWithError is provided, and you are fetching the identities from the Mobile SDK, the timeout value is 500ms. If the operation times out or an unexpected error occurs, the fail method is called with the appropriate AdobeError.
Java
Syntax
1
public static void getIdentities(final AdobeCallback<IdentityMap> callback);
Copied!
  • call is invoked after the identities are available. The return format is an instance of IdentityMap. The callback may be invoked on a different thread.
Example
1
Identity.getIdentities(new AdobeCallback<IdentityMap>() {
2
@Override
3
public void call(IdentityMap identityMap) {
4
//Handle the IdentityMap returned here
5
}
6
});
Copied!

getIdentities

Get all identities in the Identity for Egde Network extension, including customer identifiers which were previously added.
Syntax
1
@objc(getIdentities:)
2
static func getIdentities(completion: @escaping (IdentityMap?, Error?) -> Void)
Copied!
  • completion is invoked after the identities are available. The default timeout is 1000ms. The return format is an instance of IdentityMap
Examples
Objective-C
1
[AEPEdgeIdentity getIdentities:^(AEPIdentityMap *map, NSError * error) {
2
// handle the retrieved identities here
3
}];
Copied!
Swift
1
Identity.getIdentities { (identityMap, error) in
2
if let error = error {
3
// handle error here
4
} else {
5
// handle the retrieved identitites here
6
}
7
}
Copied!

updateIdentities

Android
iOS — Swift

updateIdentities

Update the currently known identities within the SDK. The Identity extension will merge the received identifiers with the previously saved ones in an additive manner, no identities are removed from this API.
Identities with an empty id or namespace are not allowed and are ignored.
Updating identities using a reserved namespace is not allowed using this API. The reserved namespaces are:
  • ECID
  • IDFA
  • GAID
Java
Syntax
1
public static void updateIdentities(final IdentityMap identityMap);
Copied!
Example
1
IdentityItem item = new IdentityItem("[email protected]");
2
IdentityMap identityMap = new IdentityMap();
3
identityMap.addItem(item, "Email")
4
Identity.updateIdentities(identityMap);
Copied!

updateIdentities

Update the currently known identities within the SDK. The Identity extension will merge the received identifiers with the previously saved ones in an additive manner, no identities are removed from this API.
Identities with an empty id or namespace are not allowed and are ignored.
Updating identities using a reserved namespace is not allowed using this API. The reserved namespaces are:
  • ECID
  • IDFA
  • GAID
Syntax
1
@objc(updateIdentities:)
2
static func updateIdentities(with map: IdentityMap)
Copied!
Examples
Objective-C
1
AEPIdentityItem *item = [[AEPIdentityItem alloc] initWithId:@"[email protected]" authenticatedState:AEPAuthenticatedStateAuthenticated primary:false];
2
AEPIdentityMap *map = [[AEPIdentityMap alloc] init];
3
[map addItem:item withNamespace:@"Email"];
4
[AEPMobileEdgeIdentity updateIdentities:map];
Copied!
Swift
1
let identityMap = IdentityMap()
2
map.addItem(item: IdentityItem(id: "[email protected]"), withNamespace: "Email")
3
Identity.updateIdentities(with: identityMap)
Copied!

removeIdentity

Android
iOS — Swift

removeIdentity

Remove the identity from the stored client-side IdentityMap. The Identity extension will stop sending the identifier to the Edge Network. Using this API does not remove the identifier from the server-side User Profile Graph or Identity Graph.
Identities with an empty id or namespace are not allowed and are ignored.
Removing identities using a reserved namespace is not allowed using this API. The reserved namespaces are:
  • ECID
  • IDFA
  • GAID
Java
Syntax
1
public static void removeIdentity(final IdentityItem item, final String namespace);
Copied!
Example
1
IdentityItem item = new IdentityItem("[email protected]");
2
Identity.removeIdentity(item, "Email");
Copied!

removeIdentity

Remove the identity from the stored client-side IdentityMap. The Identity extension will stop sending the identifier to the Edge Network. Using this API does not remove the identifier from the server-side User Profile Graph or Identity Graph.
Identities with an empty id or namespace are not allowed and are ignored.
Removing identities using a reserved namespace is not allowed using this API. The reserved namespaces are:
  • ECID
  • IDFA
  • GAID
Syntax
1
@objc(removeIdentityItem:withNamespace:)
2
static func removeIdentity(item: IdentityItem, withNamespace: String)
Copied!
Examples
Objective-C
1
AEPIdentityItem *item = [[AEPIdentityItem alloc] initWithId:@"[email protected]" authenticatedState:AEPAuthenticatedStateAuthenticated primary:false];
2
[AEPMobileEdgeIdentity removeIdentityItem:item withNamespace:@"Email"];
Copied!
Swift
1
Identity.removeIdentity(item: IdentityItem(id: "[email protected]"), withNamespace: "Email")
Copied!

resetIdentities

Clears all identities stored in the Identity extension and generates a new Experience Cloud ID (ECID) . Using this API does not remove the identifiers from the server-side User Profile Graph or Identity Graph.
The Identity for Edge Network extension does not read the Mobile SDK's privacy status and therefor setting the SDK's privacy status to opt-out will not clear the identities from the Identity for Edge Network extension.
See MobileCore.resetIdentities for more details.

Public Classes

IdentityMap

Defines a map containing a set of end user identities, keyed on either namespace integration code or the namespace ID of the identity. The values of the map are an array, meaning that more than one identity of each namespace may be carried.
The format of the IdentityMap class is defined by the XDM Identity Map Schema.
For more information, please read an overview of the AEP Identity Service.
1
"identityMap" : {
2
"Email" : [
3
{
4
5
"authenticatedState" : "authenticated",
6
"primary" : false
7
}
8
],
9
"Phone" : [
10
{
11
"id" : "1234567890",
12
"authenticatedState" : "ambiguous",
13
"primary" : false
14
},
15
{
16
"id" : "5557891234",
17
"authenticatedState" : "ambiguous",
18
"primary" : false
19
}
20
],
21
"ECID" : [
22
{
23
"id" : "44809014977647551167356491107014304096",
24
"authenticatedState" : "ambiguous",
25
"primary" : true
26
}
27
]
28
}
Copied!
Android
iOS — Swift
Examples
Java
1
// Construct
2
IdentityMap identityMap = new IdentityMap();
3
4
// Add an item
5
IdentityItem item = new IdentityItem("[email protected]");
6
identityMap.addItem(item, "Email");
7
8
// Remove an item
9
IdentityItem item = new IdentityItem("[email protected]");
10
identityMap.removeItem(item, "Email");
11
12
// Get a list of items for a given namespace
13
List<IdentityItem> items = identityMap.getIdentityItemsForNamespace("Email");
14
15
// Get a list of all namespaces used in current IdentityMap
16
List<String> namespaces = identityMap.getNamespaces();
17
18
// Check if IdentityMap has no identities
19
boolean hasNotIdentities = identityMap.isEmpty();
Copied!
Examples
Objective-C
1
// Initialize
2
AEPIdentityMap *identityMap = [[AEPIdentityMap alloc] init];
3
4
// Add an item
5
AEPIdentityItem *item = [[AEPIdentityItem alloc] initWithId:@"[email protected]" authenticatedState:AEPAuthenticatedStateAuthenticated primary:false];
6
[identityMap addItem:item withNamespace:@"Email"];
7
8
// Remove an item
9
AEPIdentityItem *item = [[AEPIdentityItem alloc] initWithId:@"[email protected]" authenticatedState:AEPAuthenticatedStateAuthenticated primary:false];
10
[identityMap removeItem:item withNamespace:@"Email"];
11
12
// Get a list of items for a given namespace
13
NSArray* items = [identityMap getItemsWithNamespace:@"Email"];
14
15
// Get a list of all namespaces used in current IdentityMap
16
NSArray* namespaces = identityMap.namespaces;
17
18
// Check if IdentityMap has no identities
19
bool hasNoIdentities = identityMap.isEmpty;
Copied!
Swift
1
// Initialize
2
let identityMap: IdentityMap = IdentityMap()
3
4
// Add an item
5
identityMap.add(item: IdentityItem(id: "[email protected]"), withNamespace: "Email")
6
7
// Remove an item
8
identityMap.remove(item: IdentityItem(id: "[email protected]", withNamespace: "Email"))
9
10
// Get a list of items for a given namespace
11
let items: [IdentityItem] = identityMap.getItems(withNamespace: "Email")
12
13
// Get a list of all namespaces used in current IdentityMap
14
let namespaces: [String] = identityMap.namespaces
15
16
// Check if IdentityMap has no identities
17
let hasNoIdentities: Bool = identityMap.isEmpty
Copied!

IdentityItem

Defines an identity to be included in an IdentityMap.
The format of the IdentityItem class is defined by the XDM Identity Item Schema.
Android
iOS — Swift
Examples
Java
1
// Construct
2
IdentityItem item = new IdentityItem("identifier");
3
4
IdentityItem item = new IdentityItem("identifier", AuthenticatedState.AUTHENTICATED, false);
5
6
7
// Getters
8
String id = item.getId();
9
10
AuthenticatedState state = item.getAuthenticatedState();
11
12
boolean primary = item.isPrimary();
Copied!
Examples
Objective-C
1
// Initialize
2
AEPIdentityItem *item = [[AEPIdentityItem alloc] initWithId:@"identity" authenticatedState:AEPAuthenticatedStateAuthenticated primary:false];
3
4
// Getters
5
NSString *id = primaryEmail.id;
6
7
long state = primaryEmail.authenticatedState;
8
9
bool primary = primaryEmail.primary;
Copied!
Swift
1
// Initialize
2
let item = IdentityItem(id: "identifier")
3
4
let item = IdentityItem(id: "identifier", authenticatedState: .authenticated, primary: false)
5
6
// Getters
7
let id: String = item.id
8
9
let state: AuthenticatedState = item.authenticatedState
10
11
let primary: Bool = item.primary
Copied!

AuthenticatedState

Defines the state an Identity Item is authenticated for.
The possible authenticated states are:
  • Ambiguous - the state is ambiguous or not defined
  • Authenticated - the user is identified by a login or similar action
  • LoggedOut - the user was identified by a login action at a previous time, but is not logged in now
Android
iOS — Swift
Syntax
1
public enum AuthenticatedState {
2
AMBIGUOUS("ambiguous"),
3
AUTHENTICATED("authenticated"),
4
LOGGED_OUT("loggedOut");
5
}
Copied!
Syntax
1
@objc(AEPAuthenticatedState)
2
public enum AuthenticatedState: Int, RawRepresentable, Codable {
3
case ambiguous = 0
4
case authenticated = 1
5
case loggedOut = 2
6
}
Copied!
Last modified 1mo ago