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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This repository is a monorepo. It contains a collection of Adobe Experience Plat
| [@adobe/react-native-aepedgeidentity](./packages/edgeidentity) | [![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-aepedgeconsent](./packages/edgeconsent) | [![npm version](https://badge.fury.io/js/%40adobe%2Freact-native-aepedgeconsent.svg)](https://www.npmjs.com/package/@adobe/react-native-aepedgeconsent) [![npm downloads](https://img.shields.io/npm/dm/@adobe/react-native-aepedgeconsent)](https://www.npmjs.com/package/@adobe/react-native-aepedgeconsent) |
| [@adobe/react-native-aepmessaging](./packages/messaging) | [![npm version](https://badge.fury.io/js/%40adobe%2Freact-native-aepmessaging.svg)](https://www.npmjs.com/package/@adobe/react-native-aepmessaging) [![npm downloads](https://img.shields.io/npm/dm/@adobe/react-native-aepmessaging)](https://www.npmjs.com/package/@adobe/react-native-aepmessaging) |
| [@adobe/react-native-aepassurance (3.0.0-alpha.1)](./packages/assurance) | [![npm version](https://img.shields.io/npm/v/@adobe/react-native-aepassurance/alpha?color=green&label=npm%20package)](https://www.npmjs.com/package/@adobe/react-native-aepassurance/v/3.0.0-alpha.1) [![npm downloads](https://img.shields.io/npm/dm/@adobe/react-native-aepassurance)](https://www.npmjs.com/package/@adobe/react-native-aepassurance/v/3.0.0-alpha.1) |
| [@adobe/react-native-aepassurance](./packages/assurance) | [![npm version](https://badge.fury.io/js/%40adobe%2Freact-native-aepassurance.svg)](https://www.npmjs.com/package/@adobe/react-native-aepassurance) [![npm downloads](https://img.shields.io/npm/dm/@adobe/react-native-aepassurance)](https://www.npmjs.com/package/@adobe/react-native-aepassurance) |

`@adobe/react-native-aep{extension}` is a wrapper around the iOS and Android [AEP SDK](https://aep-sdks.gitbook.io/docs/) to allow for integration with React Native applications.

Expand Down
6 changes: 3 additions & 3 deletions apps/AEPSampleApp/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import IdentityView from './extensions/IdentityView';
import EdgeIdentity from './extensions/EdgeIdentityView';
import ConsentView from './extensions/ConsentView';
import EdgeView from './extensions/EdgeView';
import Assurance from './extensions/Assurance';
import AssuranceView from './extensions/AssuranceView';

function HomeScreen({ navigation }) {
return (
Expand Down Expand Up @@ -42,7 +42,7 @@ function HomeScreen({ navigation }) {
title="Consent"
/>
<Button
onPress={() => navigation.navigate('Assurance')}
onPress={() => navigation.navigate('AssuranceView')}
title="Assurance"
/>
</View>
Expand All @@ -63,7 +63,7 @@ export default function App() {
<Drawer.Screen name="EdgeView" component={EdgeView} />
<Drawer.Screen name="EdgeIdentityView" component={EdgeIdentityView} />
<Drawer.Screen name="ConsentView" component={ConsentView} />
<Drawer.Screen name="Assurance" component={Assurance} />
<Drawer.Screen name="AssuranceView" component={AssuranceView} />
</Drawer.Navigator >
</NavigationContainer >
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ governing permissions and limitations under the License.

import React, {useState,Component} from 'react';
import {Button, StyleSheet, Text, View, TextInput, ScrollView} from 'react-native';
import {AEPAssurance} from '@adobe/react-native-aepassurance';
import {Assurance} from '@adobe/react-native-aepassurance';

export default Assurance = ({ navigation }) => {
export default AssuranceView = ({ navigation }) => {
const [version, setVersion] = useState('');
const [sessionURL, setsessionURL] = useState('your-assurance-url');

AEPAssurance.extensionVersion().then(version => {
Assurance.extensionVersion().then(version => {
setVersion(version)
});

Expand All @@ -41,7 +41,7 @@ export default Assurance = ({ navigation }) => {
)

function startSessionClicked() {
AEPAssurance.startSession(sessionURL)
Assurance.startSession(sessionURL)
}

}
Expand Down
4 changes: 2 additions & 2 deletions apps/AEPSampleApp/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ SPEC CHECKSUMS:
boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
DoubleConversion: cf9b38bf0b2d048436d9a82ad2abe1404f11e7de
FBLazyVector: e686045572151edef46010a6f819ade377dfeb4b
FBReactNativeSpec: cdd6f1f8ca74a9d33e4a3727af16caa19a9fae91
FBReactNativeSpec: 7c69ab647631dee7db72a9d9788913949b9f1dda
glog: 73c2498ac6884b13ede40eda8228cb1eee9d9d62
RCT-Folly: ec7a233ccc97cc556cf7237f0db1ff65b986f27c
RCTAEPAssurance: d0d67b4d25db39db7b9eb9f8afb3d49f0ca3ba2a
Expand Down Expand Up @@ -558,4 +558,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 72fa28983148c9436f08736f91f61421c635e9b6

COCOAPODS: 1.10.1
COCOAPODS: 1.11.2
42 changes: 18 additions & 24 deletions packages/assurance/README.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,41 @@

# React Native AEP Assurance Extension
# React Native Adobe Experience Platform Assurance Extension

[![npm version](https://img.shields.io/npm/v/@adobe/react-native-aepassurance/alpha?color=green&label=npm%20package)](https://www.npmjs.com/package/@adobe/react-native-aepassurance/v/3.0.0-alpha.1)
[![npm downloads](https://img.shields.io/npm/dm/@adobe/react-native-aepassurance)](https://www.npmjs.com/package/@adobe/react-native-aepassurance/v/3.0.0-alpha.1)

`@adobe/react-native-aepassurance` is a wrapper around the iOS and Android [AEPAssurance SDK](https://aep-sdks.gitbook.io/docs/using-mobile-extensions/adobe-experience-platform-assurance) to allow for integration with React Native applications. Functionality to start Assurance session is provided through JavaScript documented below.
`@adobe/react-native-aepassurance` is a wrapper around the iOS and Android [Adobe Experience Platform Assurance](https://aep-sdks.gitbook.io/docs/using-mobile-extensions/adobe-experience-platform-assurance) to allow for integration with React Native applications. Functionality to start Assurance session is provided through JavaScript documented below.

## Installation
## Prerequisites

The Adobe Experience Platform Assurance extension has the following peer dependency, which must be installed prior to installing the identity extension:
- [Core](../core/README.md)

You need to install the SDK with [npm](https://www.npmjs.com/) and configure the native Android/iOS project in your react native project. Before installing the Assurance extension it is recommended to begin by installing the [Core extension](../core/README.md).

### Install npm package
## Installation

> Requires `@adobe/react-native-aepcore` to be installed.
See [Requirements and Installation](https://github.com/adobe/aepsdk-react-native#requirements) instructions on the main page

Install the `@adobe/react-native-aepassurance` alpha package:
Install the `@adobe/react-native-aepassurance` package:

```bash
cd MyReactApp
npm install @adobe/react-native-aepassurance@3.0.0-alpha.1
npm install @adobe/react-native-aepassurance
```

For iOS development, after installing the plugins from npm, download the pod dependencies by running the following command:
`cd ios && pod install && cd ..`
To update native dependencies to latest available versions, run the following command:
`cd ios && pod update && cd ..`

### Link

[CLI autolink feature](https://github.com/react-native-community/cli/blob/master/docs/autolinking.md) links the module while building the app.

## Usage

### [Assurance](https://aep-sdks.gitbook.io/docs/beta/project-griffon/using-project-griffon)


##### Registering the extension with AEPCore:
### 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).

Initialize the SDK via native code inside your AppDelegate and MainApplication in iOS and Android respectively.
Example:

###### **iOS**
iOS
```objective-c
@import AEPAssurance;

Expand All @@ -63,8 +59,7 @@ To connect to a griffon session by scanning the QR code. Follow [Apple developer
}
```


###### **Android:**
Android
```java
import com.adobe.marketing.mobile.Assurance;

Expand All @@ -76,7 +71,6 @@ public class MainApplication extends Application implements ReactApplication {

MobileCore.setApplication(this);
try {
Identity.registerExtension();
Lifecycle.registerExtension();
Assurance.registerExtension();
MobileCore.configureWithAppID("your-app-ID");
Expand All @@ -93,6 +87,6 @@ To connect to a griffon session by scanning the QR code. Follow the [Android doc
##### Start Assurance session:

```javascript
import {AEPAssurance} from '@adobe/react-native-aepassurance';
AEPAssurance.startSession("{your-assurance-session-url}");
import {Assurance} from '@adobe/react-native-aepassurance';
Assurance.startSession("{your-assurance-session-url}");
```
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ governing permissions and limitations under the License.
*/

import { NativeModules } from 'react-native';
import { AEPAssurance } from '../';
import { Assurance } from '../js';

describe('AEPAssurance', () => {
describe('Assurance', () => {

it('extensionVersion is called', async () => {
expect(AEPAssurance.extensionVersion).toBeDefined();
expect(Assurance.extensionVersion).toBeDefined();
const spy = jest.spyOn(NativeModules.AEPAssurance, 'extensionVersion');
await AEPAssurance.extensionVersion();
await Assurance.extensionVersion();
expect(spy).toHaveBeenCalled();
});

it('startSession is called', async () => {
const spy = jest.spyOn(NativeModules.AEPAssurance, 'startSession');
await AEPAssurance.startSession('');
await Assurance.startSession('');
expect(spy).toHaveBeenCalled();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,23 @@ const RCTAEPAssurance = require('react-native').NativeModules.AEPAssurance;

module.exports = {
/**
* Returns the version of the AEPAssurance extension.
* Returns the version of the Assurance extension.
* @param {string} Promise a promise that resolves with the extension verison
*/
extensionVersion(): Promise<string> {
return Promise.resolve(RCTAEPAssurance.extensionVersion());
},

/**
* Starts an AEPAssurance session.
* Starts an Assurance session.
* Calling this method when a session has already been started results in a no-op, otherwise it attempts
* to initiate a new AEPAssurance session.
* to initiate a new Assurance session.
* A call to this API with an non assurance session url will be ignored
*
* @param url a valid AEPAssurance URL string to start a session
* @param url a valid Assurance URL string to start a session
*/
startSession(url: string) {
RCTAEPAssurance.startSession(url);
},
startSession(url: string) {
RCTAEPAssurance.startSession(url);
},

};
2 changes: 1 addition & 1 deletion packages/assurance/js/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ OF ANY KIND, either express or implied. See the License for the specific languag
governing permissions and limitations under the License.

*/
export class AEPAssurance{
export class Assurance{
static extensionVersion(): Promise<string>;
static startSession(url: string):void;
};
4 changes: 2 additions & 2 deletions packages/assurance/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ governing permissions and limitations under the License.

module.exports = {
// Native modules
get AEPAssurance() {
return require('./AEPAssurance');
get Assurance() {
return require('./Assurance');
},
};
1 change: 0 additions & 1 deletion packages/assurance/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "@adobe/react-native-aepassurance",
"version": "3.0.0-beta.1",
"private": true,
"description": "Adobe Experience Platform support for React Native apps.",
"homepage": "https://aep-sdks.gitbook.io/docs/",
"main": "./js/index.js",
Expand Down