Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
155a829
Merge pull request #40 from adobe/staging
cacheung Sep 7, 2021
fc2d4bf
Merge pull request #43 from adobe/staging
shtomar-adb Sep 11, 2021
965a34c
Merge pull request #47 from adobe/staging
PravinPK Sep 16, 2021
45b475e
UserProfile (1.0.0-alpha.3) -> staging (#50) (#51)
yangyansong-adbe Sep 21, 2021
3833c14
UserProfile (1.0.0-alpha.3) -> staging (#50) (#53)
yangyansong-adbe 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
36806b1
Edge (1.0.0-alpha.2), Messaging (1.0.0-alpha.2) -> main (#55)
yangyansong-adbe Sep 22, 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
b58470a
EdgeIdentity (1.0.0-alpha.2) -> main (#62)
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
9f61265
Core (1.0.0-alpha.2) -> main (#65)
yangyansong-adbe Oct 4, 2021
f4001a5
add a FAQ section (#66)
yangyansong-adbe Oct 8, 2021
6b5ad9a
Consent package setup
emdobrin Nov 1, 2021
a74b9c8
update dependencies
emdobrin Nov 1, 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
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
6f1135f
Consent - renaming public JS classes (#93)
emdobrin Nov 23, 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
f91ba69
Core - renaming public JS classes (#102)
yangyansong-adbe Nov 30, 2021
111fb06
Merge commit 'f91ba6927e40f41570fa006d4532daed2d5eb635' into userprofile
yangyansong-adbe Dec 1, 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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ 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) |

Expand Down Expand Up @@ -138,6 +139,9 @@ public class MainApplication extends Application implements ReactApplication {

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

## Frequently Asked Questions (FAQ)


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

Expand Down
8 changes: 7 additions & 1 deletion apps/AEPSampleApp/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import Core from './extensions/Core';
import Identity from './extensions/Identity';
import Messaging from './extensions/Messaging';
import EdgeIdentity from './extensions/EdgeIdentity';
import ConsentView from './extensions/ConsentView';
import Edge from './extensions/Edge';
import Assurance from './extensions/Assurance';

Expand Down Expand Up @@ -36,6 +37,10 @@ function HomeScreen({ navigation }) {
onPress={() => navigation.navigate('EdgeIdentity')}
title="EdgeIdentity"
/>
<Button
onPress={() => navigation.navigate('ConsentView')}
title="Consent"
/>
<Button
onPress={() => navigation.navigate('Assurance')}
title="Assurance"
Expand All @@ -55,8 +60,9 @@ export default function App() {
<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="EdgeIdentity" component={EdgeIdentity} />
<Drawer.Screen name="ConsentView" component={ConsentView} />
<Drawer.Screen name="Assurance" component={Assurance} />
</Drawer.Navigator>
</NavigationContainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
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 @@ -79,6 +80,7 @@ public void onCreate() {
Lifecycle.registerExtension();
Signal.registerExtension();
Edge.registerExtension();
Consent.registerExtension();
Messaging.registerExtension();
Assurance.registerExtension();
MobileCore.configureWithAppID("your-app-ID");
Expand Down
91 changes: 91 additions & 0 deletions apps/AEPSampleApp/extensions/ConsentView.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
/*
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 {AEPCore} from '@adobe/react-native-aepcore';

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}}};
AEPCore.updateConfiguration(defaultConsents);
}

const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 22,
textAlign: 'center',
margin: 10,
},
text: {
fontSize: 15,
textAlign: 'center',
margin: 5,
},
breakLine: {
borderWidth: 0.5,
borderColor: 'black',
margin: 10,
marginTop: 10,
marginBottom: 10,
}
});
70 changes: 38 additions & 32 deletions apps/AEPSampleApp/extensions/Core.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,64 +14,65 @@ governing permissions and limitations under the License.
*/

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 { 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 }) => {

return (
<View style={styles.container}>
<ScrollView contentContainerStyle={{ marginTop: 75 }}>
<ScrollView contentContainerStyle={{ marginTop: 75 }}>
<Button onPress={() => navigation.goBack()} title="Go to main page" />
<Text style={styles.welcome}>Core</Text>
<Button title="extensionVersion()" onPress={coreExtensionVersion}/>
<Button title="updateConfiguration" onPress={updateConfiguration}/>
<Button title="setPrivacyStatus(OptIn)" onPress={setPrivacyOptIn}/>
<Button title="getPrivacyStatus()" onPress={getPrivacyStatus}/>
<Button title="log(...)" onPress={log}/>
<Button title="setLogLevel(AEPMobileLogLevel.VERBOSE)" onPress={setLogLevel}/>
<Button title="getLogLevel()" onPress={getLogLevel}/>
<Button title="setPushIdentifier()" onPress={setPushIdentifier}/>
<Button title="setAdvertisingIdentifier()" onPress={setAdvertisingIdentifier}/>
<Button title="getSdkIdentities()" onPress={getSdkIdentities}/>
<Button title="collectPii()" onPress={collectPii}/>
<Button title="trackAction()" onPress={trackAction}/>
<Button title="trackState()" onPress={trackState}/>
<Button title="dispatchEvent()" onPress={dispatchEvent}/>
<Button title="dispatchEventWithResponseCallback()" onPress={dispatchEventWithResponseCallback}/>
<Button title="extensionVersion()" onPress={coreExtensionVersion} />
<Button title="updateConfiguration" onPress={updateConfiguration} />
<Button title="setPrivacyStatus(OptIn)" onPress={setPrivacyOptIn} />
<Button title="getPrivacyStatus()" onPress={getPrivacyStatus} />
<Button title="log(...)" onPress={log} />
<Button title="setLogLevel(AEPMobileLogLevel.VERBOSE)" onPress={setLogLevel} />
<Button title="getLogLevel()" onPress={getLogLevel} />
<Button title="setPushIdentifier()" onPress={setPushIdentifier} />
<Button title="setAdvertisingIdentifier()" onPress={setAdvertisingIdentifier} />
<Button title="getSdkIdentities()" onPress={getSdkIdentities} />
<Button title="collectPii()" onPress={collectPii} />
<Button title="trackAction()" onPress={trackAction} />
<Button title="trackState()" onPress={trackState} />
<Button title="dispatchEvent()" onPress={dispatchEvent} />
<Button title="dispatchEventWithResponseCallback()" onPress={dispatchEventWithResponseCallback} />
<Button title="resetIdentities()" onPress={resetIdentities} />
<Text style={styles.welcome}>Lifecycle</Text>
<Button title="AEPLifecycle::extensionVersion()" onPress={lifecycleExtensionVersion}/>
<Button title="AEPLifecycle::extensionVersion()" onPress={lifecycleExtensionVersion} />
<Text style={styles.welcome}>Signal</Text>
<Button title="AEPSignal::extensionVersion()" onPress={signalExtensionVersion}/>
</ScrollView>
</View>
<Button title="AEPSignal::extensionVersion()" onPress={signalExtensionVersion} />
</ScrollView>
</View>
)
}

function trackAction(){
AEPCore.trackAction("action name", {"key": "value"});
function trackAction() {
AEPCore.trackAction("action name", { "key": "value" });
}

function trackState(){
AEPCore.trackState("state name", {"key": "value"});
function trackState() {
AEPCore.trackState("state name", { "key": "value" });
}

function setPushIdentifier(){
function setPushIdentifier() {
AEPCore.setPushIdentifier("xxx");
}

function collectPii() {
AEPCore.collectPii({"myPii": "data"});
AEPCore.collectPii({ "myPii": "data" });
}

function dispatchEvent() {
var event = new AEPExtensionEvent("eventName", "eventType", "eventSource", {"testDataKey": "testDataValue"});
var event = new AEPExtensionEvent("eventName", "eventType", "eventSource", { "testDataKey": "testDataValue" });
AEPCore.dispatchEvent(event);
}

function dispatchEventWithResponseCallback() {
var event = new AEPExtensionEvent("eventName", "eventType", "eventSource", {"testDataKey": "testDataValue"});
var event = new AEPExtensionEvent("eventName", "eventType", "eventSource", { "testDataKey": "testDataValue" });
AEPCore.dispatchEventWithResponseCallback(event).then(responseEvent => console.log("AdobeExperienceSDK: responseEvent = " + responseEvent));
}

Expand All @@ -81,8 +82,8 @@ function setAdvertisingIdentifier() {
function getSdkIdentities() {
AEPCore.getSdkIdentities().then(identities => console.log("AdobeExperienceSDK: Identities = " + identities));
}
function updateConfiguration(){
AEPCore.updateConfiguration({"global.privacy":"optedout"});
function updateConfiguration() {
AEPCore.updateConfiguration({ "global.privacy": "optedout" });
}

function getLogLevel() {
Expand Down Expand Up @@ -116,6 +117,11 @@ function setPrivacyOptIn() {
function getPrivacyStatus() {
AEPCore.getPrivacyStatus().then(status => console.log("AdobeExperienceSDK: Privacy Status = " + status));
}

function log() {
AEPCore.log(AEPMobileLogLevel.ERROR, "React Native Tag", "React Native Message");
}

function resetIdentities() {
AEPCore.resetIdentities();
}
Loading