Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions apps/AEPSampleApp/extensions/EdgeIdentity.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export default EdgeIdentity = ({ navigation }) => {
<Button onPress={() => navigation.goBack()} title="Go to main page" />
<Text style={styles.welcome}>EdgeIdentity</Text>
<Button title="extensionVersion()" onPress={edgeIdentityExtensionVersion}/>
<Button title="getExperienceCloudId()" onPress={getExperienceCloudId}/>
</ScrollView>
</View>
)
Expand All @@ -34,6 +35,9 @@ function edgeIdentityExtensionVersion() {
AEPIdentity.extensionVersion().then(version => console.log("AdobeExperienceSDK: AEPEdgeIdentity version: " + version));
}

function getExperienceCloudId() {
AEPIdentity.getExperienceCloudId().then(experienceCloudId => console.log("AdobeExperienceSDK: Experience Cloud Id = " + experienceCloudId));
}

const styles = StyleSheet.create({
container: {
Expand Down
2 changes: 1 addition & 1 deletion apps/AEPSampleApp/extensions/Identity.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default Identity = ({ navigation }) => {
<View style={styles.container}>
<ScrollView contentContainerStyle={{ marginTop: 75 }}>
<Button onPress={() => navigation.goBack()} title="Go to main page" />
<Text style={styles.welcome}>UserProfile</Text>
<Text style={styles.welcome}>Identity</Text>
<Button title="extensionVersion()" onPress={identityExtensionVersion}/>
<Button title="syncIdentifiers()" onPress={syncIdentifiers}/>
<Button title="syncIdentifiersWithAuthState()" onPress={syncIdentifiersWithAuthState}/>
Expand Down
38 changes: 19 additions & 19 deletions apps/AEPSampleApp/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@ PODS:
- AEPAssurance (3.0.0):
- AEPCore (>= 3.1.0)
- AEPServices (>= 3.1.0)
- AEPCore (3.2.4):
- AEPCore (3.3.0):
- AEPRulesEngine (= 1.0.1)
- AEPServices (= 3.2.4)
- AEPEdge (1.1.1):
- AEPServices (= 3.3.0)
- AEPEdge (1.1.2):
- AEPCore (>= 3.1.1)
- AEPEdgeIdentity
- AEPEdgeIdentity (1.0.0):
- AEPCore (>= 3.1.1)
- AEPIdentity (3.2.4):
- AEPCore (= 3.2.4)
- AEPLifecycle (3.2.4):
- AEPCore (= 3.2.4)
- AEPIdentity (3.3.0):
- AEPCore (= 3.3.0)
- AEPLifecycle (3.3.0):
- AEPCore (= 3.3.0)
- AEPMessaging (1.0.0):
- AEPCore
- AEPEdge (>= 1.1.0)
- AEPEdgeIdentity (>= 1.0.0)
- AEPServices
- AEPRulesEngine (1.0.1)
- AEPServices (3.2.4)
- AEPSignal (3.2.4):
- AEPCore (= 3.2.4)
- AEPServices (3.3.0)
- AEPSignal (3.3.0):
- AEPCore (= 3.3.0)
- AEPUserProfile (3.0.1):
- AEPCore
- boost-for-react-native (1.63.0)
Expand Down Expand Up @@ -57,7 +57,7 @@ PODS:
- RCTAEPEdge (1.0.0-alpha.1):
- AEPEdge (~> 1.0)
- React
- RCTAEPEdgeIdentity (1.0.0-alpha.1):
- RCTAEPEdgeIdentity (1.0.0-alpha.2):
- AEPEdgeIdentity (~> 1.0)
- React
- RCTAEPMessaging (1.0.0-alpha.1):
Expand Down Expand Up @@ -494,26 +494,26 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
AEPAssurance: 18068627111e366a851dc2166239f22b665101bd
AEPCore: 517f1375860222a12c6226c50d0782e51d27abf2
AEPEdge: ff0cf67e25c342a7a9d48e9a77e9485869dad043
AEPCore: 0bd46c0a859d36099bb71294874837c31235ffe6
AEPEdge: 4208614f134d86131df95fd3420da20530fac275
AEPEdgeIdentity: 40d312b4434b710a46c1738ab2a221dda4cfd67e
AEPIdentity: 6580a2a0359931cb7e32be934341df7d86ca73ed
AEPLifecycle: d822d28e71d201debfcbfc0f1c60cdee61412925
AEPIdentity: ad3bc0d18db4a8a1408299e56883c1db1e874551
AEPLifecycle: a040570f7981f3d1892b9e39f3cd7b5de5280594
AEPMessaging: 661cc08435254f3c9cc0899785c20a7952952e95
AEPRulesEngine: 5075ed294026a12e37bd26fe260f74604d205354
AEPServices: ffa6f91c0799f0a8651d89978a4b2a3d024ee6c4
AEPSignal: 0be73545905731da4768d5ece48faf29b2cae764
AEPServices: ccf8d0fdfe7a7e45303aa6b3c33af0687dd49cf1
AEPSignal: 7eb425e33e08d2bcdb039121157f2504e82e8dad
AEPUserProfile: 2ddb5ba8e2c22dd8f942992306b050f4be2c2403
boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
DoubleConversion: cf9b38bf0b2d048436d9a82ad2abe1404f11e7de
FBLazyVector: e686045572151edef46010a6f819ade377dfeb4b
FBReactNativeSpec: 02403654be033f905d9156b55635355f3a1cca1f
FBReactNativeSpec: 5ca7548715da0ca374801e008d75e1eb871b5836
glog: 73c2498ac6884b13ede40eda8228cb1eee9d9d62
RCT-Folly: ec7a233ccc97cc556cf7237f0db1ff65b986f27c
RCTAEPAssurance: 419c28c8d04829cdf40b802ed5227e7ab039c329
RCTAEPCore: 6dfa0402c077510e4b08c1782350640d53cb83e4
RCTAEPEdge: 1ff651b4e56d6200eaa8dde8ef049ba39a1eccaf
RCTAEPEdgeIdentity: 95c0697178995cc4e778d12491deeaa18366d492
RCTAEPEdgeIdentity: 245c00a7c8e7b27a902b7839238aa3726366f732
RCTAEPMessaging: bda1f87bc2740eb335ea911e73b8377049053e5e
RCTAEPUserProfile: 53b3cc558dccf3d0ec367fc27493087bde9e834d
RCTRequired: 6d3e854f0e7260a648badd0d44fc364bc9da9728
Expand Down
4 changes: 2 additions & 2 deletions apps/AEPSampleApp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"dependencies": {
"@adobe/react-native-aepcore": "^1.0.0-alpha.1",
"@adobe/react-native-aepuserprofile": "^1.0.0-alpha.3",
"@adobe/react-native-aepedge": "1.0.0-alpha.2",
"@adobe/react-native-aepedgeidentity": "^1.0.0-alpha.1",
"@adobe/react-native-aepedge": "^1.0.0-alpha.2",
"@adobe/react-native-aepedgeidentity": "^1.0.0-alpha.2",
"@adobe/react-native-aepmessaging": "^1.0.0-alpha.2",
"@adobe/react-native-aepassurance": "^3.0.0-alpha.0",
"@react-native-community/masked-view": "^0.1.11",
Expand Down
26 changes: 25 additions & 1 deletion packages/edgeidentity/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,31 @@

# React Native AEP Identiity for Edge Network Extension
# React Native AEP Identity for Edge Network Extension

[![npm version](https://badge.fury.io/js/%40adobe%2Freact-native-aepedgeidentity.svg)](https://www.npmjs.com/package/@adobe/react-native-aepedgeidentity)
[![npm downloads](https://img.shields.io/npm/dm/@adobe/react-native-aepedgeidentity)](https://www.npmjs.com/package/@adobe/react-native-aepedgeidentity)

`@adobe/react-native-aepedgeidentity` is a wrapper around the iOS and Android [AEP Identity for Edge Network](https://aep-sdks.gitbook.io/docs/foundation-extensions/identity-for-edge-network) to allow for integration with React Native applications.

## Prerequisites

The AEP Identity for Edge Network extension has the following peer dependency, which must be installed prior to installing the messaging extension:
- [Core](../core/README.md)

## Installation

See [Requirements and Installation](https://github.com/adobe/aepsdk-react-native#requirements) instructions on the main page

Install the `@adobe/react-native-aepedgeidentity` package:

```bash
cd MyReactApp
npm install @adobe/react-native-aepedgeidentity
```

## Usage

### [AEP Identity for Edge Network extension](https://aep-sdks.gitbook.io/docs/foundation-extensions/identity-for-edge-network)

### Initializing:

Initializing the SDK should be done in native code, documentation on how to initialize the SDK can be found [here](https://github.com/adobe/aepsdk-react-native#initializing).
Expand Down Expand Up @@ -84,3 +104,7 @@ import {AEPIdentity} from '@adobe/react-native-aepedgeidentity';
```javascript
AEPIdentity.extensionVersion().then(version => console.log("AdobeExperienceSDK: AEPEdgeIdentity version: " + version));
```
#### Get Experience Cloud ID:
```javascript
AEPIdentity.getExperienceCloudId().then(experienceCloudId => console.log("AdobeExperienceSDK: Experience Cloud Id = " + experienceCloudId));
```
6 changes: 6 additions & 0 deletions packages/edgeidentity/__tests__/AEPEdgeIdentityTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,10 @@ describe('AEPEdgeIdentity', () => {
await AEPIdentity.extensionVersion();
expect(spy).toHaveBeenCalled();
});

it('getExperienceCloudId is called', async () => {
const spy = jest.spyOn(NativeModules.AEPEdgeIdentity, 'getExperienceCloudId');
await AEPIdentity.getExperienceCloudId();
expect(spy).toHaveBeenCalled();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,14 @@ public String getName() {
public void extensionVersion(final Promise promise) {
promise.resolve(Identity.extensionVersion());
}

@ReactMethod
public void getExperienceCloudId(final Promise promise) {
Identity.getExperienceCloudId(new AdobeCallback<String>() {
@Override
public void call(String s) {
promise.resolve(s);
}
});
}
}
5 changes: 5 additions & 0 deletions packages/edgeidentity/ios/src/RCTAEPEdgeIdentity.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,10 @@ - (dispatch_queue_t)methodQueue
resolve([AEPMobileEdgeIdentity extensionVersion]);
}

RCT_EXPORT_METHOD(getExperienceCloudId:(RCTPromiseResolveBlock) resolve rejecter:(RCTPromiseRejectBlock)reject) {
[AEPMobileEdgeIdentity getExperienceCloudId:^(NSString * _Nullable experienceCloudId, NSError * _Nullable error) {
resolve(experienceCloudId);
}];
}
@end

11 changes: 11 additions & 0 deletions packages/edgeidentity/js/AEPIdentity.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,15 @@ module.exports = {
extensionVersion(): Promise<string> {
return Promise.resolve(RCTAEPEdgeIdentity.extensionVersion());
},

/**
* @brief Returns the Experience Cloud ID.
*
* Returns the Experience Cloud ID. An empty string is returned if the Experience Cloud ID was previously cleared.
*
* @param promise method which will be invoked once the Experience Cloud ID is available.
*/
getExperienceCloudId(): Promise<?string> {
return RCTAEPEdgeIdentity.getExperienceCloudId();
},
};
1 change: 1 addition & 0 deletions packages/edgeidentity/js/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ governing permissions and limitations under the License.
*/
export class AEPIdentity{
static extensionVersion(): Promise<string>;
static getExperienceCloudId(): Promise<string>;
};
4 changes: 2 additions & 2 deletions packages/edgeidentity/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adobe/react-native-aepedgeidentity",
"version": "1.0.0-alpha.1",
"version": "1.0.0-alpha.2",
"description": "Adobe Experience Platform Identity for Edge Network extension for Adobe Experience Platform Mobile SDK. Written and maintained by Adobe.",
"homepage": "https://aep-sdks.gitbook.io/docs/",
"license": "Apache-2.0",
Expand All @@ -27,7 +27,7 @@
"name": "Adobe Experience Platform SDK Team"
},
"peerDependencies": {
"@adobe/react-native-aepcore": "^1.0.0",
"@adobe/react-native-aepcore": "^1.0.0-alpha",
"react-native": ">=0.60.0"
},
"publishConfig": {
Expand Down
1 change: 1 addition & 0 deletions tests/jest/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jest.doMock('react-native', () => {
...ReactNative.NativeModules,
AEPEdgeIdentity: {
extensionVersion: jest.fn(() => new Promise(resolve => resolve(''))),
getExperienceCloudId: jest.fn(() => new Promise(resolve => resolve(''))),
},
AEPEdge: {
extensionVersion: jest.fn(() => new Promise(resolve => resolve(''))),
Expand Down