Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
137 commits
Select commit Hold shift + click to select a range
9e36891
Add getExperienceCloudId API
cacheung Sep 21, 2021
bdaa54e
Update Readme
cacheung Sep 21, 2021
f019b4d
Some more Readme fix
cacheung Sep 21, 2021
458ce85
Merge pull request #48 from cacheung/syncStaging
cacheung Sep 21, 2021
85e6ce6
Update links in Readme
cacheung Sep 21, 2021
55bb9c5
update peer dependency edgeidentity version in messaging wrapper
cacheung Sep 21, 2021
d5d75ee
update peerDependencies version
cacheung Sep 21, 2021
20b1fdf
revert Messaging package.json
cacheung Sep 21, 2021
3833c14
UserProfile (1.0.0-alpha.3) -> staging (#50) (#53)
yangyansong-adbe Sep 22, 2021
010dd42
Update with review comments
cacheung Sep 22, 2021
32ce266
Edge (1.0.0-alpha.2), Messaging (1.0.0-alpha.2) -> staging (#54)
yangyansong-adbe Sep 22, 2021
e438749
Update Edge Wrapper Readme
cacheung Sep 22, 2021
c93100d
update readme
cacheung Sep 22, 2021
10643a1
Merge pull request #56 from cacheung/edgeReadme
cacheung Sep 22, 2021
c1e5d72
Merge branch 'staging' of github.com:adobe/aepsdk-react-native into e…
cacheung Sep 22, 2021
596d224
Update Readme and revert code
cacheung Sep 22, 2021
0155864
update package json for sample app
cacheung Sep 22, 2021
37e8165
Merge pull request #49 from cacheung/edgeIdentity
cacheung Sep 22, 2021
b811484
Fix a typo in sample app
cacheung Sep 22, 2021
7612455
Merge pull request #57 from cacheung/edgeIdentity
cacheung Sep 22, 2021
2a13742
Add promise checking for error case
cacheung Sep 22, 2021
284ce32
Remove the unused import statements (#60)
cacheung Sep 23, 2021
2d6dcbe
EdgeIdentity (1.0.0-alpha.2) -> staging (#59)
yangyansong-adbe Sep 23, 2021
7271b88
fix a typo in readme (#61)
cacheung Sep 23, 2021
a1547ef
Merge branch 'main' into staging
yangyansong-adbe Sep 23, 2021
e67c005
add a new API in Core - resetIdentities (#63) (#64)
yangyansong-adbe Oct 2, 2021
a09ae8e
Merge commit 'b58470acfaf35b5dc6abdabc413233d609de9a51' into staging
yangyansong-adbe Oct 2, 2021
784c618
Update README.md
yangyansong-adbe Oct 4, 2021
f4001a5
add a FAQ section (#66)
yangyansong-adbe Oct 8, 2021
a282e07
add promise reject with error
cacheung Oct 13, 2021
2117c97
Merge branch 'edgeIdentity' into edgeIds
cacheung Oct 13, 2021
72735b2
Merge pull request #68 from cacheung/edgeIds
cacheung Oct 13, 2021
80e46c5
Updated for callback error
cacheung Oct 14, 2021
9f6c744
update to final for handleError parameter
cacheung Oct 14, 2021
1b38b08
update with review feedback
cacheung Oct 15, 2021
253b2cb
Merge pull request #58 from cacheung/promiseCheck
cacheung Oct 15, 2021
9ce3c07
add import statements for RCTAEPEdgeIdentityModule.java
cacheung Oct 15, 2021
7c4ad4d
Merge pull request #70 from cacheung/fixerror
cacheung Oct 15, 2021
6b5ad9a
Consent package setup
emdobrin Nov 1, 2021
a74b9c8
update dependencies
emdobrin Nov 1, 2021
4e105f3
Merge pull request #76 from emdobrin/edge
emdobrin Nov 2, 2021
927170c
Reduce visibility for util classes, cleanup
emdobrin Oct 29, 2021
e7a5c3e
Merge pull request #77 from emdobrin/utils-update
emdobrin Nov 2, 2021
c41641a
Fix consent module
emdobrin Nov 2, 2021
c3ab473
Add consent to iOS sample app
emdobrin Nov 2, 2021
3405b93
Renaming, update dependencies
emdobrin Nov 3, 2021
771949a
Update gradle
emdobrin Nov 5, 2021
875224c
Merge pull request #78 from emdobrin/consent
emdobrin Nov 5, 2021
30ce6f7
Add Edge Identity API in JS and Java (#74)
cacheung Nov 10, 2021
a762178
Added APIs for Consent extension (#80)
emdobrin Nov 12, 2021
ea83cd9
Merge branch 'staging' into consent-br
emdobrin Nov 16, 2021
53fe119
Merge pull request #83 from emdobrin/consent-br
emdobrin Nov 16, 2021
21960e1
fix the release issue: NPM registry enforces a minimum of TLS 1.2 beg…
yangyansong-adbe Nov 16, 2021
e7c9269
EdgeIdentity - Updates on JS public APIs, unit testing, test app (#81)
cacheung Nov 19, 2021
bf0813b
Add Edge Identity API in JS and Java (#74)
cacheung Nov 10, 2021
ac09b0a
EdgeIdentity - Updates on JS public APIs, unit testing, test app (#81)
cacheung Nov 19, 2021
9845670
Merge pull request #88 from emdobrin/edgeidentity-apis
emdobrin Nov 19, 2021
31066e1
Merge pull request #89 from adobe/edgeidentity-apis
emdobrin Nov 19, 2021
9803b20
Edge - renaming, sample app and documentation updates (#87)
emdobrin Nov 22, 2021
6f1135f
Consent - renaming public JS classes (#93)
emdobrin Nov 23, 2021
7218bda
Update Readme for EdgeIdentity (#82)
cacheung Nov 24, 2021
3ee2d0e
Edge Identity iOS implementation (#92)
cacheung Nov 24, 2021
6ce7077
EdgeIdentity - renaming
emdobrin Nov 24, 2021
1e71aab
EdgeIdentity - fix typo
emdobrin Nov 24, 2021
19d6a0a
update readme
cacheung Nov 24, 2021
de3af42
Merge pull request #95 from cacheung/edgeReadme
emdobrin Nov 24, 2021
6a1b536
EdgeIdentity - renaming in Readme
emdobrin Nov 24, 2021
ce1e59c
EdgeIdentity - more renaming
emdobrin Nov 24, 2021
0dd0bd3
Merge pull request #94 from emdobrin/identity-rename
emdobrin Nov 24, 2021
e01891f
Consent - updated return promise
emdobrin Nov 25, 2021
eb8f1f8
Pods update
emdobrin Nov 25, 2021
bbdce3c
Merge pull request #97 from emdobrin/consent
emdobrin Nov 25, 2021
4d33e15
Merge pull request #84 from adobe/consent
emdobrin Nov 25, 2021
893bd3a
Merge branch 'staging' into edge
emdobrin Nov 25, 2021
44ef077
Updated pods
emdobrin Nov 25, 2021
fe3c135
Merge pull request #99 from emdobrin/edge
emdobrin Nov 25, 2021
0003360
Convert native identity map object to js identity map
cacheung Nov 26, 2021
ebb2018
Update identity.js for iterating identity item
cacheung Nov 30, 2021
f91ba69
Core - renaming public JS classes (#102)
yangyansong-adbe Nov 30, 2021
d103245
Add jest tests for getIdentities API
cacheung Dec 1, 2021
423b449
remove an extra line of code
cacheung Dec 1, 2021
4e9dc6c
Core - clean up the sample app (#107)
yangyansong-adbe Dec 1, 2021
5c70ff7
Update getIdentity return promise
cacheung Dec 1, 2021
7ebc9cf
Merge pull request #100 from cacheung/customClassPromise
cacheung Dec 1, 2021
f50a961
Changes for the Beta release. Includes changes in the file names and …
shtomar-adb Dec 2, 2021
012ebdf
Updated the unit tests for Messaging.
shtomar-adb Dec 2, 2021
87b483f
Merge the staging branch.
shtomar-adb Dec 2, 2021
820e4a6
Merge branch 'staging' of github.com:adobe/aepsdk-react-native into e…
cacheung Dec 2, 2021
4576ca2
Update Sample App
cacheung Dec 2, 2021
55a2584
Merge branch 'staging' of github.com:adobe/aepsdk-react-native into e…
cacheung Dec 2, 2021
6431162
update app.js and remove an extra file
cacheung Dec 2, 2021
68dd6bd
UserProfile -> staging : rename JS classes (#108)
yangyansong-adbe Dec 2, 2021
a8d1ff5
Merge pull request #111 from cacheung/EdgeIdentityStaging
emdobrin Dec 2, 2021
8405aa1
Merge pull request #110 from cacheung/edgeStaging
cacheung Dec 2, 2021
d5b9a7d
Fixed code review comments.
shtomar-adb Dec 2, 2021
af8b1ba
Merged the staging branch.
shtomar-adb Dec 2, 2021
44f05f0
Removed merge conflicts.
shtomar-adb Dec 2, 2021
f1adeff
Updated the Readme.md
shtomar-adb Dec 3, 2021
ba97fbf
Updated Readme.
shtomar-adb Dec 3, 2021
9963ebd
Add return promise custom type
cacheung Dec 3, 2021
2800d6f
Remove Static for from Readme
cacheung Dec 3, 2021
59910f2
remove styles in EdgeIdentityView
cacheung Dec 3, 2021
bc77f57
revert consent sample app style change
cacheung Dec 3, 2021
acc9e61
move text and breakline to styles
cacheung Dec 3, 2021
49ffb34
remove static in Readme and update sample app style
cacheung Dec 3, 2021
6a602cc
Merge pull request #115 from cacheung/EdgeIdentityStaging
emdobrin Dec 3, 2021
6dd5ac4
Merge pull request #117 from cacheung/consent
emdobrin Dec 3, 2021
d094987
Update Edge.js for return catch error
cacheung Dec 3, 2021
7e30e3a
check null for promise return custom class
cacheung Dec 4, 2021
434d464
update with review feedback
cacheung Dec 4, 2021
200b167
Merge pull request #114 from cacheung/edgeStaging
emdobrin Dec 4, 2021
a621c3d
Fix return type for ts
emdobrin Dec 4, 2021
8028761
Merge pull request #119 from adobe/consent
emdobrin Dec 4, 2021
3eb20c0
Merge pull request #109 from adobe/messaging
emdobrin Dec 4, 2021
4d4fb16
Update syntax for sendEvent
emdobrin Dec 4, 2021
53dd1af
Merge pull request #120 from emdobrin/edge
emdobrin Dec 4, 2021
84436c5
Merge branch 'staging' into edge
emdobrin Dec 4, 2021
48778d5
Merge pull request #121 from emdobrin/edge
emdobrin Dec 4, 2021
e54c705
enum support for AuthenticatedState in ts
cacheung Dec 5, 2021
c654d82
remove extra spaces
cacheung Dec 5, 2021
4bbbe80
fixed typo
cacheung Dec 5, 2021
1e58375
Merge pull request #98 from adobe/edge
emdobrin Dec 14, 2021
77a673f
Merge pull request #122 from cacheung/EdgeIdentityStaging
cacheung Dec 14, 2021
b06ece5
merge from staging
cacheung Dec 14, 2021
0bad1df
Core -> staging: add enum support in d.ts file (#124)
yangyansong-adbe Dec 14, 2021
f213b4a
Rename Items to IdentityMap
cacheung Dec 14, 2021
cf0fab0
Merge pull request #125 from cacheung/edgeStaging
emdobrin Dec 15, 2021
29855d7
Merge pull request #116 from adobe/edgeIdentity
emdobrin Dec 15, 2021
9ed4c4e
Update Readme with initializing information for Edge extensions
cacheung Dec 15, 2021
b5ece34
update Readme files with the review comments
cacheung Dec 15, 2021
cac2014
Update few Readme format
cacheung Dec 15, 2021
c41b962
Merge pull request #126 from cacheung/staging
emdobrin Dec 16, 2021
c1f1f45
update version alpha -> beta (#127)
yangyansong-adbe Dec 16, 2021
a33cc0e
Move from Assurance_publish branch to staging (#128)
PravinPK Dec 17, 2021
634a936
Main README cleanup (#130)
yangyansong-adbe Dec 17, 2021
b94f7a3
REAME cleanup (#132)
yangyansong-adbe Dec 17, 2021
b2ae24c
Bug fix: correct error handling logic (#133)
yangyansong-adbe Dec 20, 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
4 changes: 2 additions & 2 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
run: yarn bootstrap
- name: Authenticate with Registry
run: |
echo "@adobe:registry=http://registry.npmjs.org/" > .npmrc
echo "registry=http://registry.npmjs.org/" >> .npmrc
echo "@adobe:registry=https://registry.npmjs.org/" > .npmrc
echo "registry=https://registry.npmjs.org/" >> .npmrc
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
npm whoami
env: # More info about the environment variables in the README
Expand Down
54 changes: 38 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ This repository is a monorepo. It contains a collection of Adobe Experience Plat
| [@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-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 Expand Up @@ -65,15 +66,28 @@ Initializing the SDK should be done in native code inside your `AppDelegate` (iO
@import AEPServices;
@import AEPSignal;
@import AEPLifecycle;
@import AEPIdentity;
@import AEPUserProfile;
@import AEPEdge;
@import AEPEdgeIdentity;
@import AEPEdgeConsent;
//@import AEPMessaging;
//@import AEPUserProfile;
//@import AEPAssurance;
//@import AEPIdentity;
...
@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
[AEPMobileCore registerExtensions: @[
AEPMobileLifecycle.class,
AEPMobileSignal.class,
AEPMobileEdge.class,
AEPMobileEdgeIdentity.class,
AEPMobileEdgeConsent.class,
//AEPMobileIdentity.class,
//AEPMobileUserProfile.class,
//AEPMobileMessaging.class,
//AEPMobileAssurance.class,
] completion:^{
[AEPMobileCore lifecycleStart:@{@"contextDataKey": @"contextDataVal"}];
}
Expand All @@ -93,13 +107,16 @@ Initializing the SDK should be done in native code inside your `AppDelegate` (iO
###### **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.Lifecycle;
import com.adobe.marketing.mobile.Signal;
import com.adobe.marketing.mobile.UserProfile;
import com.adobe.marketing.mobile.MobileCore;
import com.adobe.marketing.mobile.Edge;
import com.adobe.marketing.mobile.edge.consent.Consent;
//import com.adobe.marketing.mobile.Messaging;
//import com.adobe.marketing.mobile.UserProfile;
//import com.adobe.marketing.mobile.Assurance;
...
import android.app.Application;
...
Expand All @@ -111,14 +128,16 @@ public class MainApplication extends Application implements ReactApplication {
...
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
Lifecycle.registerExtension();
Signal.registerExtension();
com.adobe.marketing.mobile.edge.identity.Identity.registerExtension();
Edge.registerExtension();
Consent.registerExtension();
//Messaging.registerExtension();
//Assurance.registerExtension();
//UserProfile.registerExtension();
//com.adobe.marketing.mobile.Identity.registerExtension();
MobileCore.configureWithAppID("yourAppID");
MobileCore.start(new AdobeCallback() {
@Override
Expand All @@ -138,6 +157,9 @@ public class MainApplication extends Application implements ReactApplication {

See [development.md](./docs/development.md) for development docs.

## Frequently Asked Questions (FAQ)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no content under FAQ, let remove it?



## Contributing
See [CONTRIBUTING](CONTRIBUTING.md)

Expand Down
54 changes: 30 additions & 24 deletions apps/AEPSampleApp/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,47 @@ import * as React from 'react';
import { Button, View, Text } from 'react-native';
import { createDrawerNavigator } from '@react-navigation/drawer';
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';
import ProfileView from './extensions/ProfileView';
import MessagingView from './extensions/MessagingView';
import CoreView from './extensions/CoreView';
import IdentityView from './extensions/IdentityView';
import EdgeIdentity from './extensions/EdgeIdentityView';
import ConsentView from './extensions/ConsentView';
import EdgeView from './extensions/EdgeView';
import AssuranceView from './extensions/AssuranceView';

function HomeScreen({ navigation }) {
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Button
onPress={() => navigation.navigate('Core')}
onPress={() => navigation.navigate('CoreView')}
title="Core/Lifecycle/Signal"
/>
<Button
onPress={() => navigation.navigate('Profile')}
onPress={() => navigation.navigate('ProfileView')}
title="UserProfile"
/>
<Button
onPress={() => navigation.navigate('Identity')}
onPress={() => navigation.navigate('IdentityView')}
title="Identity"
/>
<Button
onPress={() => navigation.navigate('Messaging')}
title="Messaging"/>
onPress={() => navigation.navigate('MessagingView')}
title="Messaging" />
<Button
onPress={() => navigation.navigate('Edge')}
onPress={() => navigation.navigate('EdgeView')}
title="Edge"
/>
<Button
onPress={() => navigation.navigate('EdgeIdentity')}
onPress={() => navigation.navigate('EdgeIdentityView')}
title="EdgeIdentity"
/>
<Button
onPress={() => navigation.navigate('Assurance')}
onPress={() => navigation.navigate('ConsentView')}
title="Consent"
/>
<Button
onPress={() => navigation.navigate('AssuranceView')}
title="Assurance"
/>
</View>
Expand All @@ -51,14 +56,15 @@ export default function App() {
<NavigationContainer>
<Drawer.Navigator initialRouteName="Home">
<Drawer.Screen name="Home" component={HomeScreen} />
<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} />
</Drawer.Navigator>
</NavigationContainer>
<Drawer.Screen name="CoreView" component={CoreView} />
<Drawer.Screen name="ProfileView" component={ProfileView} />
<Drawer.Screen name="IdentityView" component={IdentityView} />
<Drawer.Screen name="MessagingView" component={MessagingView} />
<Drawer.Screen name="EdgeView" component={EdgeView} />
<Drawer.Screen name="EdgeIdentityView" component={EdgeIdentityView} />
<Drawer.Screen name="ConsentView" component={ConsentView} />
<Drawer.Screen name="AssuranceView" component={AssuranceView} />
</Drawer.Navigator >
</NavigationContainer >
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@

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.Messaging;
import com.adobe.marketing.mobile.MobileCore;
import com.adobe.marketing.mobile.Edge;
import com.adobe.marketing.mobile.edge.consent.Consent;
import com.adobe.marketing.mobile.Signal;
import com.adobe.marketing.mobile.UserProfile;
import com.facebook.react.PackageList;
Expand Down Expand Up @@ -77,20 +77,22 @@ 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();
Consent.registerExtension();
Messaging.registerExtension();
Assurance.registerExtension();
MobileCore.configureWithAppID("your-app-ID");
MobileCore.start(new AdobeCallback() {
@Override
public void call(Object o) {
MobileCore.lifecycleStart(null);
}
});
} catch (InvalidInitException e) {
e.printStackTrace();
}

MobileCore.configureWithAppID("your-app-ID");
MobileCore.start(new AdobeCallback() {
@Override
public void call(Object o) {
MobileCore.lifecycleStart(null);
}
});
}

/**
Expand Down
4 changes: 2 additions & 2 deletions apps/AEPSampleApp/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ buildscript {
}
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:4.1.0")
Expand All @@ -32,8 +32,8 @@ allprojects {
}

google()
jcenter()
maven { url 'https://www.jitpack.io' }
mavenCentral()
jcenter()
}
}
2 changes: 1 addition & 1 deletion apps/AEPSampleApp/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
presets: ['module:metro-react-native-babel-preset']
};
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
66 changes: 66 additions & 0 deletions apps/AEPSampleApp/extensions/ConsentView.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/*
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, ScrollView} from 'react-native';
import {Consent} from '@adobe/react-native-aepedgeconsent';
import {MobileCore} from '@adobe/react-native-aepcore';
import styles from '../styles/styles';

export default ConsentView = ({ navigation }) => {
const [version, setVersion] = useState('');
const [consents, setConsents] = useState('');
Consent.extensionVersion().then(version => setVersion(version));

function getConsents() {
var consents = {"consents" : {"collect" : {"val": "n"}}};
Consent.getConsents().then(currentConsents => {
let consentsStr = JSON.stringify(currentConsents);
setConsents(consentsStr);
console.log("AdobeExperienceSDK: Consent.getConsents returned current consent preferences: " + consentsStr);
}).catch((error) => {
console.warn("AdobeExperienceSDK: Consent.getConsents returned error: ", error);
});
}

return (
<View style={styles.container}>
<ScrollView contentContainerStyle={{ marginTop: 75 }}>
<Button onPress={() => navigation.goBack()} title="Go to main page" />
<Text style={styles.welcome}>Consent v{version}</Text>
<Button title="Set Default Consent - Yes" onPress={() => setDefaultConsent(true)}/>
<Button title="Set Collect Consent - Yes" onPress={() => updateCollectConsent(true)}/>
<Button title="Set Collect Consent - No" onPress={() => updateCollectConsent(false)}/>
<Button title="Get Consents" onPress={getConsents}/>
<View style={styles.breakLine}/>
<Text style={styles.text}>{consents}</Text>
</ScrollView>
</View>
)
}

function updateCollectConsent(allowed: boolean) {
var collectConsentStatus = allowed ? {"val": "y"} : {"val": "n"};

var consents: {[keys: string]: any} = {"consents" : {"collect" : collectConsentStatus}};
Consent.update(consents);
console.log("AdobeExperienceSDK: Consent.update called with: " + JSON.stringify(consents));
}

function setDefaultConsent(allowed: boolean) {
var collectConsentStatus = allowed ? {"val": "y"} : {"val": "n"};
var defaultConsents: {[keys: string]: any} = {"consent.default": {"consents" : {"collect" : collectConsentStatus}}};
MobileCore.updateConfiguration(defaultConsents);
}
Loading