-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #110 from adobe/dev-v2.0.1
dev-v2.0.1 -> staging
- Loading branch information
Showing
14 changed files
with
285 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,11 +38,6 @@ String extensionVersion = Identity.extensionVersion(); | |
|
||
#### Kotlin | ||
|
||
##### Syntax | ||
```kotlin | ||
fun extensionVersion(): String | ||
``` | ||
|
||
##### Example | ||
```kotlin | ||
val extensionVersion = Identity.extensionVersion() | ||
|
@@ -77,11 +72,6 @@ Identity.getExperienceCloudId(new AdobeCallback<String>() { | |
|
||
#### Kotlin | ||
|
||
##### Syntax | ||
```kotlin | ||
fun getExperienceCloudId(callback: AdobeCallback<String>) | ||
``` | ||
|
||
##### Example | ||
```kotlin | ||
Identity.getExperienceCloudId { id -> | ||
|
@@ -118,11 +108,6 @@ Identity.getIdentities(new AdobeCallback<IdentityMap>() { | |
|
||
#### Kotlin | ||
|
||
##### Syntax | ||
```kotlin | ||
fun getIdentities(callback: AdobeCallback<IdentityMap>) | ||
``` | ||
|
||
##### Example | ||
```kotlin | ||
Identity.getIdentities { identityMap -> | ||
|
@@ -170,11 +155,6 @@ Identity.getUrlVariables(new AdobeCallback<String>() { | |
|
||
#### Kotlin | ||
|
||
##### Syntax | ||
```kotlin | ||
fun getUrlVariables(callback: AdobeCallback<String>) | ||
``` | ||
|
||
##### Example | ||
```kotlin | ||
Identity.getUrlVariables { urlVariablesString -> | ||
|
@@ -214,11 +194,6 @@ Identity.registerExtension(); | |
|
||
#### Kotlin | ||
|
||
##### Syntax | ||
```kotlin | ||
fun registerExtension() | ||
``` | ||
|
||
##### Example | ||
```kotlin | ||
Identity.registerExtension() | ||
|
@@ -253,11 +228,6 @@ Identity.removeIdentity(item, "Email"); | |
|
||
#### Kotlin | ||
|
||
##### Syntax | ||
```kotlin | ||
fun removeIdentity(item: IdentityItem, namespace: String) | ||
``` | ||
|
||
##### Example | ||
```kotlin | ||
val item = IdentityItem("[email protected]") | ||
|
@@ -360,12 +330,6 @@ public void onResume() { | |
|
||
#### Kotlin | ||
|
||
##### Syntax | ||
```kotlin | ||
public fun setAdvertisingIdentifier(advertisingIdentifier: String) | ||
``` | ||
- _advertisingIdentifier_ is an ID string that provides developers with a simple, standard system to continue to track ads throughout their apps. | ||
|
||
##### Example | ||
<details> | ||
<summary><code>import ...</code></summary> | ||
|
@@ -452,14 +416,8 @@ identityMap.addItem(item, "Email") | |
Identity.updateIdentities(identityMap); | ||
``` | ||
|
||
|
||
#### Kotlin | ||
|
||
##### Syntax | ||
```kotlin | ||
fun updateIdentities(identityMap: IdentityMap) | ||
``` | ||
|
||
##### Example | ||
```kotlin | ||
val item = IdentityItem("[email protected]") | ||
|
@@ -474,9 +432,9 @@ Identity.updateIdentities(identityMap) | |
|
||
### 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. | ||
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 of [`IdentityItem`](#identityitem)s, meaning that more than one identity of each namespace may be carried. Each `IdentityItem` should have a valid, non-null and non-empty identifier, otherwise it will be ignored. | ||
|
||
The format of the IdentityMap class is defined by the [XDM Identity Map Schema](https://github.com/adobe/xdm/blob/master/docs/reference/mixins/shared/identitymap.schema.md). | ||
The format of the `IdentityMap` class is defined by the [XDM Identity Map Schema](https://github.com/adobe/xdm/blob/master/docs/reference/mixins/shared/identitymap.schema.md). | ||
|
||
For more information, please read an overview of the [Adobe Experience Platform Identity Service](https://experienceleague.adobe.com/docs/experience-platform/identity/home.html). | ||
|
||
|
@@ -565,9 +523,9 @@ val hasNotIdentities = identityMap.isEmpty() | |
|
||
### IdentityItem | ||
|
||
Defines an identity to be included in an [IdentityMap](#identitymap). | ||
Defines an identity to be included in an [`IdentityMap`](#identitymap). `IdentityItem`s may not have null or empty identifiers and are ignored when added to an [`IdentityMap`](#identitymap) instance. | ||
|
||
The format of the IdentityItem class is defined by the [XDM Identity Item Schema](https://github.com/adobe/xdm/blob/master/docs/reference/datatypes/identityitem.schema.md). | ||
The format of the `IdentityItem` class is defined by the [XDM Identity Item Schema](https://github.com/adobe/xdm/blob/master/docs/reference/datatypes/identityitem.schema.md). | ||
|
||
**Example** | ||
|
||
|
@@ -608,7 +566,7 @@ val primary = item.isPrimary | |
|
||
### AuthenticatedState | ||
|
||
Defines the state an [Identity Item](#identityitem) is authenticated for. | ||
Defines the authentication state for an [`IdentityItem`](#identityitem). | ||
|
||
The possible authenticated states are: | ||
|
||
|
@@ -626,13 +584,4 @@ public enum AuthenticatedState { | |
AUTHENTICATED("authenticated"), | ||
LOGGED_OUT("loggedOut"); | ||
} | ||
``` | ||
#### Kotlin | ||
|
||
```kotlin | ||
enum class AuthenticatedState(val name: String) { | ||
AMBIGUOUS("ambiguous"), | ||
AUTHENTICATED("authenticated"), | ||
LOGGED_OUT("loggedOut") | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -363,6 +363,36 @@ public void testGetIdentities() { | |
assertEquals(1, responseMap.getIdentityItemsForNamespace("ECID").size()); | ||
} | ||
|
||
@Test | ||
public void testGetIdentities_itemWithEmptyId_notAddedToMap() { | ||
registerExtensions(Arrays.asList(MonitorExtension.EXTENSION, Identity.EXTENSION), null); | ||
|
||
// setup | ||
// update Identities through API | ||
IdentityMap map = new IdentityMap(); | ||
map.addItem(new IdentityItem("[email protected]"), "Email"); | ||
map.addItem(new IdentityItem("[email protected]"), "Email"); | ||
map.addItem(new IdentityItem("zzzyyyxxx"), "UserId"); | ||
map.addItem(new IdentityItem(""), "UserId"); | ||
map.addItem(new IdentityItem("John Doe"), "UserName"); | ||
map.addItem(new IdentityItem(""), "EmptyNamespace"); | ||
Identity.updateIdentities(map); | ||
|
||
// test | ||
Map<String, Object> getIdentitiesResponse = getIdentitiesSync(); | ||
waitForThreads(2000); | ||
|
||
// verify | ||
IdentityMap responseMap = (IdentityMap) getIdentitiesResponse.get( | ||
IdentityTestConstants.GetIdentitiesHelper.VALUE | ||
); | ||
assertEquals(4, responseMap.getNamespaces().size()); | ||
assertEquals(2, responseMap.getIdentityItemsForNamespace("Email").size()); | ||
assertEquals(1, responseMap.getIdentityItemsForNamespace("UserId").size()); | ||
assertEquals(1, responseMap.getIdentityItemsForNamespace("UserName").size()); | ||
assertEquals(1, responseMap.getIdentityItemsForNamespace("ECID").size()); | ||
} | ||
|
||
@Test | ||
public void testGetIdentities_nullCallback() { | ||
registerExtensions(Arrays.asList(MonitorExtension.EXTENSION, Identity.EXTENSION), null); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.