Skip to content

Commit f974a60

Browse files
committed
Merge branch 'staging' of https://github.com/adobe/aepsdk-react-native into target
2 parents e9d68bf + 8b428ef commit f974a60

38 files changed

+2143
-32
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ This repository is a monorepo and contains a collection of React Native modules
1616
| [@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) | [Messaging](https://aep-sdks.gitbook.io/docs/beta/iam)
1717
| [@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) | [Assurance](https://aep-sdks.gitbook.io/docs/foundation-extensions/adobe-experience-platform-assurance)
1818
| [@adobe/react-native-aepoptimize](./packages/optimize) | [![npm downloads](https://img.shields.io/npm/dm/@adobe/react-native-aepoptimize)](https://www.npmjs.com/package/@adobe/react-native-aepoptimize) ![npm downloads](https://img.shields.io/npm/dm/@adobe/react-native-aepoptimize) | [Optimize](https://aep-sdks.gitbook.io/docs/using-mobile-extensions/adobe-journey-optimizer-decisioning)
19+
| [@adobe/react-native-aepplaces](./packages/places) | [![npm downloads](https://img.shields.io/npm/dm/@adobe/react-native-aepplaces)](https://www.npmjs.com/package/@adobe/react-native-aepplaces) ![npm downloads](https://img.shields.io/npm/dm/@adobe/react-native-aepplaces) | [Places](https://aep-sdks.gitbook.io/docs/foundation-extensions/places)
20+
| [@adobe/react-native-aeptarget](./packages/target) | [![npm downloads](https://img.shields.io/npm/dm/@adobe/react-native-aeptarget)](https://www.npmjs.com/package/@adobe/react-native-aeptarget) ![npm downloads](https://img.shields.io/npm/dm/@adobe/react-native-aeptarget) | [Places](https://aep-sdks.gitbook.io/docs/using-mobile-extensions/adobe-target)
1921

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

apps/AEPSampleApp/App.tsx

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import EdgeView from './extensions/EdgeView';
1212
import AssuranceView from './extensions/AssuranceView';
1313
import EdgeIdentityView from './extensions/EdgeIdentityView';
1414
import TargetView from './extensions/TargetView';
15+
import PlacesView from './extensions/PlacesView';
1516
import {NavigationProps} from './types/props';
1617

1718
function HomeScreen({navigation}: NavigationProps) {
@@ -32,16 +33,15 @@ function HomeScreen({navigation}: NavigationProps) {
3233

3334
<Button
3435
onPress={() => navigation.navigate('MessagingView')}
35-
title="Messaging" />
36+
title="Messaging"
37+
/>
3638

3739
<Button
3840
onPress={() => navigation.navigate('OptimizeView')}
39-
title="Optimize"/>
40-
41-
<Button
42-
onPress={() => navigation.navigate('EdgeView')}
43-
title="Edge"
41+
title="Optimize"
4442
/>
43+
44+
<Button onPress={() => navigation.navigate('EdgeView')} title="Edge" />
4545
<Button
4646
onPress={() => navigation.navigate('EdgeIdentityView')}
4747
title="EdgeIdentity"
@@ -54,7 +54,14 @@ function HomeScreen({navigation}: NavigationProps) {
5454
onPress={() => navigation.navigate('AssuranceView')}
5555
title="Assurance"
5656
/>
57-
<Button onPress={() => navigation.navigate('TargetView')} title="Target" />
57+
<Button
58+
onPress={() => navigation.navigate('TargetView')}
59+
title="Target"
60+
/>
61+
<Button
62+
onPress={() => navigation.navigate('PlacesView')}
63+
title="Places"
64+
/>
5865
</View>
5966
);
6067
}
@@ -74,7 +81,8 @@ export default function App() {
7481
<Drawer.Screen name="EdgeIdentityView" component={EdgeIdentityView} />
7582
<Drawer.Screen name="ConsentView" component={ConsentView} />
7683
<Drawer.Screen name="AssuranceView" component={AssuranceView} />
77-
<Drawer.Screen name="OptimizeView" component={OptimizeView}/>
84+
<Drawer.Screen name="PlacesView" component={PlacesView} />
85+
<Drawer.Screen name="OptimizeView" component={OptimizeView} />
7886
<Drawer.Screen name="TargetView" component={TargetView} />
7987
</Drawer.Navigator>
8088
</NavigationContainer>

apps/AEPSampleApp/android/app/src/main/java/com/aepsampleapp/MainApplication.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
import com.adobe.marketing.mobile.edge.consent.Consent;
2828
import com.adobe.marketing.mobile.edge.identity.Identity;
2929
import com.adobe.marketing.mobile.optimize.Optimize;
30+
import com.adobe.marketing.mobile.Places;
31+
import com.adobe.marketing.mobile.Target;
3032
import com.aepsampleapp.newarchitecture.MainApplicationReactNativeHost;
3133
import com.adobe.marketing.mobile.InvalidInitException;
3234
import com.facebook.react.PackageList;
@@ -127,6 +129,8 @@ public void onCreate() {
127129
Signal.registerExtension();
128130
Consent.registerExtension();
129131
Assurance.registerExtension();
132+
Places.registerExtension();
133+
Target.registerExtension();
130134
Optimize.registerExtension();
131135
} catch (InvalidInitException e) {
132136
e.printStackTrace();
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
/*
2+
Copyright 2022 Adobe. All rights reserved.
3+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License. You may obtain a copy
5+
of the License at http://www.apache.org/licenses/LICENSE-2.0
6+
7+
Unless required by applicable law or agreed to in writing, software distributed under
8+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9+
OF ANY KIND, either express or implied. See the License for the specific language
10+
governing permissions and limitations under the License.
11+
*/
12+
13+
import React from 'react';
14+
import {Button, ScrollView, Text, View} from 'react-native';
15+
import {
16+
Places,
17+
PlacesAuthStatus,
18+
PlacesGeofence,
19+
PlacesGeofenceTransitionType,
20+
PlacesLocation,
21+
} from '@adobe/react-native-aepplaces';
22+
import {NavigationProps} from '../types/props';
23+
import styles from '../styles/styles';
24+
25+
const EXAMPLE_LATITUDE = 37.3325958;
26+
const EXAMPLE_LONGITUDE = -121.8910217;
27+
const EXAMPLE_GEOFENCE_ID = '82e2eb52-e925-41a3-9d50-418a2e015608';
28+
const EXAMPLE_RADIUS = 50;
29+
30+
const extensionVersion = async () => {
31+
const version = await Places.extensionVersion();
32+
console.log('AdobeExperienceSDK: Places version: ' + version);
33+
};
34+
35+
const getNearbyPointsOfInterest = async () => {
36+
const location = new PlacesLocation(EXAMPLE_LONGITUDE, EXAMPLE_LATITUDE);
37+
try {
38+
const pois = await Places.getNearbyPointsOfInterest(location, 2);
39+
console.log(
40+
`AdobeExperienceSDK: Places pois: ${pois[0]?.['name'] || '[]'}`,
41+
);
42+
} catch (e) {
43+
console.log(`AdobeExperienceSDK: Places error: ${e}`);
44+
}
45+
};
46+
47+
const processGeofence = () => {
48+
const geofence = new PlacesGeofence(
49+
EXAMPLE_GEOFENCE_ID,
50+
EXAMPLE_LATITUDE,
51+
EXAMPLE_LONGITUDE,
52+
EXAMPLE_RADIUS,
53+
10,
54+
);
55+
Places.processGeofence(geofence, PlacesGeofenceTransitionType.EXIT);
56+
console.log('Geofence processed');
57+
};
58+
59+
const getCurrentPointsOfInterest = async () => {
60+
const pois = await Places.getCurrentPointsOfInterest();
61+
console.log(`AdobeExperienceSDK: Places pois: ${pois[0]?.['name'] || '[]'}`);
62+
};
63+
64+
const getLastKnownLocation = async () => {
65+
const location = await Places.getLastKnownLocation();
66+
console.log(
67+
`AdobeExperienceSDK: Places location: ${JSON.stringify(location)}`,
68+
);
69+
};
70+
71+
const clear = () => {
72+
Places.clear();
73+
console.log('cleared');
74+
};
75+
76+
const setAuthorizationStatus = () => {
77+
Places.setAuthorizationStatus(PlacesAuthStatus.ALWAYS);
78+
console.log('Authorization status set');
79+
};
80+
81+
const PlacesView = ({navigation: {goBack}}: NavigationProps) => {
82+
return (
83+
<View style={styles.container}>
84+
<ScrollView contentContainerStyle={{marginTop: 75}}>
85+
<Button onPress={goBack} title="Go to main page" />
86+
<Text style={styles.welcome}>Places</Text>
87+
<Button title="extensionVersion()" onPress={extensionVersion} />
88+
<Button
89+
title="getNearbyPointsOfInterest()"
90+
onPress={getNearbyPointsOfInterest}
91+
/>
92+
<Button title="processGeofence()" onPress={processGeofence} />
93+
<Button
94+
title="getCurrentPointsOfInterest()"
95+
onPress={getCurrentPointsOfInterest}
96+
/>
97+
<Button title="getLastKnownLocation()" onPress={getLastKnownLocation} />
98+
<Button
99+
title="setAuthorizationStatus()"
100+
onPress={setAuthorizationStatus}
101+
/>
102+
<Button title="clear" onPress={clear} />
103+
</ScrollView>
104+
</View>
105+
);
106+
};
107+
108+
export default PlacesView;

apps/AEPSampleApp/ios/AEPSampleApp/AppDelegate.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ governing permissions and limitations under the License.
2525
@import AEPEdgeConsent;
2626
@import AEPAssurance;
2727
@import AEPOptimize;
28-
28+
@import AEPPlaces;
29+
@import AEPTarget;
2930
@interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate>
30-
3131
@property (nonatomic, strong) UIWindow *window;
3232

3333
@end

apps/AEPSampleApp/ios/AEPSampleApp/AppDelegate.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ - (BOOL)application:(UIApplication *)application
7676
[AEPMobileCore registerExtensions:@[
7777
AEPMobileEdgeIdentity.class, AEPMobileEdge.class,
7878
AEPMobileEdgeConsent.class, AEPMobileMessaging.class,
79-
AEPMobileOptimize.class
79+
AEPMobileOptimize.class, AEPMobilePlaces.class, AEPMobileTarget.class
8080
]
8181
completion:^{
8282
[AEPMobileCore configureWithAppId:@"YOUR-APP-ID"];

apps/AEPSampleApp/ios/Podfile.lock

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ PODS:
2626
- AEPOptimize (1.0.0):
2727
- AEPCore (>= 3.2.0)
2828
- AEPEdge (>= 1.2.0)
29+
- AEPPlaces (3.0.1):
30+
- AEPCore
31+
- AEPServices
2932
- AEPRulesEngine (1.2.0)
3033
- AEPServices (3.7.1)
3134
- AEPSignal (3.7.1):
@@ -145,6 +148,9 @@ PODS:
145148
- RCTAEPOptimize (1.0.0-beta.1):
146149
- AEPOptimize (~> 1.0)
147150
- React
151+
- RCTAEPPlaces (1.0.0-beta.1):
152+
- AEPPlaces (~> 3.0)
153+
- React
148154
- RCTAEPTarget (1.0.0-beta.1):
149155
- AEPTarget (~> 3.2)
150156
- React
@@ -494,6 +500,7 @@ DEPENDENCIES:
494500
- RCTAEPEdgeIdentity (from `../../../packages/edgeidentity`)
495501
- RCTAEPMessaging (from `../../../packages/messaging`)
496502
- RCTAEPOptimize (from `../../../packages/optimize`)
503+
- RCTAEPPlaces (from `../../../packages/places`)
497504
- RCTAEPTarget (from `../../../packages/target`)
498505
- RCTAEPUserProfile (from `../../../packages/userprofile`)
499506
- RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`)
@@ -540,6 +547,7 @@ SPEC REPOS:
540547
- AEPIdentity
541548
- AEPLifecycle
542549
- AEPOptimize
550+
- AEPPlaces
543551
- AEPRulesEngine
544552
- AEPServices
545553
- AEPSignal
@@ -591,6 +599,8 @@ EXTERNAL SOURCES:
591599
:path: "../../../packages/messaging"
592600
RCTAEPOptimize:
593601
:path: "../../../packages/optimize"
602+
RCTAEPPlaces:
603+
:path: "../../../packages/places"
594604
RCTAEPTarget:
595605
:path: "../../../packages/target"
596606
RCTAEPUserProfile:
@@ -673,9 +683,10 @@ SPEC CHECKSUMS:
673683
AEPLifecycle: 94c36a54f7e5466c5274bc822c53eaa410b74888
674684
AEPMessaging: 72ebb84ce97be336660a4bbe7eed46f47965ba5c
675685
AEPOptimize: 413690f88cb8ae574153a94081331788ca740a91
686+
AEPPlaces: 04294020832c78249732c80aec86928114698cbf
676687
AEPRulesEngine: 71228dfdac24c9ded09be13e3257a7eb22468ccc
677-
AEPServices: 7bc2af2a153ea223e87ec50c8e3fd6e0282869c6
678-
AEPSignal: a7fbfd170fc121a4c0c413b6af644513d9966fde
688+
AEPServices: 7284c30359c789cd16bf366b4ea81094a66d21ab
689+
AEPSignal: c9b3c239120190fae8e8479d584d54b60af37d99
679690
AEPTarget: 7aa8a2c8e4a2fd36862911581b420380709e5578
680691
AEPUserProfile: 2ddb5ba8e2c22dd8f942992306b050f4be2c2403
681692
boost: a7c83b31436843459a1961bfd74b96033dc77234
@@ -704,6 +715,7 @@ SPEC CHECKSUMS:
704715
RCTAEPEdgeIdentity: 1b18a3ff1947f8f4896d5f40083d31a6971e4bbc
705716
RCTAEPMessaging: 5ff246c624ceb253f93dbb1ae96af4ec898c91af
706717
RCTAEPOptimize: 6d171e612151ad213d9e19148c4d0f78cb041ec7
718+
RCTAEPPlaces: ed94d03350cf3e945a606d673e1c42d91ee97f3d
707719
RCTAEPTarget: b0dbedb171d8aaf2faa6ac17e96dc3038a2031a4
708720
RCTAEPUserProfile: 341c77e0d18d69872c81e425a2e9cae37fe82045
709721
RCTRequired: 3e917ea5377751094f38145fdece525aa90545a0

apps/AEPSampleApp/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"@adobe/react-native-aepedgeidentity": "^1.1.0",
2222
"@adobe/react-native-aepmessaging": "^1.0.0-beta.2",
2323
"@adobe/react-native-aepoptimize": "^1.0.0-beta.1",
24+
"@adobe/react-native-aepplaces": "^1.0.0-beta.1",
2425
"@adobe/react-native-aeptarget": "^1.0.0-beta.1",
2526
"@adobe/react-native-aepuserprofile": "^1.0.0",
2627
"@react-native-community/masked-view": "^0.1.11",

packages/places/.gitignore

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
2+
# OSX
3+
#
4+
.DS_Store
5+
6+
# node.js
7+
#
8+
node_modules/
9+
npm-debug.log
10+
yarn-error.log
11+
12+
13+
# Xcode
14+
#
15+
build/
16+
*.pbxuser
17+
!default.pbxuser
18+
*.mode1v3
19+
!default.mode1v3
20+
*.mode2v3
21+
!default.mode2v3
22+
*.perspectivev3
23+
!default.perspectivev3
24+
xcuserdata
25+
*.xccheckout
26+
*.moved-aside
27+
DerivedData
28+
*.hmap
29+
*.ipa
30+
*.xcuserstate
31+
project.xcworkspace
32+
ios/Pods
33+
ios/*.xcworkspace
34+
35+
# Android/IntelliJ
36+
#
37+
build/
38+
.idea
39+
.gradle
40+
local.properties
41+
*.iml
42+
43+
# BUCK
44+
buck-out/
45+
\.buckd/
46+
*.keystore
47+
acp-sdks/
48+
.*tgz

0 commit comments

Comments
 (0)