Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
a7442ee
Initialize project
yangyansong-adbe Aug 4, 2021
d6c256e
Init code for react native Edge
cacheung Aug 17, 2021
5ef4134
More updates
cacheung Aug 17, 2021
4ef223f
Update iOS implementation
cacheung Aug 20, 2021
1ff4922
Init project (#13)
yangyansong-adbe Aug 24, 2021
19378f5
add beta acknowledgement
yangyansong-adbe Aug 24, 2021
3750581
Some more Android side change
cacheung Aug 24, 2021
04dc08c
Merge pull request #11 from cacheung/Edge
cacheung Aug 24, 2021
012864e
Merge commit '250fd069e9801aa01c3dea0991dfb792bd2bf7e3' into staging
yangyansong-adbe Aug 25, 2021
abdfb9e
remove user data
yangyansong-adbe Aug 25, 2021
be6f242
Merge the change in main back to staging (#19)
yangyansong-adbe Aug 25, 2021
b5d6c45
bump version (#20)
yangyansong-adbe Aug 25, 2021
2e846f9
Merge branch 'main' into staging
yangyansong-adbe Aug 25, 2021
81d497f
bump version (#21) (#23)
yangyansong-adbe Aug 25, 2021
5633913
Merge branch 'adobe:staging' into staging
yangyansong-adbe Aug 26, 2021
23c71ea
Update badges on readme
yangyansong-adbe Aug 26, 2021
2c133ba
Create README.md
yangyansong-adbe Aug 26, 2021
d22cea1
Adding Assurance package: Podspec + js api’s
PravinPK Aug 26, 2021
db4a0da
Adding Assurance package: iOS bridge layer
PravinPK Aug 26, 2021
28903a5
Adding Assurance package: Android bridge layer
PravinPK Aug 26, 2021
31a306a
Adding Assurance package: ReadMe + tests
PravinPK Aug 26, 2021
0942335
Adding Assurance package: add git ignore files
PravinPK Aug 26, 2021
1111fc8
Update the sample app with Assurance
PravinPK Aug 26, 2021
71f37c9
Merge staging and resolve conflicts
PravinPK Aug 26, 2021
34f8fe1
fix android app launching issue
yangyansong-adbe Aug 26, 2021
eab895d
typo
yangyansong-adbe Aug 26, 2021
75eb08a
Update README.md
yangyansong-adbe Aug 26, 2021
a677605
Update README.md
yangyansong-adbe Aug 26, 2021
1f3eb72
Add startSession test + some renamings
PravinPK Aug 26, 2021
be2f630
Merge pull request #25 from PravinPK/assurance
PravinPK Aug 26, 2021
267ef6d
Merge branch 'staging' of github.com:adobe/aepsdk-react-native into edge
cacheung Aug 26, 2021
0c10327
Fix build probs
PravinPK Aug 26, 2021
99638bd
Update READMEs (#24)
yangyansong-adbe Aug 26, 2021
be16430
Merge pull request #26 from PravinPK/assurance
PravinPK Aug 26, 2021
c46f1ab
[userprofile - staging] clean up package (#28)
yangyansong-adbe Aug 26, 2021
bdc2177
clean up files
cacheung Aug 26, 2021
a893613
Merge branch 'staging' of github.com:adobe/aepsdk-react-native into edge
cacheung Aug 26, 2021
69bcd9d
Update iOS code and clean up files
cacheung Aug 27, 2021
9cd2464
Add unit test and update Readme
cacheung Aug 27, 2021
cca0833
Cleanup few files
cacheung Aug 27, 2021
c4ccc64
Update for review comments
cacheung Aug 28, 2021
9dc35df
Merge branch 'adobe:staging' into staging
yangyansong-adbe Aug 30, 2021
2a34bae
Update README.md
yangyansong-adbe Aug 30, 2021
78ac4b2
Merge pull request #30 from yangyansong-adbe/staging
ahmyr Aug 30, 2021
6cb6146
Update package json for Edge package.
cacheung Aug 30, 2021
0fcc6aa
Add publish Config to Assurance
PravinPK Aug 30, 2021
9f82a4a
update readme file
cacheung Aug 31, 2021
664a802
Revert "update readme file"
cacheung Aug 31, 2021
e3d61dd
Add Edge Identity network extension package
cacheung Sep 1, 2021
c786d8e
Update for Android
cacheung Sep 1, 2021
a07559f
Update copyright (#31)
yangyansong-adbe Sep 1, 2021
84bb0d1
Add comments for registering Identity Edge in the sample app
cacheung Sep 1, 2021
858c4fc
Update sample app
cacheung Sep 2, 2021
88768b8
Update Readme with registerExtension info for Edge Identity
cacheung Sep 2, 2021
dfb628b
update readme.md
cacheung Sep 2, 2021
1b3ca41
Make the assurance package private until official documentation
PravinPK Sep 2, 2021
b040533
add assurance package to readMe
PravinPK Sep 2, 2021
7c6b611
Update with review comments
cacheung Sep 2, 2021
7378117
Update with more review comments
cacheung Sep 2, 2021
f5e8a35
default assurance session URL
PravinPK Sep 2, 2021
1b1c5db
Merge pull request #34 from adobe/assurance
PravinPK Sep 2, 2021
112597c
Update tests and fix few bugs
cacheung Sep 3, 2021
0f935d4
Add the SDK initialization docs to READMEs (#35)
yangyansong-adbe Sep 3, 2021
37bc88c
Update Java Data Bridge for payload EdgeEventHandle and Readme
cacheung Sep 3, 2021
fffa2e5
update for review comments
cacheung Sep 3, 2021
02ec9da
update identity register info
cacheung Sep 3, 2021
b185a42
Update registering info for Readme
cacheung Sep 3, 2021
1058916
Update Readme initializing instruction
cacheung Sep 4, 2021
1441894
remove AEPMobileIdentity.class from Readme
cacheung Sep 4, 2021
6c1ad58
Update Readme and MainApplication.java
cacheung Sep 4, 2021
343d6d0
Remove EdgeIdentityAndIdentity view in sample app and fix typo in iOS…
cacheung Sep 7, 2021
ff0c47a
update project file target to IPHONEOS_DEPLOYMENT_TARGET = 10.0;
cacheung Sep 7, 2021
36ce696
Update with review comments
cacheung Sep 7, 2021
ea5405a
Merge pull request #29 from cacheung/edge
cacheung Sep 7, 2021
bb0b87a
Update edge extension version number
cacheung Sep 7, 2021
ae9c3d2
Update edge Identity version number
cacheung Sep 7, 2021
b1aeb87
Merge branch 'staging' of github.com:adobe/aepsdk-react-native into edge
cacheung Sep 7, 2021
a63a421
Update podfile
cacheung Sep 7, 2021
c2ed018
Merge pull request #36 from cacheung/edge
cacheung Sep 7, 2021
bb78c65
Merge pull request #37 from adobe/edge
cacheung Sep 7, 2021
a6ad606
Merge branch 'staging' of github.com:adobe/aepsdk-react-native into i…
cacheung Sep 7, 2021
7c9d509
Update readme extensions download path
cacheung Sep 7, 2021
d2488ca
Merge pull request #33 from cacheung/identityEdge
cacheung Sep 7, 2021
7973335
Update podfile and minor clean up
cacheung Sep 7, 2021
f1f1158
fix unit test
cacheung Sep 7, 2021
1e72a0b
Merge pull request #38 from cacheung/identityEdge
cacheung Sep 7, 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
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,5 @@ dist

build/
## User settings
xcuserdata/
xcuserdata/
packages/.DS_Store
89 changes: 82 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
# aepsdk-react-native

<!--- [![license](https://img.shields.io/npm/l/@adobe/react-native-aepcore.svg)](./LICENSE) --->
[![license](https://img.shields.io/npm/l/@adobe/react-native-aepcore.svg)](./LICENSE)
[![CircleCI](https://circleci.com/gh/adobe/aepsdk-react-native/tree/main.svg?style=svg)](https://circleci.com/gh/adobe/aepsdk-react-native/tree/main)

## BETA ACKNOWLEDGEMENT

The react native modules containing in this repository are currently in Beta. Use of this code is by invitation only and not otherwise supported by Adobe. Please contact your Adobe Customer Success Manager to learn more.
The React Native modules contained in this repository are currently in Beta. Use of this code is by invitation only and not otherwise supported by Adobe. Please contact your Adobe Customer Success Manager to learn more.

By using the Beta, you hereby acknowledge that the Beta is provided "as is" without warranty of any kind. Adobe shall have no obligation to maintain, correct, update, change, modify or otherwise support the Beta. You are advised to use caution and not to rely in any way on the correct functioning or performance of such Beta and/or accompanying materials.

## About this project

This repository is a monorepo. It contains a collection of AEPSDK React Native modules/packages listed below. These modules/packages 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-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-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.

## Requirements
Expand All @@ -27,9 +28,9 @@ This repository is a monorepo. It contains a collection of AEPSDK React Native m

## Installation

You need to install the SDK with [npm](https://www.npmjs.com/) and configure the native Android/iOS project in your react native project.
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://facebook.github.io/react-native/docs/getting-started.html>) page before continuing.

### Install npm package

Expand All @@ -51,6 +52,80 @@ 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 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`

###### **iOS**
```objective-c
@import AEPCore;
@import AEPServices;
@import AEPSignal;
@import AEPLifecycle;
@import AEPIdentity;
@import AEPUserProfile;
...
@implementation AppDelegate
-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[AEPMobileCore setLogLevel: AEPLogLevelDebug];
[AEPMobileCore configureWithAppId:@"yourAppID"];
[AEPMobileCore registerExtensions: @[AEPMobileIdentity.class, AEPMobileLifecycle.class, AEPMobileSignal.class, AEPMobileUserProfile.class
// register other extensions here
] completion:^{
[AEPMobileCore lifecycleStart:@{@"contextDataKey": @"contextDataVal"}];
}
];

return YES;
}

@end

```

###### **Android:**
```java
import com.adobe.marketing.mobile.AdobeCallback;
import com.adobe.marketing.mobile.Identity;
import com.adobe.marketing.mobile.InvalidInitException;
import com.adobe.marketing.mobile.Lifecycle;
import com.adobe.marketing.mobile.LoggingMode;
import com.adobe.marketing.mobile.MobileCore;
import com.adobe.marketing.mobile.Signal;
import com.adobe.marketing.mobile.UserProfile;
...
import android.app.Application;
...
public class MainApplication extends Application implements ReactApplication {
...
@Override
public void on Create(){
super.onCreate();
...
MobileCore.setApplication(this);
MobileCore.setLogLevel(LoggingMode.DEBUG);
MobileCore.setWrapperType(WrapperType.REACT_NATIVE);

try {
UserProfile.registerExtension();
Identity.registerExtension();
Lifecycle.registerExtension();
Signal.registerExtension();
// register other extensions here
MobileCore.configureWithAppID("yourAppID");
MobileCore.start(new AdobeCallback() {
@Override
public void call(Object o) {
MobileCore.lifecycleStart(null);
}
});
} catch (InvalidInitException e) {
...
}
}
}
```


## Development

Expand Down
20 changes: 19 additions & 1 deletion apps/AEPSampleApp/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import { NavigationContainer } from '@react-navigation/native';
import Profile from './extensions/Profile';
import Core from './extensions/Core';
import Identity from './extensions/Identity';
import EdgeIdentity from './extensions/EdgeIdentity';
import Edge from './extensions/Edge';
import Assurance from './extensions/Assurance';

function HomeScreen({ navigation }) {
return (
Expand All @@ -21,6 +24,18 @@ function HomeScreen({ navigation }) {
onPress={() => navigation.navigate('Identity')}
title="Identity"
/>
<Button
onPress={() => navigation.navigate('Edge')}
title="Edge"
/>
<Button
onPress={() => navigation.navigate('EdgeIdentity')}
title="EdgeIdentity"
/>
<Button
onPress={() => navigation.navigate('Assurance')}
title="Assurance"
/>
</View>
);
}
Expand All @@ -35,7 +50,10 @@ 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="EdgeIdentity" component={EdgeIdentity} />
<Drawer.Screen name="Edge" component={Edge} />
<Drawer.Screen name="Assurance" component={Assurance} />
</Drawer.Navigator>
</NavigationContainer>
);
}
}
32 changes: 32 additions & 0 deletions apps/AEPSampleApp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# AEPSampleApp

> Note: Commands are assuming you're in the root directory of the repository.

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

How to run the sample app:

### Add your App Id:
In `ios/**/AppDelegate.m`, find the call to `configureWithAppId` and add your app id.

In `android/**/MainApplication.java`, find the call to `configureWithAppId` and add your app id.

#### Install dependecies

```
yarn bootstrap && yarn sampleapp:ios:pod:install
```

#### Run instructions for iOS:

```
yarn sampleapp:ios:run
```

#### Run instructions for Android:

Have an Android emulator running (quickest way to get started), or a device connected. https://developer.android.com/studio/run/emulator-commandline

```
yarn sampleapp:android:run
```
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,20 @@
OF ANY KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License.
*/

package com.aepsampleapp;

import android.app.Application;
import android.content.Context;

import com.adobe.marketing.mobile.AdobeCallback;
import com.adobe.marketing.mobile.Assurance;
import com.adobe.marketing.mobile.Identity;
import com.adobe.marketing.mobile.InvalidInitException;
import com.adobe.marketing.mobile.Lifecycle;
import com.adobe.marketing.mobile.LoggingMode;
import com.adobe.marketing.mobile.MobileCore;
import com.adobe.marketing.mobile.Edge;
import com.adobe.marketing.mobile.Signal;
import com.adobe.marketing.mobile.UserProfile;
import com.facebook.react.PackageList;
Expand Down Expand Up @@ -69,10 +72,13 @@ public void onCreate() {
MobileCore.setLogLevel(LoggingMode.DEBUG);
try {
UserProfile.registerExtension();
Identity.registerExtension();
com.adobe.marketing.mobile.Identity.registerExtension();
com.adobe.marketing.mobile.edge.identity.Identity.registerExtension();
Lifecycle.registerExtension();
Signal.registerExtension();
MobileCore.configureWithAppID("yourAppID");
Edge.registerExtension();
Assurance.registerExtension();
MobileCore.configureWithAppID("your-app-ID");
MobileCore.start(new AdobeCallback() {
@Override
public void call(Object o) {
Expand Down
62 changes: 62 additions & 0 deletions apps/AEPSampleApp/extensions/Assurance.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
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';

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

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

return (
<View style={styles.container}>
<ScrollView contentContainerStyle={{ marginTop: 75 }}>
<Button onPress={() => navigation.goBack()} title="Go to main page" />
<Text style={styles.welcome}>Assurance v{version}</Text>
<Button title="Start Session" onPress={startSessionClicked}/>
<TextInput
style={{height: 40, margin: 10}}
placeholder="Paste your Assurance Session URL"
onChangeText={(val) => setsessionURL(val)}
/>
</ScrollView>
</View>
)

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

}

const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 25,
textAlign: 'center',
margin: 10,
marginTop: 80,
}
});
16 changes: 15 additions & 1 deletion apps/AEPSampleApp/extensions/Core.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, {Component} from 'react';
import {Button, Platform, StyleSheet, Text, View, ScrollView, NativeModules} from 'react-native';
import {AEPCore, AEPLifecycle, AEPSignal, AEPMobileLogLevel, AEPMobilePrivacyStatus, AEPMobileVisitorAuthenticationState, AEPVisitorID, AEPExtensionEvent} from '@adobe/react-native-aepcore';
Expand Down Expand Up @@ -28,7 +43,6 @@ export default Core = ({ navigation }) => {
<Button title="AEPLifecycle::extensionVersion()" onPress={lifecycleExtensionVersion}/>
<Text style={styles.welcome}>Signal</Text>
<Button title="AEPSignal::extensionVersion()" onPress={signalExtensionVersion}/>

</ScrollView>
</View>
)
Expand Down
Loading