API Reference

extensionVersion

The extensionVersion() API returns the version of the Identity for Edge Network extension.
Android
iOS (AEP 3.x)

Java

Syntax
1
public static String extensionVersion()
Copied!
Example
1
String extensionVersion = Identity.extensionVersion();
Copied!

Swift

Syntax
1
static var extensionVersion: String
Copied!
Examples
1
let extensionVersion = EdgeIdentity.extensionVersion
Copied!

Objective-C

Syntax
1
+ (nonnull NSString*) extensionVersion;
Copied!
Examples
1
NSString *extensionVersion = [AEPMobileEdgeIdentity extensionVersion];
Copied!

getExperienceCloudId

This API retrieves the Experience Cloud ID (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.
Android
iOS (AEP 3.x)
The ECID value is returned via the AdobeCallback. When AdobeCallbackWithError is provided to this API, 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!

Swift

Syntax
1
static func getExperienceCloudId(completion: @escaping (String?, Error?) -> Void)
Copied!
  • completion is invoked after the ECID is available. The default timeout is 1000ms.
Examples
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!

Objective-C

Syntax
1
+ (void) getExperienceCloudId:^(NSString * _Nullable ecid, NSError * _Nullable error)completion
Copied!
Examples
1
[AEPMobileEdgeIdentity getExperienceCloudId:^(NSString *ecid, NSError *error) {
2
// handle the error and the retrieved ID here
3
}];
Copied!

getIdentities

Get all identities in the Identity for Edge Network extension, including customer identifiers which were previously added.
Android
iOS (AEP 3.x)
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!
  • callback 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!

Swift

Syntax
1
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
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!

Objective-C

Syntax
1
+ (void) getIdentities:^(AEPIdentityMap * _Nullable map, NSError * _Nullable error)completion
Copied!
Examples
1
[AEPMobileEdgeIdentity getIdentities:^(AEPIdentityMap *map, NSError *error) {
2
// handle the error and the retrieved ID here
3
}];
Copied!

registerExtension

Registers the Identity for Edge Network extension with the Mobile Core extension.
If your use-case covers both Edge Network and Adobe Experience Cloud Solutions extensions, you need to register Identity for Edge Network and Identity for Experience Cloud Identity Service from Mobile Core extensions. For more details, see the frequently asked questions.
Android
iOS (AEP 3.x)

Java

Syntax
1
public static void registerExtension()
Copied!
Example
1
import com.adobe.marketing.mobile.edge.identity.Identity
2
3
...
4
Identity.registerExtension();
Copied!
In iOS, the registration occurs by passing Identity for Edge Network extension to the MobileCore.registerExtensions API.

Swift

Syntax
1
static func registerExtensions(_ extensions: [NSObject.Type],
2
_ completion: (() -> Void)? = nil)
Copied!
Examples
1
import AEPEdgeIdentity
2
3
...
4
MobileCore.registerExtensions([Identity.self])
Copied!

Objective-C

Syntax
1
+ (void) registerExtensions: (NSArray<Class*>* _Nonnull) extensions
2
completion: (void (^ _Nullable)(void)) completion;
Copied!
Examples
1
@import AEPEdgeIdentity;
2
3
...
4
[AEPMobileCore registerExtensions:@[AEPMobileEdgeIdentity.class] completion:nil];
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
Android
iOS (AEP 3.x)

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!

Swift

Syntax
1
static func removeIdentity(item: IdentityItem, withNamespace: String)
Copied!
Examples
1
Identity.removeIdentity(item: IdentityItem(id: "[email protected]"), withNamespace: "Email")
Copied!

Objective-C

Syntax
1
+ (void) removeIdentityItem:(AEPIdentityItem * _Nonnull) item
2
withNamespace: (NSString * _Nonnull) namespace
Copied!
Examples
1
AEPIdentityItem *item = [[AEPIdentityItem alloc] initWithId:@"[email protected]" authenticatedState:AEPAuthenticatedStateAuthenticated primary:false];
2
[AEPMobileEdgeIdentity removeIdentityItem:item 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.
This is a destructive action, since once an ECID is removed it cannot be reused. The new ECID generated by this API can increase metrics like unique visitors when a new user profile is created.
Some example use cases for this API are:
  • During debugging, to see how new ECIDs (and other identifiers paired with it) behave with existing rules and metrics.
  • A last-resort reset for when an ECID should no longer be used.
This API is not recommended for:
  • Resetting a user's consent and privacy settings; see Privacy and GDPR.
  • Removing existing custom identifiers; use the removeIdentity API instead.
  • Removing a previously synced advertising identifier after the advertising tracking settings were changed by the user; use the setAdvertisingIdentifier API instead.
The Identity for Edge Network extension does not read the Mobile SDK's privacy status, and therefore setting the SDK's privacy status to opt-out will not automatically clear the identities from the Identity for Edge Network extension.
See MobileCore.resetIdentities for more details.

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
Android
iOS (AEP 3.x)

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!

Swift

Syntax
1
static func updateIdentities(with map: IdentityMap)
Copied!
Examples
1
let identityMap = IdentityMap()
2
map.addItem(item: IdentityItem(id: "[email protected]"), withNamespace: "Email")
3
Identity.updateIdentities(with: identityMap)
Copied!

Objective-C

Syntax
1
+ (void) updateIdentities:(AEPIdentityMap * _Nonnull)map
Copied!
Examples
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!

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 (AEP 3.x)

Java

Example
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!

Swift

Example
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!

Objective-C

Example
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<AEPIdentityItem*>* items = [identityMap getItemsWithNamespace:@"Email"];
14
15
// Get a list of all namespaces used in current IdentityMap
16
NSArray<NSString*>* namespaces = identityMap.namespaces;
17
18
// Check if IdentityMap has no identities
19
bool hasNoIdentities = 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 (AEP 3.x)

Java

Example
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!

Swift

Example
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!

Objective-C

Example
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!

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 (AEP 3.x)
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!