Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
b27eebf
UserProfile (1.0.0-alpha.2) to main (#22)
yangyansong-adbe Aug 25, 2021
db7b2d7
Added AJO Messaging RN package and sample app.
shtomar-adb Aug 31, 2021
18eec02
Code review feedback implementation
shtomar-adb Sep 1, 2021
67f72d7
Add Assurance package
PravinPK Sep 2, 2021
2925c56
Merge pull request #39 from adobe/edgeIdentity
cacheung Sep 7, 2021
22819c6
Merge branch 'main' into staging
cacheung Sep 7, 2021
9568df5
Update edge package.json with edgeidentity as dependency (#41)
cacheung Sep 7, 2021
a3b3de7
Updated Readme for Messaging RN package
shtomar-adb Sep 8, 2021
fcf1146
Merged upstream staging and resolved merge conflicts
shtomar-adb Sep 8, 2021
2bdb71c
Code review feedback
shtomar-adb Sep 8, 2021
9ec3164
Updated Readme.md
shtomar-adb Sep 8, 2021
89a1084
Updated the Readme as per code review feedback.
shtomar-adb Sep 8, 2021
199a573
Update README.md
sbenedicadb Sep 10, 2021
53998b4
Merge pull request #42 from adobe/messaging-readme
shtomar-adb Sep 10, 2021
047f9cb
Added gitignore in messaging package and minor change in Readme.
shtomar-adb Sep 10, 2021
19271ee
Merge pull request #32 from adobe/messaging
shtomar-adb Sep 10, 2021
d4c5ec4
Update readme for installation of Assurance alpa version
PravinPK Sep 16, 2021
7a0d6ce
Warning Note downloading wrong Assurance version
PravinPK Sep 16, 2021
8d8d5e9
Update the broken reactnative homepage link
PravinPK Sep 16, 2021
d6665c5
Update the package name
PravinPK Sep 16, 2021
c467eec
Link to assurance install instructions
PravinPK Sep 16, 2021
59163a5
Fix link
PravinPK Sep 16, 2021
97f4e8a
Merge pull request #46 from PravinPK/staging
PravinPK Sep 16, 2021
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
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,20 @@ By using the Beta, you hereby acknowledge that the Beta is provided "as is" with

## About this project

This repository is a monorepo. It contains a collection of Adobe Experience Platform Mobile SDK React Native modules listed below. These modules can be found in the [packages](./packages) directory.
This repository is a monorepo. It contains a collection of Adobe Experience Platform Mobile SDK React Native modules listed below. These modules can be found in the [packages](./packages) directory.
| Package Name | Latest Version |
| ---- | ---- |
| [@adobe/react-native-aepcore (required)](./packages/core) | [![npm version](https://badge.fury.io/js/%40adobe%2Freact-native-aepcore.svg)](https://www.npmjs.com/package/@adobe/react-native-aepcore) [![npm downloads](https://img.shields.io/npm/dm/@adobe/react-native-aepcore)](https://www.npmjs.com/package/@adobe/react-native-aepcore) |
| [@adobe/react-native-aepuserprofile](./packages/userprofile) | [![npm version](https://badge.fury.io/js/%40adobe%2Freact-native-aepuserprofile.svg)](https://www.npmjs.com/package/@adobe/react-native-aepuserprofile) [![npm downloads](https://img.shields.io/npm/dm/@adobe/react-native-aepuserprofile)](https://www.npmjs.com/package/@adobe/react-native-aepuserprofile)
| [@adobe/react-native-aepedge](./packages/edge) | [![npm version](https://badge.fury.io/js/%40adobe%2Freact-native-aepedge.svg)](https://www.npmjs.com/package/@adobe/react-native-aepedge) [![npm downloads](https://img.shields.io/npm/dm/@adobe/react-native-aepedge)](https://www.npmjs.com/package/@adobe/react-native-aepedge) |
| [@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-aepassurance](./packages/assurance) | To be released |


| [@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-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.

> Note: @adobe/react-native-aepassurance <=2.0 is not compatible with @adobe/react-native-aepcore. Please use @adobe/react-native-aepassurance [3.x alpha versions or above](./packages/assurance#install-npm-package)

## Requirements

- React Native >= v0.60.0
Expand All @@ -32,7 +33,7 @@ This repository is a monorepo. It contains a collection of Adobe Experience Plat

You need to install the SDK with [npm](https://www.npmjs.com/) and configure the native Android/iOS project in your React Native project.

> Note: If you are new to React Native, we suggest you follow the [React Native Getting Started](<https://facebook.github.io/react-native/docs/getting-started.html>) page before continuing.
> Note: If you are new to React Native, we suggest you follow the [React Native Getting Started](<https://reactnative.dev>) page before continuing.

### Install npm package

Expand All @@ -54,7 +55,7 @@ To update native dependencies to latest available versions, run the following co

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

### Initializing
### Initializing

Initializing the SDK should be done in native code inside your `AppDelegate` (iOS) and `MainApplication` (Android). The following code snippets demonstrate how to import and register the Mobile Core, Identity, Lifecycle, Signal, and Profile extensions. For other extensions, the documentation on how to initialize the extension can be found in `./packages/{extension}/README.md`

Expand Down Expand Up @@ -85,6 +86,10 @@ Initializing the SDK should be done in native code inside your `AppDelegate` (iO

```

> Note : While running iOS application after AEPSDK installation. If you have build error that states:
> "ld: warning: Could not find or use auto-linked library 'swiftCoreFoundation'"
> This is because AEPSDK now requires the app uses swift interfaces. Add a dummy .swift file to your project to embed the swift standard libs. See the SampleApp presented in this repo for example.

###### **Android:**
```java
import com.adobe.marketing.mobile.AdobeCallback;
Expand Down
5 changes: 5 additions & 0 deletions apps/AEPSampleApp/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { NavigationContainer } from '@react-navigation/native';
import Profile from './extensions/Profile';
import Core from './extensions/Core';
import Identity from './extensions/Identity';
import Messaging from './extensions/Messaging';
import EdgeIdentity from './extensions/EdgeIdentity';
import Edge from './extensions/Edge';
import Assurance from './extensions/Assurance';
Expand All @@ -24,6 +25,9 @@ function HomeScreen({ navigation }) {
onPress={() => navigation.navigate('Identity')}
title="Identity"
/>
<Button
onPress={() => navigation.navigate('Messaging')}
title="Messaging"/>
<Button
onPress={() => navigation.navigate('Edge')}
title="Edge"
Expand All @@ -50,6 +54,7 @@ export default function App() {
<Drawer.Screen name="Core" component={Core} />
<Drawer.Screen name="Profile" component={Profile} />
<Drawer.Screen name="Identity" component={Identity} />
<Drawer.Screen name="Messaging" component={Messaging}/>
<Drawer.Screen name="EdgeIdentity" component={EdgeIdentity} />
<Drawer.Screen name="Edge" component={Edge} />
<Drawer.Screen name="Assurance" component={Assurance} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.adobe.marketing.mobile.InvalidInitException;
import com.adobe.marketing.mobile.Lifecycle;
import com.adobe.marketing.mobile.LoggingMode;
import com.adobe.marketing.mobile.Messaging;
import com.adobe.marketing.mobile.MobileCore;
import com.adobe.marketing.mobile.Edge;
import com.adobe.marketing.mobile.Signal;
Expand All @@ -31,6 +32,7 @@
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.soloader.SoLoader;

import java.lang.reflect.InvocationTargetException;
import java.util.List;

Expand Down Expand Up @@ -75,8 +77,9 @@ public void onCreate() {
com.adobe.marketing.mobile.Identity.registerExtension();
com.adobe.marketing.mobile.edge.identity.Identity.registerExtension();
Lifecycle.registerExtension();
Signal.registerExtension();
Signal.registerExtension();
Edge.registerExtension();
Messaging.registerExtension();
Assurance.registerExtension();
MobileCore.configureWithAppID("your-app-ID");
MobileCore.start(new AdobeCallback() {
Expand All @@ -88,7 +91,6 @@ public void call(Object o) {
} catch (InvalidInitException e) {
e.printStackTrace();
}

}

/**
Expand Down
15 changes: 15 additions & 0 deletions apps/AEPSampleApp/extensions/Assurance.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
Copyright 2021 Adobe. All rights reserved.
This file is licensed to you under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy
of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
OF ANY KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License.

@flow
@format
*/

import React, {useState,Component} from 'react';
import {Button, StyleSheet, Text, View, TextInput, ScrollView} from 'react-native';
import {AEPAssurance} from '@adobe/react-native-aepassurance';
Expand Down
21 changes: 4 additions & 17 deletions apps/AEPSampleApp/extensions/Core.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ governing permissions and limitations under the License.
@format
*/

import React, {Component} from 'react';
import {Button, Platform, StyleSheet, Text, View, ScrollView, NativeModules} from 'react-native';
import React from 'react';
import {Button, Text, View, ScrollView, NativeModules} from 'react-native';
import {AEPCore, AEPLifecycle, AEPSignal, AEPMobileLogLevel, AEPMobilePrivacyStatus, AEPMobileVisitorAuthenticationState, AEPVisitorID, AEPExtensionEvent} from '@adobe/react-native-aepcore';
import styles from '../styles/styles';

export default Core = ({ navigation }) => {

Expand Down Expand Up @@ -117,18 +118,4 @@ function getPrivacyStatus() {
}
function log() {
AEPCore.log(AEPMobileLogLevel.ERROR, "React Native Tag", "React Native Message");
}

const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 22,
textAlign: 'center',
margin: 10,
}
});
}
21 changes: 4 additions & 17 deletions apps/AEPSampleApp/extensions/Identity.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ governing permissions and limitations under the License.
@format
*/

import React, {Component} from 'react';
import {Button, StyleSheet, Text, View, ScrollView} from 'react-native';
import React from 'react';
import {Button, Text, View, ScrollView} from 'react-native';
import {AEPIdentity, AEPMobileVisitorAuthenticationState} from '@adobe/react-native-aepcore';
import styles from '../styles/styles';

export default Identity = ({ navigation }) => {

Expand Down Expand Up @@ -66,18 +67,4 @@ function getIdentifiers() {

function getExperienceCloudId() {
AEPIdentity.getExperienceCloudId().then(cloudId => console.log("AdobeExperienceSDK: CloudID = " + cloudId));
}

const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 22,
textAlign: 'center',
margin: 10,
}
});
}
29 changes: 29 additions & 0 deletions apps/AEPSampleApp/extensions/Messaging.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
Copyright 2021 Adobe. All rights reserved.
This file is licensed to you under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy
of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
OF ANY KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License.

@format
*/

import React from 'react';
import {Button, Text, View, ScrollView} from 'react-native';
import { AEPMessaging } from '@adobe/react-native-aepmessaging';
import styles from '../styles/styles';

const messagingExtensionVersion = () => AEPMessaging.extensionVersion().then(version => console.log("AdobeExperienceSDK: AEPMessaging version: " + version));
export default ({ navigation }) => (
<View style={styles.container}>
<ScrollView contentContainerStyle={{ marginTop: 75 }} >
<Button onPress={() => navigation.goBack()} title="Go to main page" />
<Text style={styles.welcome}>Messaging</Text>
<Button title="extensionVersion()" onPress={messagingExtensionVersion}/>
</ScrollView>
</View>
);
21 changes: 4 additions & 17 deletions apps/AEPSampleApp/extensions/Profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ governing permissions and limitations under the License.
@format
*/

import React, {Component} from 'react';
import {Button, StyleSheet, Text, View, ScrollView} from 'react-native';
import React from 'react';
import {Button, Text, View, ScrollView} from 'react-native';
import {AEPUserProfile} from '@adobe/react-native-aepuserprofile';
import styles from '../styles/styles';

export default Profile = ({ navigation }) => {

Expand Down Expand Up @@ -48,18 +49,4 @@ function removeUserAttributes() {

function getUserAttributes(){
AEPUserProfile.getUserAttributes(["mapKey", "mapKey1"]).then(map => console.log("AdobeExperienceSDK: AEPUserProfile getUserAttributes: " +map));
}

const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 22,
textAlign: 'center',
margin: 10,
}
});
}
Loading