@woosmap/react-native-plugin-geofencing 0.1.12-rc.0 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/README.md +7 -531
- package/android/build/.transforms/aa385bad2a83168414a07acde96b788d/results.bin +1 -0
- package/android/build/.transforms/aa385bad2a83168414a07acde96b788d/transformed/classes/classes.dex +0 -0
- package/android/build/generated/source/buildConfig/debug/com/reactnativeplugingeofencing/BuildConfig.java +10 -0
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +11 -0
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json +16 -0
- package/android/build/intermediates/aar_metadata/debug/aar-metadata.properties +2 -0
- package/android/build/intermediates/annotation_processor_list/debug/annotationProcessors.json +1 -0
- package/android/build/intermediates/compile_library_classes_jar/debug/classes.jar +0 -0
- package/android/build/intermediates/compile_r_class_jar/debug/R.jar +0 -0
- package/android/build/intermediates/compile_symbol_list/debug/R.txt +2107 -0
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
- package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
- package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +2 -0
- package/android/build/intermediates/incremental/packageDebugResources/compile-file-map.properties +1 -0
- package/android/build/intermediates/incremental/packageDebugResources/merger.xml +2 -0
- package/android/build/intermediates/javac/debug/classes/com/reactnativeplugingeofencing/BuildConfig.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/reactnativeplugingeofencing/PluginGeofencingModule.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/reactnativeplugingeofencing/PluginGeofencingPackage.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/reactnativeplugingeofencing/WoosLocationReadyListener.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/reactnativeplugingeofencing/WoosRegionReadyListener.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/reactnativeplugingeofencing/WoosmapMessageAndKey.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/reactnativeplugingeofencing/WoosmapTask.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/reactnativeplugingeofencing/WoosmapUtil.class +0 -0
- package/android/build/intermediates/library_manifest/debug/AndroidManifest.xml +11 -0
- package/android/build/intermediates/local_only_symbol_list/debug/R-def.txt +2 -0
- package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +13 -0
- package/android/build/intermediates/navigation_json/debug/navigation.json +1 -0
- package/android/build/intermediates/packaged_manifests/debug/output-metadata.json +16 -0
- package/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar +0 -0
- package/android/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt +1576 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +37 -0
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/src/main/java/com/reactnativeplugingeofencing/WoosmapUtil.java +1 -0
- package/ios/PluginGeofencing.swift +1 -0
- package/lib/commonjs/internal/Region.js +7 -3
- package/lib/commonjs/internal/Region.js.map +1 -1
- package/lib/module/internal/Region.js +7 -3
- package/lib/module/internal/Region.js.map +1 -1
- package/lib/typescript/internal/Region.d.ts +4 -2
- package/react-native-plugin-geofencing.podspec +1 -1
- package/src/internal/Region.tsx +8 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
### Latest
|
|
2
|
+
* Added a new field named `eventName` in the region callback
|
|
3
|
+
|
|
4
|
+
### 0.1.9
|
|
5
|
+
* #56 region create event triggers other than region log event removed in android. by @dippatra in https://github.com/Woosmap/geofencing-react-native-plugin/pull/58
|
|
6
|
+
|
|
7
|
+
### 0.1.8
|
|
8
|
+
* #53 POI identifier (idStore) is not returned in the Region object issue by @dippatra in https://github.com/Woosmap/geofencing-react-native-plugin/pull/54
|
package/README.md
CHANGED
|
@@ -1,539 +1,15 @@
|
|
|
1
1
|

|
|
2
2
|
|
|
3
|
-
#
|
|
3
|
+
# Woosmap Geofencing React Native Plugin
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
### SDKs to help developers collecting users’ locations in the right way.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The Woosmap Geofencing SDK is a mobile cross-platform software development kit focused on gathering efficiently the users’ location, triggering events based on region monitoring, and providing categorized users’ zone of interest from geographical and temporal clusters.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
npm install @woosmap/react-native-plugin-geofencing
|
|
11
|
-
```
|
|
9
|
+
The SDK simplifies the integration of the location context in your mobile application by taking care of lower-level functionalities such as data collection or battery management.
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
### Documentation
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
All feature descriptions and guides to implement the Woosmap Geofencing Android & iOS SDK are available on the [Woosmap developers documentation](https://developers.woosmap.com/products/geofencing-sdk/get-started/).
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
- NSLocationAlwaysAndWhenInUseUsageDescription
|
|
19
|
-
- NSLocationAlwaysUsageDescription
|
|
20
|
-
- NSLocationWhenInUseUsageDescription
|
|
21
|
-
- UIBackgroundModes
|
|
22
|
-
|
|
23
|
-
```
|
|
24
|
-
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
|
|
25
|
-
<string>Used to test the library</string>
|
|
26
|
-
<key>NSLocationAlwaysUsageDescription</key>
|
|
27
|
-
<string>Used to test the library</string>
|
|
28
|
-
<key>NSLocationWhenInUseUsageDescription</key>
|
|
29
|
-
<string>Used to test the library</string>
|
|
30
|
-
<key>UIBackgroundModes</key>
|
|
31
|
-
<array>
|
|
32
|
-
<string>location</string>
|
|
33
|
-
</array>
|
|
34
|
-
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
- **Podfile**: configure to use ```use_frameworks!``` and ```platform :ios, '12.0'```
|
|
38
|
-
if you are using **M1 Mac** Update pod post installation like
|
|
39
|
-
|
|
40
|
-
```
|
|
41
|
-
post_install do |installer|
|
|
42
|
-
installer.pods_project.targets.each do |target|
|
|
43
|
-
target.build_configurations.each do |config|
|
|
44
|
-
config.build_settings["ONLY_ACTIVE_ARCH"] = "NO"
|
|
45
|
-
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
|
|
46
|
-
end
|
|
47
|
-
end
|
|
48
|
-
end
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
### Supported Platforms ###
|
|
52
|
-
|
|
53
|
-
---
|
|
54
|
-
|
|
55
|
-
- iOS
|
|
56
|
-
- Android
|
|
57
|
-
|
|
58
|
-
### Modules
|
|
59
|
-
|
|
60
|
-
---
|
|
61
|
-
- **WoosmapGeofencing**: Woosmap contains methods to monitor location, regions.
|
|
62
|
-
|
|
63
|
-
### Objects(Read Only)
|
|
64
|
-
|
|
65
|
-
---
|
|
66
|
-
- **Location**: Represents the location object
|
|
67
|
-
- **POI**: Represents Point of Interest
|
|
68
|
-
- **Region**: Represents a geographical region/geofence
|
|
69
|
-
- **Visit**: Represents a visit to a location/POI
|
|
70
|
-
- **ZOI**: Represents Zone of Interest
|
|
71
|
-
- **Airship**: Contains custom data related to Airship implementation
|
|
72
|
-
- **MarketingCloud**: Contains custom data related to third party marketing cloud implementation
|
|
73
|
-
|
|
74
|
-
## Usage
|
|
75
|
-
|
|
76
|
-
``` javascript
|
|
77
|
-
import WoosmapGeofencing from 'react-native-plugin-geofencing';
|
|
78
|
-
|
|
79
|
-
// ...
|
|
80
|
-
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
### Check and request permissions
|
|
84
|
-
|
|
85
|
-
---
|
|
86
|
-
Before initializing the SDK it is required that you request for required location permissions.
|
|
87
|
-
|
|
88
|
-
To check if the location permissions are granted by the user call `getPermissionsStatus` method.
|
|
89
|
-
|
|
90
|
-
``` javascript
|
|
91
|
-
WoosmapGeofencing.getPermissionsStatus()
|
|
92
|
-
.then((status: string) => {
|
|
93
|
-
console.log(status);
|
|
94
|
-
})
|
|
95
|
-
.catch((error: any) => {
|
|
96
|
-
alert('message: ' + error.message);
|
|
97
|
-
});
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
Parameter status will be a string, one of:
|
|
101
|
-
- `GRANTED_BACKGROUND` : User has granted location access even when app is not running in the foreground.
|
|
102
|
-
- `GRANTED_FOREGROUND` : Location access is granted only while user is using the app.
|
|
103
|
-
- `DENIED`: Location access is denied.
|
|
104
|
-
- `UNKNOWN`: Without providing or denying any permission then it will return unknown.
|
|
105
|
-
|
|
106
|
-
**_Please note_**: Plugin will not work as expected if location access is denied.
|
|
107
|
-
|
|
108
|
-
**Requesting location access**
|
|
109
|
-
To request location access call `requestPermissions` method of the plugin. This will result in displaying location access permission dialog. This method accepts a boolean parameter `isBackground`. If this parameter is set to true, then plugin will ask for background location access. Code snippet below asks for background location access.
|
|
110
|
-
|
|
111
|
-
``` javascript
|
|
112
|
-
WoosmapGeofencing.requestPermissions(props.background)
|
|
113
|
-
.then((status: string) => {
|
|
114
|
-
console.log(status);
|
|
115
|
-
})
|
|
116
|
-
.catch((error: any) => {
|
|
117
|
-
alert('message: ' + error.message);
|
|
118
|
-
});
|
|
119
|
-
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
### Initializing the plugin
|
|
123
|
-
|
|
124
|
-
---
|
|
125
|
-
|
|
126
|
-
Plugin can be initialized by simply calling `initialize` method.
|
|
127
|
-
|
|
128
|
-
``` javascript
|
|
129
|
-
var woosmapSettings = {
|
|
130
|
-
privateKeyWoosmapAPI: "<<WOOSMAP_KEY>>",
|
|
131
|
-
trackingProfile: "liveTracking"
|
|
132
|
-
};
|
|
133
|
-
WoosmapGeofencing.initialize(woosmapSettings)
|
|
134
|
-
.then((value: string) => {
|
|
135
|
-
console.log(value);
|
|
136
|
-
})
|
|
137
|
-
.catch((error: any) => {
|
|
138
|
-
alert('message: ' + error.message);
|
|
139
|
-
});
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
Both configuration options `privateKeyWoosmapAPI` and `trackingProfile` are optional. You can also initialize the plugin by passing null configuration.
|
|
143
|
-
|
|
144
|
-
```
|
|
145
|
-
await WoosmapGeofencing.initialize();
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
You can also set the Woosmap API key later by calling `setWoosmapApiKey` method.
|
|
149
|
-
|
|
150
|
-
``` javascript
|
|
151
|
-
WoosmapGeofencing.setWoosmapApiKey(<privateKeyWoosmapAPI>)
|
|
152
|
-
.then((value: string) => {
|
|
153
|
-
console.log(value);
|
|
154
|
-
})
|
|
155
|
-
.catch((error: any) => {
|
|
156
|
-
alert('message: ' + error.message);
|
|
157
|
-
});
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
### Tracking
|
|
161
|
-
|
|
162
|
-
---
|
|
163
|
-
|
|
164
|
-
Once you have initialized the plugin and the user has authorized location permissions, you can start tracking the user’s location.
|
|
165
|
-
|
|
166
|
-
To start tracking, call:
|
|
167
|
-
|
|
168
|
-
``` javascript
|
|
169
|
-
WoosmapGeofencing.startTracking('liveTracking')
|
|
170
|
-
.then((result: string) => {
|
|
171
|
-
console.log(value);
|
|
172
|
-
})
|
|
173
|
-
.catch((error: any) => {
|
|
174
|
-
alert('message: ' + error.message);
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
To stop tracking, call:
|
|
180
|
-
|
|
181
|
-
``` javascript
|
|
182
|
-
WoosmapGeofencing.stopTracking()
|
|
183
|
-
.then((value: any) => {
|
|
184
|
-
console.log(value);
|
|
185
|
-
})
|
|
186
|
-
.catch((error: any) => {
|
|
187
|
-
alert('message: ' + error.message);
|
|
188
|
-
});
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
Method `startTracking` accepts only following tracking profiles
|
|
192
|
-
|
|
193
|
-
- **liveTracking**
|
|
194
|
-
- **passiveTracking**
|
|
195
|
-
- **visitsTracking**
|
|
196
|
-
|
|
197
|
-
### Tracking profile properties
|
|
198
|
-
|
|
199
|
-
---
|
|
200
|
-
|
|
201
|
-
| Property | liveTracking | passiveTracking | visitsTracking
|
|
202
|
-
| ----------- | ----------- | ----------- | ----------- |
|
|
203
|
-
| trackingEnable | true | true | true
|
|
204
|
-
| foregroundLocationServiceEnable | true | false | false
|
|
205
|
-
| modeHighFrequencyLocation | true | false | false
|
|
206
|
-
| visitEnable | false | false | true
|
|
207
|
-
| classificationEnable | false | false | true
|
|
208
|
-
| minDurationVisitDisplay | null | null | 300
|
|
209
|
-
| radiusDetectionClassifiedZOI | null | null | 50
|
|
210
|
-
| distanceDetectionThresholdVisits | null | null | 25
|
|
211
|
-
| currentLocationTimeFilter | 0 | 0 | 0
|
|
212
|
-
| currentLocationDistanceFilter | 0 | 0 | 0
|
|
213
|
-
| accuracyFilter | 100 | 100 | 100
|
|
214
|
-
| searchAPIEnable | false | true | false
|
|
215
|
-
| searchAPICreationRegionEnable | false | true | false
|
|
216
|
-
| searchAPITimeFilter | 0 | 0 | 0
|
|
217
|
-
| searchAPIDistanceFilter | 0 | 0 | 0
|
|
218
|
-
| distanceAPIEnable | false | false | false
|
|
219
|
-
| modeDistance | null | null | null
|
|
220
|
-
| outOfTimeDelay | 300 | 300 | 300
|
|
221
|
-
| DOUBLEOfDayDataDuration | 30 | 30 | 30
|
|
222
|
-
|
|
223
|
-
### Listening to events
|
|
224
|
-
|
|
225
|
-
---
|
|
226
|
-
|
|
227
|
-
**Location**
|
|
228
|
-
|
|
229
|
-
To listen to location, call `watchLocation` method. Method will invoke callback and pass a location object as a parameter. Method will return a watchId . This id can be used to remove a callback.
|
|
230
|
-
|
|
231
|
-
``` javascript
|
|
232
|
-
const callback = (value: Location) => {
|
|
233
|
-
alert('message: ' + JSON.stringify(value));
|
|
234
|
-
};
|
|
235
|
-
|
|
236
|
-
WoosmapGeofencing.watchLocation(callback)
|
|
237
|
-
.then((watchRef: string) => {
|
|
238
|
-
//Keep watchRef, it requires when you wish to remove location watch.
|
|
239
|
-
console.log('Watch added');
|
|
240
|
-
})
|
|
241
|
-
.catch((error: any) => {
|
|
242
|
-
alert('message: ' + error.message);
|
|
243
|
-
});
|
|
244
|
-
```
|
|
245
|
-
|
|
246
|
-
To stop getting location updates:
|
|
247
|
-
|
|
248
|
-
``` javascript
|
|
249
|
-
WoosmapGeofencing.clearLocationWatch(watchID)
|
|
250
|
-
.then((watchRef: string) => {
|
|
251
|
-
console.log(watchRef);
|
|
252
|
-
})
|
|
253
|
-
.catch((error: any) => {
|
|
254
|
-
alert('message: ' + error.message);
|
|
255
|
-
});
|
|
256
|
-
```
|
|
257
|
-
|
|
258
|
-
**Define the radius value**
|
|
259
|
-
|
|
260
|
-
When you create a Geofence around a POI (previously imported from Woosmap), manually define the radius value:
|
|
261
|
-
|
|
262
|
-
```javascript
|
|
263
|
-
WoosmapGeofencing.setPoiRadius("100")
|
|
264
|
-
.then((value: string) => {
|
|
265
|
-
console.log(value);
|
|
266
|
-
})
|
|
267
|
-
.catch((error: any) => {
|
|
268
|
-
alert('message: ' + error.message);
|
|
269
|
-
});
|
|
270
|
-
```
|
|
271
|
-
|
|
272
|
-
or choose the user_properties subfield that corresponds to radius value of the Geofence:
|
|
273
|
-
|
|
274
|
-
```javascript
|
|
275
|
-
WoosmapGeofencing.setPoiRadius("radiusPOI")
|
|
276
|
-
.then((value: string) => {
|
|
277
|
-
console.log(value);
|
|
278
|
-
})
|
|
279
|
-
.catch((error: any) => {
|
|
280
|
-
alert('message: ' + error.message);
|
|
281
|
-
});
|
|
282
|
-
```
|
|
283
|
-
|
|
284
|
-
**Regions**
|
|
285
|
-
|
|
286
|
-
Call `watchRegions` method to track Regions. Method will invoke a callback with Region object. Method will return a watch id which can be used later to remove the callback.
|
|
287
|
-
|
|
288
|
-
``` javascript
|
|
289
|
-
WoosmapGeofencing.watchRegions(callback)
|
|
290
|
-
.then((watchRef: string) => {
|
|
291
|
-
//Keep watchRef, it requires when you wish to remove region watch.
|
|
292
|
-
console.log('Watch added');
|
|
293
|
-
})
|
|
294
|
-
.catch((error: any) => {
|
|
295
|
-
alert('message: ' + error.message);
|
|
296
|
-
});
|
|
297
|
-
```
|
|
298
|
-
|
|
299
|
-
To remove watch:
|
|
300
|
-
|
|
301
|
-
``` javascript
|
|
302
|
-
WoosmapGeofencing.clearRegionsWatch(watchID)
|
|
303
|
-
.then((watchRef: string) => {
|
|
304
|
-
console.log(watchRef);
|
|
305
|
-
})
|
|
306
|
-
.catch((error: any) => {
|
|
307
|
-
alert('message: ' + error.message);
|
|
308
|
-
});
|
|
309
|
-
```
|
|
310
|
-
|
|
311
|
-
### Initialize Salesforce MarketingCloud Connector
|
|
312
|
-
|
|
313
|
-
---
|
|
314
|
-
|
|
315
|
-
The SDK needs some input like credentials and object key to perform the API call to Salesforce Marketing Cloud API.
|
|
316
|
-
|
|
317
|
-
**Input to initialize the SFMC connector**<br/>
|
|
318
|
-
|
|
319
|
-
| Parameters | Description | Required |
|
|
320
|
-
| -------------------------------------- | --------------------------------------------------------------------------------------------------------- | -------- |
|
|
321
|
-
| authenticationBaseURI | Authentication Base URI | Required |
|
|
322
|
-
| restBaseURI | REST Base URI | Required |
|
|
323
|
-
| client\_id | client\_id (journey\_read and list\_and\_subscribers\_read rights are required) | Required |
|
|
324
|
-
| client\_secret | client\_secret (journey\_read and list\_and\_subscribers\_read rights are required) | Required |
|
|
325
|
-
| contactKey | The ID that uniquely identifies a subscriber/contact | Required |
|
|
326
|
-
| regionEnteredEventDefinitionKey | Set the EventDefinitionKey that you want to use for the Woosmap event `woos_geofence_entered_event` | |
|
|
327
|
-
| regionExitedEventDefinitionKey | Set the EventDefinitionKey that you want to use for the Woosmap event `woos_geofence_exited_event` | |
|
|
328
|
-
| poiEventDefinitionKey | Set the EventDefinitionKey that you want to use for the Woosmap event `woos_POI_event` | |
|
|
329
|
-
| zoiClassifiedEnteredEventDefinitionKey | Set the EventDefinitionKey that you want to use for the Woosmap event `woos_zoi_classified_entered_event` | |
|
|
330
|
-
| zoiClassifiedExitedEventDefinitionKey | Set the EventDefinitionKey that you want to use for the Woosmap event `woos_zoi_classified_exited_event` | |
|
|
331
|
-
| visitEventDefinitionKey | Set the EventDefinitionKey that you want to use for the Woosmap event `woos_Visit_event` |
|
|
332
|
-
|
|
333
|
-
### Adding and removing regions
|
|
334
|
-
|
|
335
|
-
---
|
|
336
|
-
|
|
337
|
-
Call `addRegion` method to add a region that you want to monitor.
|
|
338
|
-
Region type can be 'circle' or 'isochrone' only.
|
|
339
|
-
Method will accept an object with the following attributes:
|
|
340
|
-
|
|
341
|
-
- **regionId** - Id of the region
|
|
342
|
-
- **lat** - Latitude
|
|
343
|
-
- **lng** - Longitude
|
|
344
|
-
- **radius** - Radius in meters
|
|
345
|
-
- **type** - type of region
|
|
346
|
-
|
|
347
|
-
##### Create a custom circle region
|
|
348
|
-
|
|
349
|
-
``` javascript
|
|
350
|
-
var regionData = {
|
|
351
|
-
lat: 51.50998,
|
|
352
|
-
lng: -0.1337,
|
|
353
|
-
regionId: '7F91369E-467C-4CBD-8D41-6509815C4780',
|
|
354
|
-
radius: 100,
|
|
355
|
-
type: 'circle',
|
|
356
|
-
};
|
|
357
|
-
WoosmapGeofencing.addRegion(regionData)
|
|
358
|
-
.then((value: string) => {
|
|
359
|
-
console.log(value);
|
|
360
|
-
})
|
|
361
|
-
.catch((error: any) => {
|
|
362
|
-
console.error(error);
|
|
363
|
-
});
|
|
364
|
-
};
|
|
365
|
-
```
|
|
366
|
-
|
|
367
|
-
##### Create a custom isochrone region
|
|
368
|
-
|
|
369
|
-
``` javascript
|
|
370
|
-
var regionData = {
|
|
371
|
-
lat: 51.50998,
|
|
372
|
-
lng: -0.1337,
|
|
373
|
-
regionId: '7F91369E-467C-4CBD-8D41-6509815C4780',
|
|
374
|
-
radius: 180,
|
|
375
|
-
type: 'isochrone',
|
|
376
|
-
};
|
|
377
|
-
WoosmapGeofencing.addRegion(regionData)
|
|
378
|
-
.then((value: string) => {
|
|
379
|
-
console.log(value);
|
|
380
|
-
})
|
|
381
|
-
.catch((error: any) => {
|
|
382
|
-
console.error(error);
|
|
383
|
-
});
|
|
384
|
-
};
|
|
385
|
-
```
|
|
386
|
-
|
|
387
|
-
Call ```removeRegions``` method to remove a region that you are monitoring. Method will accept the following parameter, and passing a null value will remove all the regions.
|
|
388
|
-
|
|
389
|
-
``` javascript
|
|
390
|
-
const request = "7F91369E-467C-4CBD-8D41-6509815C4780";
|
|
391
|
-
WoosmapGeofencing.removeRegions(request)
|
|
392
|
-
.then((value: string) => {
|
|
393
|
-
console.log(value);
|
|
394
|
-
})
|
|
395
|
-
.catch((error: any) => {
|
|
396
|
-
console.error(error);
|
|
397
|
-
});
|
|
398
|
-
```
|
|
399
|
-
|
|
400
|
-
Or To Delete all Regions
|
|
401
|
-
|
|
402
|
-
``` javascript
|
|
403
|
-
WoosmapGeofencing.removeRegions()
|
|
404
|
-
.then((value: string) => {
|
|
405
|
-
console.log(value);
|
|
406
|
-
})
|
|
407
|
-
.catch((error: any) => {
|
|
408
|
-
console.error(error);
|
|
409
|
-
});
|
|
410
|
-
```
|
|
411
|
-
|
|
412
|
-
### Local database operations
|
|
413
|
-
|
|
414
|
-
---
|
|
415
|
-
|
|
416
|
-
- **Get POIs**: Call `getPois` method to get an array of POIs from the local db
|
|
417
|
-
|
|
418
|
-
``` javascript
|
|
419
|
-
|
|
420
|
-
WoosmapGeofencing.getPois(optional locationid)
|
|
421
|
-
.then((value: Location[]) => {
|
|
422
|
-
console.log(String(value.length));
|
|
423
|
-
})
|
|
424
|
-
.catch((error: any) => {
|
|
425
|
-
console.error(error);
|
|
426
|
-
});
|
|
427
|
-
```
|
|
428
|
-
|
|
429
|
-
- **Delete POIs**: Call `removePois` method to clear all POIs from the local db.
|
|
430
|
-
|
|
431
|
-
``` javascript
|
|
432
|
-
WoosmapGeofencing.removePois()
|
|
433
|
-
.then((value: string) => {
|
|
434
|
-
console.log(value);
|
|
435
|
-
})
|
|
436
|
-
.catch((error: any) => {
|
|
437
|
-
console.error(error);
|
|
438
|
-
});
|
|
439
|
-
```
|
|
440
|
-
|
|
441
|
-
- **Get Locations**: Call `getLocations` method to get an array of Locations from the local db.
|
|
442
|
-
|
|
443
|
-
``` javascript
|
|
444
|
-
|
|
445
|
-
WoosmapGeofencing.getLocations(optional locationid)
|
|
446
|
-
.then((value: Location[]) => {
|
|
447
|
-
console.log(String(value.length));
|
|
448
|
-
})
|
|
449
|
-
.catch((error: any) => {
|
|
450
|
-
console.error(error);
|
|
451
|
-
});
|
|
452
|
-
```
|
|
453
|
-
|
|
454
|
-
- **Delete Locations**: Call `removeLocations` method to clear all Locations info from the local db.
|
|
455
|
-
|
|
456
|
-
``` javascript
|
|
457
|
-
WoosmapGeofencing.removeLocations()
|
|
458
|
-
.then((value: string) => {
|
|
459
|
-
console.log(value);
|
|
460
|
-
})
|
|
461
|
-
.catch((error: any) => {
|
|
462
|
-
console.error(error);
|
|
463
|
-
});
|
|
464
|
-
```
|
|
465
|
-
|
|
466
|
-
- **Get Regions**: Call `getRegions` method to get an array of Regions from the local db. specify region id to retrieve specific region info
|
|
467
|
-
|
|
468
|
-
``` javascript
|
|
469
|
-
WoosmapGeofencing.getRegions(optional regionid).
|
|
470
|
-
.then((value: Region[]) => {
|
|
471
|
-
Toast.show(String(value.length));
|
|
472
|
-
})
|
|
473
|
-
.catch((error: any) => {
|
|
474
|
-
console.error(error);
|
|
475
|
-
});
|
|
476
|
-
```
|
|
477
|
-
|
|
478
|
-
### Initialize the connector implementation
|
|
479
|
-
|
|
480
|
-
---
|
|
481
|
-
|
|
482
|
-
``` javascript
|
|
483
|
-
var sfmcCredentials = {
|
|
484
|
-
authenticationBaseURI: "https://xxxxxxxxxx.auth.marketingcloudapis.com",
|
|
485
|
-
restBaseURI: "https://xxxxxxxxxx.rest.marketingcloudapis.com",
|
|
486
|
-
client_id: "xxxxxxxxxxxxxxx",
|
|
487
|
-
client_secret: "xxxxxxxxxxxxxxx",
|
|
488
|
-
contactKey: "ID001",
|
|
489
|
-
regionEnteredEventDefinitionKey: "APIEvent-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
|
|
490
|
-
regionExitedEventDefinitionKey: "APIEvent-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
|
491
|
-
};
|
|
492
|
-
WoosmapGeofencing.setSFMCCredentials(sfmcCredentials)
|
|
493
|
-
.then((value: any) => {
|
|
494
|
-
console.log(value);
|
|
495
|
-
})
|
|
496
|
-
.catch((error: any) => {
|
|
497
|
-
alert('message: ' + error.message);
|
|
498
|
-
});
|
|
499
|
-
```
|
|
500
|
-
|
|
501
|
-
### Custom tracking profile
|
|
502
|
-
|
|
503
|
-
---
|
|
504
|
-
|
|
505
|
-
If preset tracking profiles don’t fit with your use cases, you can build your own profile and uses the startCustomTracking() method. There are two way to host the json file:
|
|
506
|
-
|
|
507
|
-
- Include json file in the client application (local) for ios.
|
|
508
|
-
- For local mode put json file in assets folder in android.
|
|
509
|
-
- Host externally in a file folder in your information system (external)
|
|
510
|
-
|
|
511
|
-
``` javascript
|
|
512
|
-
WoosmapGeofencing.startCustomTracking('local', 'localProfile.json')
|
|
513
|
-
.then((value: any) => {
|
|
514
|
-
console.log(value);
|
|
515
|
-
})
|
|
516
|
-
.catch((error: any) => {
|
|
517
|
-
alert('message: ' + error.message);
|
|
518
|
-
});
|
|
519
|
-
```
|
|
520
|
-
|
|
521
|
-
or
|
|
522
|
-
|
|
523
|
-
``` javascript
|
|
524
|
-
WoosmapGeofencing.startCustomTracking('external', 'https://raw.githubusercontent.com/lpernelle-wgs/files/master/customProfileLeo.json')
|
|
525
|
-
.then((value: any) => {
|
|
526
|
-
console.log(value);
|
|
527
|
-
})
|
|
528
|
-
.catch((error: any) => {
|
|
529
|
-
alert('message: ' + error.message);
|
|
530
|
-
});
|
|
531
|
-
```
|
|
532
|
-
|
|
533
|
-
#### Build a custom tracking profile
|
|
534
|
-
|
|
535
|
-
Define tracking properties in a Json file that respect the Json Schema in the [Tracking properties page](https://developers.woosmap.com/products/geofencing-sdk/tracking-profiles/tracking-properties/).
|
|
536
|
-
|
|
537
|
-
## License
|
|
538
|
-
|
|
539
|
-
MIT
|
|
15
|
+
If you are looking for the Woosmap Geofencing React Native plugin documentation, [we have a dedicated section for it](https://developers.woosmap.com/products/geofencing-sdk/react-native-plugin/guides/setup/).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
o/classes
|
package/android/build/.transforms/aa385bad2a83168414a07acde96b788d/transformed/classes/classes.dex
ADDED
|
Binary file
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Automatically generated file. DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
package com.reactnativeplugingeofencing;
|
|
5
|
+
|
|
6
|
+
public final class BuildConfig {
|
|
7
|
+
public static final boolean DEBUG = Boolean.parseBoolean("true");
|
|
8
|
+
public static final String LIBRARY_PACKAGE_NAME = "com.reactnativeplugingeofencing";
|
|
9
|
+
public static final String BUILD_TYPE = "debug";
|
|
10
|
+
}
|
package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
+
package="com.reactnativeplugingeofencing"
|
|
4
|
+
android:versionCode="1"
|
|
5
|
+
android:versionName="1.0" >
|
|
6
|
+
|
|
7
|
+
<uses-sdk
|
|
8
|
+
android:minSdkVersion="21"
|
|
9
|
+
android:targetSdkVersion="29" />
|
|
10
|
+
|
|
11
|
+
</manifest>
|
package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 2,
|
|
3
|
+
"artifactType": {
|
|
4
|
+
"type": "AAPT_FRIENDLY_MERGED_MANIFESTS",
|
|
5
|
+
"kind": "Directory"
|
|
6
|
+
},
|
|
7
|
+
"applicationId": "com.reactnativeplugingeofencing",
|
|
8
|
+
"variantName": "debug",
|
|
9
|
+
"elements": [
|
|
10
|
+
{
|
|
11
|
+
"type": "SINGLE",
|
|
12
|
+
"filters": [],
|
|
13
|
+
"outputFile": "AndroidManifest.xml"
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"room-compiler-2.2.4.jar (androidx.room:room-compiler:2.2.4)":true}
|
|
Binary file
|