This document lists the APIs provided by Identity extension, along with sample code snippets on how to properly use the APIs.
For more in-depth information about the Identity extension, visit the official SDK documentation on Identity.
Identity.EXTENSION
represents a reference to the IdentityExtension
class that can be registered with MobileCore
via its registerExtensions
api.
import com.adobe.marketing.mobile.Identity;
MobileCore.registerExtensions(Arrays.asList(Identity.EXTENSION, ...), new AdobeCallback<Object>() {
// handle callback
});
import com.adobe.marketing.mobile.Identity
MobileCore.registerExtensions(Arrays.asList(Identity.EXTENSION, ...)){
// handle callback
}
final String identityExtensionVersion = Identity.extensionVersion();
val identityExtensionVersion: String = Identity.extensionVersion()
Identity.appendVisitorInfoForURL("https://example.com", new AdobeCallback<String>() {
@Override
public void call(String urlWithAdobeVisitorInfo) {
//handle callback
}
});
Identity.appendVisitorInfoForURL("https://example.com"){ urlWithAdobeVisitorInfo ->
// handle callback
}
Identity.getUrlVariables(new AdobeCallback<String>() {
@Override
public void call(String stringWithAdobeVisitorInfo) {
//handle callaback
}
});
Identity.getUrlVariables{ stringWithAdobeVisitorInfo ->
// handle callback
}
Identity.getIdentifiers(new AdobeCallback<List<VisitorID>>() {
@Override
public void call(List<VisitorID> idList) {
// handle callback
}
});
Identity.getIdentifiers{ idList ->
// handle callback
}
Identity.getExperienceCloudId(new AdobeCallback<String>() {
@Override
public void call(String experienceCloudId) {
//handle callback
}
});
Identity.getExperienceCloudId{ experienceCloudId ->
//handle callback
}
Identity.syncIdentifier("idType", "idValue", VisitorID.AuthenticationState.AUTHENTICATED);
Identity.syncIdentifier("idType", "idValue", VisitorID.AuthenticationState.AUTHENTICATED)
final Map<String, String> identifiers = new HashMap<>();
identifiers.put("idType1", "idValue1");
identifiers.put("idType2", "idValue2");
identifiers.put("idType3", "idValue3");
Identity.syncIdentifiers(identifiers);
val identifiers: Map<String, String?> = mapOf(
"idType1" to "idValue1",
"idType2" to "idValue2",
"idType3" to "idValue3"
)
Identity.syncIdentifiers(identifiers);
final Map<String, String> identifiers = new HashMap<>();
identifiers.put("idType1", "idValue1");
identifiers.put("idType2", "idValue2");
identifiers.put("idType3", "idValue3");
Identity.syncIdentifiers(identifiers, VisitorID.AuthenticationState.AUTHENTICATED);
val identifiers: Map<String, String?> = mapOf(
"idType1" to "idValue1",
"idType2" to "idValue2",
"idType3" to "idValue3"
)
Identity.syncIdentifiers(identifiers, VisitorID.AuthenticationState.AUTHENTICATED);