@woosmap/react-native-plugin-geofencing 0.1.6 → 0.1.9
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/README.md +219 -19
- package/android/build.gradle +7 -0
- package/android/src/main/java/com/reactnativeplugingeofencing/PluginGeofencingModule.java +324 -31
- package/android/src/main/java/com/reactnativeplugingeofencing/WoosRegionReadyListener.java +1 -7
- package/android/src/main/java/com/reactnativeplugingeofencing/WoosmapMessageAndKey.java +17 -0
- package/android/src/main/java/com/reactnativeplugingeofencing/WoosmapTask.java +299 -0
- package/android/src/main/java/com/reactnativeplugingeofencing/WoosmapUtil.java +118 -2
- package/ios/DataLocation.swift +4 -0
- package/ios/DataPOI.swift +11 -0
- package/ios/DataRegion.swift +33 -3
- package/ios/PluginGeofencing.m +43 -0
- package/ios/PluginGeofencing.swift +377 -22
- package/ios/WoosmapGeofenceMessage.swift +12 -0
- package/ios/WoosmapGeofenceService.swift +203 -30
- package/lib/commonjs/index.js +171 -68
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/{Airship.js → internal/Airship.js} +0 -0
- package/lib/commonjs/internal/Airship.js.map +1 -0
- package/lib/commonjs/{Location.js → internal/Location.js} +0 -0
- package/lib/commonjs/{Location.js.map → internal/Location.js.map} +1 -1
- package/lib/commonjs/{MarketingCloud.js → internal/MarketingCloud.js} +0 -0
- package/lib/commonjs/internal/MarketingCloud.js.map +1 -0
- package/lib/{module → commonjs/internal}/Poi.js +10 -1
- package/lib/commonjs/internal/Poi.js.map +1 -0
- package/lib/commonjs/{Region.js → internal/Region.js} +0 -0
- package/lib/commonjs/internal/Region.js.map +1 -0
- package/lib/commonjs/{Visit.js → internal/Visit.js} +0 -0
- package/lib/commonjs/internal/Visit.js.map +1 -0
- package/lib/commonjs/{Zoi.js → internal/Zoi.js} +0 -0
- package/lib/commonjs/internal/Zoi.js.map +1 -0
- package/lib/commonjs/internal/nativeInterface.js +18 -0
- package/lib/commonjs/internal/nativeInterface.js.map +1 -0
- package/lib/commonjs/internal/types.js +2 -0
- package/lib/commonjs/internal/types.js.map +1 -0
- package/lib/module/index.js +155 -53
- package/lib/module/index.js.map +1 -1
- package/lib/module/{Airship.js → internal/Airship.js} +0 -0
- package/lib/module/internal/Airship.js.map +1 -0
- package/lib/module/{Location.js → internal/Location.js} +0 -0
- package/lib/module/internal/Location.js.map +1 -0
- package/lib/module/{MarketingCloud.js → internal/MarketingCloud.js} +0 -0
- package/lib/module/internal/MarketingCloud.js.map +1 -0
- package/lib/{commonjs → module/internal}/Poi.js +2 -3
- package/lib/module/internal/Poi.js.map +1 -0
- package/lib/module/{Region.js → internal/Region.js} +0 -0
- package/lib/module/internal/Region.js.map +1 -0
- package/lib/module/{Visit.js → internal/Visit.js} +0 -0
- package/lib/module/internal/Visit.js.map +1 -0
- package/lib/module/{Zoi.js → internal/Zoi.js} +0 -0
- package/lib/module/internal/Zoi.js.map +1 -0
- package/lib/module/internal/nativeInterface.js +9 -0
- package/lib/module/internal/nativeInterface.js.map +1 -0
- package/lib/module/internal/types.js +2 -0
- package/lib/module/internal/types.js.map +1 -0
- package/lib/typescript/index.d.ts +63 -4
- package/lib/typescript/{Airship.d.ts → internal/Airship.d.ts} +0 -0
- package/lib/typescript/{Location.d.ts → internal/Location.d.ts} +0 -0
- package/lib/typescript/{MarketingCloud.d.ts → internal/MarketingCloud.d.ts} +0 -0
- package/lib/typescript/{Poi.d.ts → internal/Poi.d.ts} +4 -2
- package/lib/typescript/{Region.d.ts → internal/Region.d.ts} +0 -0
- package/lib/typescript/{Visit.d.ts → internal/Visit.d.ts} +0 -0
- package/lib/typescript/{Zoi.d.ts → internal/Zoi.d.ts} +0 -0
- package/lib/typescript/internal/nativeInterface.d.ts +2 -0
- package/lib/typescript/internal/types.d.ts +18 -0
- package/package.json +1 -1
- package/src/index.tsx +173 -53
- package/src/{Airship.tsx → internal/Airship.tsx} +0 -0
- package/src/{Location.tsx → internal/Location.tsx} +0 -0
- package/src/{MarketingCloud.tsx → internal/MarketingCloud.tsx} +0 -0
- package/src/{Poi.tsx → internal/Poi.tsx} +4 -3
- package/src/{Region.tsx → internal/Region.tsx} +0 -0
- package/src/{Visit.tsx → internal/Visit.tsx} +0 -0
- package/src/{Zoi.tsx → internal/Zoi.tsx} +0 -0
- package/src/internal/nativeInterface.tsx +8 -0
- package/src/internal/types.tsx +20 -0
- package/android/.gradle/7.1.1/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.1.1/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/7.1.1/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/7.1.1/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.1.1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.1.1/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/lib/commonjs/Airship.js.map +0 -1
- package/lib/commonjs/MarketingCloud.js.map +0 -1
- package/lib/commonjs/Poi.js.map +0 -1
- package/lib/commonjs/Region.js.map +0 -1
- package/lib/commonjs/Visit.js.map +0 -1
- package/lib/commonjs/Zoi.js.map +0 -1
- package/lib/module/Airship.js.map +0 -1
- package/lib/module/Location.js.map +0 -1
- package/lib/module/MarketingCloud.js.map +0 -1
- package/lib/module/Poi.js.map +0 -1
- package/lib/module/Region.js.map +0 -1
- package/lib/module/Visit.js.map +0 -1
- package/lib/module/Zoi.js.map +0 -1
package/lib/module/index.js
CHANGED
|
@@ -1,43 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NativeEventEmitter } from 'react-native';
|
|
2
2
|
import uuid from 'react-native-uuid';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
// '- You rebuilt the app after installing the package\n' +
|
|
8
|
-
// '- You are not using Expo managed workflow\n';
|
|
9
|
-
// const PluginGeofencing = NativeModules.PluginGeofencing
|
|
10
|
-
// ? NativeModules.PluginGeofencing
|
|
11
|
-
// : new Proxy(
|
|
12
|
-
// {},
|
|
13
|
-
// {
|
|
14
|
-
// get() {
|
|
15
|
-
// throw new Error(LINKING_ERROR);
|
|
16
|
-
// },
|
|
17
|
-
// }
|
|
18
|
-
// );
|
|
19
|
-
|
|
20
|
-
if (!NativeModules.PluginGeofencing) {
|
|
21
|
-
throw new Error('NativeModules.PluginGeofencing is undefined');
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const PluginGeofencing = NativeModules.PluginGeofencing; // ? NativeModules.PluginGeofencing
|
|
25
|
-
// : new Proxy(
|
|
26
|
-
// {},
|
|
27
|
-
// {
|
|
28
|
-
// get() {
|
|
29
|
-
// throw new Error(LINKING_ERROR);
|
|
30
|
-
// },
|
|
31
|
-
// }
|
|
32
|
-
// );
|
|
33
|
-
|
|
3
|
+
import PluginGeofencing from './internal/nativeInterface';
|
|
4
|
+
import Location from './internal/Location';
|
|
5
|
+
import Region from './internal/Region';
|
|
6
|
+
import Poi from './internal/Poi';
|
|
34
7
|
const eventEmitter = new NativeEventEmitter(PluginGeofencing);
|
|
35
8
|
let subscriptionsLocation = {};
|
|
36
9
|
let subscriptionsRegion = {};
|
|
37
|
-
|
|
38
|
-
function multiply(a, b) {
|
|
39
|
-
return PluginGeofencing.multiply(a, b);
|
|
40
|
-
}
|
|
41
10
|
/**
|
|
42
11
|
* Initializes the Woosmap object
|
|
43
12
|
* @param arg0 A JSON object with Woosmap Key (optional) and tracking profile (`liveTracking`,`passiveTracking`,`visitsTracking`).
|
|
@@ -45,7 +14,6 @@ function multiply(a, b) {
|
|
|
45
14
|
error - A callback function that will be called on error.
|
|
46
15
|
*/
|
|
47
16
|
|
|
48
|
-
|
|
49
17
|
function initialize(arg0) {
|
|
50
18
|
if (arg0 == null) {
|
|
51
19
|
arg0 = {};
|
|
@@ -228,9 +196,148 @@ function setSFMCCredentials(arg0) {
|
|
|
228
196
|
function setPoiRadius(radius) {
|
|
229
197
|
return PluginGeofencing.setPoiRadius(radius);
|
|
230
198
|
}
|
|
199
|
+
/**
|
|
200
|
+
* Adds a custom region that you want to monitor.
|
|
201
|
+
* @param region A GeofenceRegion object with latitude, longitude, radius and type.
|
|
202
|
+
* @returns promise with A callback that will be called on success or error.
|
|
203
|
+
*/
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
function addRegion(region) {
|
|
207
|
+
return PluginGeofencing.addRegion(region);
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Retrieve saved region info
|
|
211
|
+
* @param regionID If it pass return info for given region or return all region info
|
|
212
|
+
* @returns promise with A callback that will be called on success or error.
|
|
213
|
+
*/
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
function getRegions(regionID) {
|
|
217
|
+
if (regionID == null) {
|
|
218
|
+
return PluginGeofencing.getAllRegions().then(result => {
|
|
219
|
+
var formatted = [];
|
|
220
|
+
result.forEach(item => {
|
|
221
|
+
formatted.push(Region.jsonToObj(item));
|
|
222
|
+
});
|
|
223
|
+
return Promise.resolve(formatted);
|
|
224
|
+
}).catch(e => {
|
|
225
|
+
return Promise.reject(e);
|
|
226
|
+
});
|
|
227
|
+
} else {
|
|
228
|
+
return PluginGeofencing.getRegions(regionID).then(result => {
|
|
229
|
+
var formatted = [];
|
|
230
|
+
formatted.push(Region.jsonToObj(result));
|
|
231
|
+
return Promise.resolve(formatted);
|
|
232
|
+
}).catch(e => {
|
|
233
|
+
return Promise.reject(e);
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Retrieve saved location info
|
|
239
|
+
* @param locationID - Optional in case of location id pass it return only that location info
|
|
240
|
+
* @returns promise with A callback that will be called on success or error.
|
|
241
|
+
*/
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
function getLocations(locationID) {
|
|
245
|
+
if (locationID == null) {
|
|
246
|
+
return PluginGeofencing.getAllLocations().then(result => {
|
|
247
|
+
var formatted = [];
|
|
248
|
+
result.forEach(item => {
|
|
249
|
+
formatted.push(Location.jsonToObj(item));
|
|
250
|
+
});
|
|
251
|
+
return Promise.resolve(formatted);
|
|
252
|
+
}).catch(e => {
|
|
253
|
+
return Promise.reject(e);
|
|
254
|
+
});
|
|
255
|
+
} else {
|
|
256
|
+
return PluginGeofencing.getLocation(locationID).then(result => {
|
|
257
|
+
var formatted = [];
|
|
258
|
+
formatted.push(Location.jsonToObj(result));
|
|
259
|
+
return Promise.resolve(formatted);
|
|
260
|
+
}).catch(e => {
|
|
261
|
+
return Promise.reject(e);
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Retrieve saved POI info
|
|
267
|
+
* @param poiID - Optional in case of poi id (LocationID or StoreID) pass it return only that POI info
|
|
268
|
+
* @returns promise with A callback that will be called on success or error.
|
|
269
|
+
*/
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
function getPois(poiID) {
|
|
273
|
+
if (poiID == null) {
|
|
274
|
+
return PluginGeofencing.getAllPois().then(result => {
|
|
275
|
+
var formatted = [];
|
|
276
|
+
result.forEach(item => {
|
|
277
|
+
formatted.push(Poi.jsonToObj(item));
|
|
278
|
+
});
|
|
279
|
+
return Promise.resolve(formatted);
|
|
280
|
+
}).catch(e => {
|
|
281
|
+
return Promise.reject(e);
|
|
282
|
+
});
|
|
283
|
+
} else {
|
|
284
|
+
return PluginGeofencing.getPoi(poiID).then(result => {
|
|
285
|
+
var formatted = [];
|
|
286
|
+
formatted.push(Poi.jsonToObj(result));
|
|
287
|
+
return Promise.resolve(formatted);
|
|
288
|
+
}).catch(e => {
|
|
289
|
+
return Promise.reject(e);
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Remove saved region info
|
|
295
|
+
* @param regionID If it pass remove info for given region or removes all region info
|
|
296
|
+
* @returns promise with A callback that will be called on success or error.
|
|
297
|
+
*/
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
function removeRegions(regionID) {
|
|
301
|
+
if (regionID == null) {
|
|
302
|
+
return PluginGeofencing.removeAllRegions();
|
|
303
|
+
} else {
|
|
304
|
+
return PluginGeofencing.removeRegion(regionID);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Remove saved location info
|
|
309
|
+
* @returns promise with A callback that will be called on success or error.
|
|
310
|
+
*/
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
function removeLocations() {
|
|
314
|
+
return PluginGeofencing.removeAllLocations();
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Remove saved POI info
|
|
318
|
+
* @returns promise with A callback that will be called on success or error.
|
|
319
|
+
*/
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
function removePois() {
|
|
323
|
+
return PluginGeofencing.removeAllPois();
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* if preset tracking profiles don’t fit with your use cases, you can build your own profile and uses the startCustomTracking() method.
|
|
327
|
+
* There are two way to host the json file:
|
|
328
|
+
* - included in the client application (local)
|
|
329
|
+
* - hosted externally in a file folder in your information system (external)
|
|
330
|
+
* @param sourceType local/external
|
|
331
|
+
* @param source location of profile to be fetch
|
|
332
|
+
* @returns promise with A callback that will be called on success or error.
|
|
333
|
+
*/
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
function startCustomTracking(sourceType, source) {
|
|
337
|
+
return PluginGeofencing.startCustomTracking(sourceType, source);
|
|
338
|
+
}
|
|
231
339
|
|
|
232
340
|
const WoosmapGeofencing = {
|
|
233
|
-
multiply,
|
|
234
341
|
initialize,
|
|
235
342
|
setWoosmapApiKey,
|
|
236
343
|
startTracking,
|
|
@@ -242,20 +349,15 @@ const WoosmapGeofencing = {
|
|
|
242
349
|
watchRegions,
|
|
243
350
|
clearRegionsWatch,
|
|
244
351
|
setSFMCCredentials,
|
|
245
|
-
setPoiRadius
|
|
352
|
+
setPoiRadius,
|
|
353
|
+
addRegion,
|
|
354
|
+
getRegions,
|
|
355
|
+
removeRegions,
|
|
356
|
+
getLocations,
|
|
357
|
+
removeLocations,
|
|
358
|
+
getPois,
|
|
359
|
+
removePois,
|
|
360
|
+
startCustomTracking
|
|
246
361
|
};
|
|
247
|
-
|
|
248
|
-
* JavaScript code and the tests
|
|
249
|
-
*/
|
|
250
|
-
//let nativeEventEmitter: NativeEventEmitter | null = null;
|
|
251
|
-
|
|
252
|
-
export default WoosmapGeofencing; // module.exports = {
|
|
253
|
-
// WoosmapGeofencing,
|
|
254
|
-
// get GeolocationEventEmitter() {
|
|
255
|
-
// if (!nativeEventEmitter) {
|
|
256
|
-
// nativeEventEmitter = new NativeEventEmitter(PluginGeofencing);
|
|
257
|
-
// }
|
|
258
|
-
// return nativeEventEmitter;
|
|
259
|
-
// },
|
|
260
|
-
// };
|
|
362
|
+
export default WoosmapGeofencing;
|
|
261
363
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.tsx"],"names":["NativeModules","NativeEventEmitter","uuid","Location","Region","PluginGeofencing","Error","eventEmitter","subscriptionsLocation","subscriptionsRegion","multiply","a","b","initialize","arg0","setWoosmapApiKey","apiKey","startTracking","trackingProfile","stopTracking","requestPermissions","background","getPermissionsStatus","watchLocation","success","error","watchID","v1","toString","successCallback","result","jsonToObj","addListener","clearLocationWatch","removeAllListeners","clearAllLocationWatch","saved","removeListener","arg1","undefined","watchRegions","clearRegionsWatch","clearAllRegionsWatch","setSFMCCredentials","setPoiRadius","radius","WoosmapGeofencing"],"mappings":"AAAA,SAASA,aAAT,EAAwBC,kBAAxB,QAAkD,cAAlD;AACA,OAAOC,IAAP,MAAiB,mBAAjB;AACA,OAAOC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itter } from 'react-native';\nimport uuid from 'react-native-uuid';\nimport Location from './Location';\nimport Region from './Region';\n\n// const LINKING_ERROR =\n// `The package 'react-native-plugin-geofencing' doesn't seem to be linked. Make sure: \\n\\n` +\n// Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n// '- You rebuilt the app after installing the package\\n' +\n// '- You are not using Expo managed workflow\\n';\n\n// const PluginGeofencing = NativeModules.PluginGeofencing\n// ? NativeModules.PluginGeofencing\n// : new Proxy(\n// {},\n// {\n// get() {\n// throw new Error(LINKING_ERROR);\n// },\n// }\n// );\n\nif (!NativeModules.PluginGeofencing) {\n throw new Error('NativeModules.PluginGeofencing is undefined');\n}\nconst PluginGeofencing = NativeModules.PluginGeofencing;\n// ? NativeModules.PluginGeofencing\n// : new Proxy(\n// {},\n// {\n// get() {\n// throw new Error(LINKING_ERROR);\n// },\n// }\n// );\nconst eventEmitter = new NativeEventEmitter(PluginGeofencing);\n\nlet subscriptionsLocation: any = {};\nlet subscriptionsRegion: any = {};\n\nfunction multiply(a: number, b: number): Promise<number> {\n return PluginGeofencing.multiply(a, b);\n}\n/**\n * Initializes the Woosmap object\n * @param arg0 A JSON object with Woosmap Key (optional) and tracking profile (`liveTracking`,`passiveTracking`,`visitsTracking`).\n * @returns promise:success - A callback function that will be called on success.\n error - A callback function that will be called on error.\n */\nfunction initialize(arg0?: any): Promise<string> {\n if (arg0 == null) {\n arg0 = {};\n }\n return PluginGeofencing.initialize(arg0);\n}\n\n/**\n * A method that sets Woosmap private API key\n * @param apiKey new API key.\n * @returns promise:success - A callback function that will be called on success.\n error - A callback function that will be called on error.\n */\nfunction setWoosmapApiKey(apiKey: string): Promise<string> {\n return PluginGeofencing.setWoosmapApiKey([apiKey]);\n}\n\n/**\n * A method to start tracking the user's location.\n * @param trackingProfile The configuration profile to use. Values could be anyone of the following: liveTracking, passiveTracking and visitsTracking.\n * @returns promise:success - A callback function that will be called on success.\n error - A callback function that will be called on error.\n */\nfunction startTracking(trackingProfile: string): Promise<string> {\n return PluginGeofencing.startTracking([trackingProfile]);\n}\n\n/**\n * Stops tracking the user's location.\n * @returns promise:success - A callback function that will be called on success.\n error - A callback function that will be called on error.\n */\nfunction stopTracking(): Promise<string> {\n return PluginGeofencing.stopTracking();\n}\n\n/**\n * A method to request the required permissions to collect locations.\n * @param background - A boolean value indicating whether the permissions to request is for background or foreground permission.\n * @returns A callback that will be called on successful authorization by the app. A callback that will be called when the app denies permission. The plugin will return an object with a message - 'Permission Denied'.\n */\nfunction requestPermissions(background?: boolean): Promise<string> {\n if (background == null) {\n background = false;\n }\n return PluginGeofencing.requestPermissions([background]);\n}\n\n/**\n * A method to check if the app has granted required permissions to track location.\n * @returns A callback that will be called with the following status - GRANTED_BACKGROUND, GRANTED_FOREGROUND, DENIED\n */\nfunction getPermissionsStatus(): Promise<string> {\n return PluginGeofencing.getPermissionsStatus();\n}\n\n/**\n * Method will\ninvoke callback and pass a location object as a parameter. Method will return a watchId . This id can be used to remove a callback.\n * @param success new location found callback\n * @param error error status callback\n * @returns watchid\n */\nfunction watchLocation(\n success: (result: Location) => any,\n error?: any\n): Promise<string> {\n const watchID = uuid.v1().toString();\n\n const successCallback = (result: any) => {\n success(Location.jsonToObj(result));\n };\n\n subscriptionsLocation[watchID] = [\n eventEmitter.addListener('geolocationDidChange', successCallback),\n error ? eventEmitter.addListener('geolocationError', error) : null,\n ];\n return PluginGeofencing.watchLocation(watchID);\n}\n\n/**\n * A method to stop tracking location for a specified watch. If watchId is null or undefined the plugin will clear all watches.\n * @param watchID Reference ID.\n * @returns return promise with same id back in case of success otherwise error info\n */\nfunction clearLocationWatch(watchID?: string): Promise<string> {\n if (watchID == null) {\n eventEmitter.removeAllListeners('geolocationDidChange');\n eventEmitter.removeAllListeners('geolocationError');\n subscriptionsLocation = {};\n return PluginGeofencing.clearAllLocationWatch();\n } else {\n const saved = subscriptionsLocation[watchID];\n if (saved) {\n const arg0 = saved[0];\n eventEmitter.removeListener('geolocationDidChange', arg0);\n const arg1 = saved[1];\n if (arg1) {\n eventEmitter.removeListener('geolocationError', arg1);\n }\n subscriptionsLocation[watchID] = undefined;\n }\n return PluginGeofencing.clearLocationWatch(watchID);\n }\n}\n\n/**\n * A method to to track Regions. Method will invoke a callback with Region object. Method will return\na watch id which can be used later to remove the callback.\n * @param success new location found callback\n * @param error error status callback\n * @returns watchid\n */\nfunction watchRegions(\n success: (result: Region) => any,\n error?: any\n): Promise<string> {\n const watchID = uuid.v1().toString();\n\n const successCallback = (result: any) => {\n success(Region.jsonToObj(result));\n };\n\n subscriptionsRegion[watchID] = [\n eventEmitter.addListener('woosmapgeofenceRegionDidChange', successCallback),\n error\n ? eventEmitter.addListener('woosmapgeofenceRegionError', error)\n : null,\n ];\n return PluginGeofencing.watchRegions(watchID);\n}\n\n/**\n * A method to clear the specified watch tracing the regions. If the watchId is null or undefined then it will clear all the watches tracking the regions.\n * @param watchID Reference ID.\n * @returns return promise with same id back in case of success otherwise error info\n */\nfunction clearRegionsWatch(watchID: string): Promise<string> {\n if (watchID == null) {\n eventEmitter.removeAllListeners('woosmapgeofenceRegionDidChange');\n eventEmitter.removeAllListeners('woosmapgeofenceRegionError');\n subscriptionsRegion = {};\n return PluginGeofencing.clearAllRegionsWatch();\n } else {\n const saved = subscriptionsRegion[watchID];\n if (saved) {\n const arg0 = saved[0];\n eventEmitter.removeListener('woosmapgeofenceRegionDidChange', arg0);\n const arg1 = saved[1];\n if (arg1) {\n eventEmitter.removeListener('woosmapgeofenceRegionError', arg1);\n }\n subscriptionsRegion[watchID] = undefined;\n }\n return PluginGeofencing.clearRegionsWatch(watchID);\n }\n}\n/**\n * Sets Sales Force Marketing Cloud (SFMC) credentials\n * @param arg0 A JSON object with SFMC credentials. Keys authenticationBaseURI, restBaseURI, client_id, client_secret and contactKey are required.\n * @returns promise with A callback that will be called on success or error.\n */\nfunction setSFMCCredentials(arg0: Object): Promise<string> {\n return PluginGeofencing.setSFMCCredentials(arg0);\n}\n\n/**\n * When you create a geofence around a POI, manually define the radius value (100.0) or choose the user_properties subfield that corresponds to radius value of the geofence (\"radiusPOI\").\n * @param radius can be integer or string.\n * @returns promise with A callback that will be called on success or error.\n */\nfunction setPoiRadius(radius: string): Promise<string> {\n return PluginGeofencing.setPoiRadius(radius);\n}\n\nconst WoosmapGeofencing = {\n multiply,\n initialize,\n setWoosmapApiKey,\n startTracking,\n requestPermissions,\n getPermissionsStatus,\n stopTracking,\n watchLocation,\n clearLocationWatch,\n watchRegions,\n clearRegionsWatch,\n setSFMCCredentials,\n setPoiRadius,\n};\n\n/* We export the native interface in this way to give easy shared access to it between the\n * JavaScript code and the tests\n */\n//let nativeEventEmitter: NativeEventEmitter | null = null;\n\nexport default WoosmapGeofencing;\n// module.exports = {\n// WoosmapGeofencing,\n// get GeolocationEventEmitter() {\n// if (!nativeEventEmitter) {\n// nativeEventEmitter = new NativeEventEmitter(PluginGeofencing);\n// }\n// return nativeEventEmitter;\n// },\n// };\n"]}
|
|
1
|
+
{"version":3,"names":["NativeEventEmitter","uuid","PluginGeofencing","Location","Region","Poi","eventEmitter","subscriptionsLocation","subscriptionsRegion","initialize","arg0","setWoosmapApiKey","apiKey","startTracking","trackingProfile","stopTracking","requestPermissions","background","getPermissionsStatus","watchLocation","success","error","watchID","v1","toString","successCallback","result","jsonToObj","addListener","clearLocationWatch","removeAllListeners","clearAllLocationWatch","saved","removeListener","arg1","undefined","watchRegions","clearRegionsWatch","clearAllRegionsWatch","setSFMCCredentials","setPoiRadius","radius","addRegion","region","getRegions","regionID","getAllRegions","then","formatted","forEach","item","push","Promise","resolve","catch","e","reject","getLocations","locationID","getAllLocations","getLocation","getPois","poiID","getAllPois","getPoi","removeRegions","removeAllRegions","removeRegion","removeLocations","removeAllLocations","removePois","removeAllPois","startCustomTracking","sourceType","source","WoosmapGeofencing"],"sources":["index.tsx"],"sourcesContent":["import { NativeEventEmitter } from 'react-native';\nimport uuid from 'react-native-uuid';\nimport PluginGeofencing from './internal/nativeInterface';\nimport Location from './internal/Location';\nimport Region from './internal/Region';\nimport Poi from './internal/Poi';\nimport type {\n GeofenceRegion,\n RegionType,\n ProfileSource,\n} from './internal/types';\n\nconst eventEmitter = new NativeEventEmitter(PluginGeofencing);\n\nlet subscriptionsLocation: any = {};\nlet subscriptionsRegion: any = {};\n/**\n * Initializes the Woosmap object\n * @param arg0 A JSON object with Woosmap Key (optional) and tracking profile (`liveTracking`,`passiveTracking`,`visitsTracking`).\n * @returns promise:success - A callback function that will be called on success.\n error - A callback function that will be called on error.\n */\nfunction initialize(arg0?: any): Promise<string> {\n if (arg0 == null) {\n arg0 = {};\n }\n return PluginGeofencing.initialize(arg0);\n}\n\n/**\n * A method that sets Woosmap private API key\n * @param apiKey new API key.\n * @returns promise:success - A callback function that will be called on success.\n error - A callback function that will be called on error.\n */\nfunction setWoosmapApiKey(apiKey: string): Promise<string> {\n return PluginGeofencing.setWoosmapApiKey([apiKey]);\n}\n\n/**\n * A method to start tracking the user's location.\n * @param trackingProfile The configuration profile to use. Values could be anyone of the following: liveTracking, passiveTracking and visitsTracking.\n * @returns promise:success - A callback function that will be called on success.\n error - A callback function that will be called on error.\n */\nfunction startTracking(trackingProfile: string): Promise<string> {\n return PluginGeofencing.startTracking([trackingProfile]);\n}\n\n/**\n * Stops tracking the user's location.\n * @returns promise:success - A callback function that will be called on success.\n error - A callback function that will be called on error.\n */\nfunction stopTracking(): Promise<string> {\n return PluginGeofencing.stopTracking();\n}\n\n/**\n * A method to request the required permissions to collect locations.\n * @param background - A boolean value indicating whether the permissions to request is for background or foreground permission.\n * @returns A callback that will be called on successful authorization by the app. A callback that will be called when the app denies permission. The plugin will return an object with a message - 'Permission Denied'.\n */\nfunction requestPermissions(background?: boolean): Promise<string> {\n if (background == null) {\n background = false;\n }\n return PluginGeofencing.requestPermissions([background]);\n}\n\n/**\n * A method to check if the app has granted required permissions to track location.\n * @returns A callback that will be called with the following status - GRANTED_BACKGROUND, GRANTED_FOREGROUND, DENIED\n */\nfunction getPermissionsStatus(): Promise<string> {\n return PluginGeofencing.getPermissionsStatus();\n}\n\n/**\n * Method will\ninvoke callback and pass a location object as a parameter. Method will return a watchId . This id can be used to remove a callback.\n * @param success new location found callback\n * @param error error status callback\n * @returns watchid\n */\nfunction watchLocation(\n success: (result: Location) => any,\n error?: any\n): Promise<string> {\n const watchID = uuid.v1().toString();\n\n const successCallback = (result: any) => {\n success(Location.jsonToObj(result));\n };\n\n subscriptionsLocation[watchID] = [\n eventEmitter.addListener('geolocationDidChange', successCallback),\n error ? eventEmitter.addListener('geolocationError', error) : null,\n ];\n return PluginGeofencing.watchLocation(watchID);\n}\n\n/**\n * A method to stop tracking location for a specified watch. If watchId is null or undefined the plugin will clear all watches.\n * @param watchID Reference ID.\n * @returns return promise with same id back in case of success otherwise error info\n */\nfunction clearLocationWatch(watchID?: string): Promise<string> {\n if (watchID == null) {\n eventEmitter.removeAllListeners('geolocationDidChange');\n eventEmitter.removeAllListeners('geolocationError');\n subscriptionsLocation = {};\n return PluginGeofencing.clearAllLocationWatch();\n } else {\n const saved = subscriptionsLocation[watchID];\n if (saved) {\n const arg0 = saved[0];\n eventEmitter.removeListener('geolocationDidChange', arg0);\n const arg1 = saved[1];\n if (arg1) {\n eventEmitter.removeListener('geolocationError', arg1);\n }\n subscriptionsLocation[watchID] = undefined;\n }\n return PluginGeofencing.clearLocationWatch(watchID);\n }\n}\n\n/**\n * A method to to track Regions. Method will invoke a callback with Region object. Method will return\na watch id which can be used later to remove the callback.\n * @param success new location found callback\n * @param error error status callback\n * @returns watchid\n */\nfunction watchRegions(\n success: (result: Region) => any,\n error?: any\n): Promise<string> {\n const watchID = uuid.v1().toString();\n\n const successCallback = (result: any) => {\n success(Region.jsonToObj(result));\n };\n\n subscriptionsRegion[watchID] = [\n eventEmitter.addListener('woosmapgeofenceRegionDidChange', successCallback),\n error\n ? eventEmitter.addListener('woosmapgeofenceRegionError', error)\n : null,\n ];\n return PluginGeofencing.watchRegions(watchID);\n}\n\n/**\n * A method to clear the specified watch tracing the regions. If the watchId is null or undefined then it will clear all the watches tracking the regions.\n * @param watchID Reference ID.\n * @returns return promise with same id back in case of success otherwise error info\n */\nfunction clearRegionsWatch(watchID: string): Promise<string> {\n if (watchID == null) {\n eventEmitter.removeAllListeners('woosmapgeofenceRegionDidChange');\n eventEmitter.removeAllListeners('woosmapgeofenceRegionError');\n subscriptionsRegion = {};\n return PluginGeofencing.clearAllRegionsWatch();\n } else {\n const saved = subscriptionsRegion[watchID];\n if (saved) {\n const arg0 = saved[0];\n eventEmitter.removeListener('woosmapgeofenceRegionDidChange', arg0);\n const arg1 = saved[1];\n if (arg1) {\n eventEmitter.removeListener('woosmapgeofenceRegionError', arg1);\n }\n subscriptionsRegion[watchID] = undefined;\n }\n return PluginGeofencing.clearRegionsWatch(watchID);\n }\n}\n/**\n * Sets Sales Force Marketing Cloud (SFMC) credentials\n * @param arg0 A JSON object with SFMC credentials. Keys authenticationBaseURI, restBaseURI, client_id, client_secret and contactKey are required.\n * @returns promise with A callback that will be called on success or error.\n */\nfunction setSFMCCredentials(arg0: Object): Promise<string> {\n return PluginGeofencing.setSFMCCredentials(arg0);\n}\n\n/**\n * When you create a geofence around a POI, manually define the radius value (100.0) or choose the user_properties subfield that corresponds to radius value of the geofence (\"radiusPOI\").\n * @param radius can be integer or string.\n * @returns promise with A callback that will be called on success or error.\n */\nfunction setPoiRadius(radius: string): Promise<string> {\n return PluginGeofencing.setPoiRadius(radius);\n}\n/**\n * Adds a custom region that you want to monitor.\n * @param region A GeofenceRegion object with latitude, longitude, radius and type.\n * @returns promise with A callback that will be called on success or error.\n */\n\nfunction addRegion(region: GeofenceRegion): Promise<string> {\n return PluginGeofencing.addRegion(region);\n}\n/**\n * Retrieve saved region info\n * @param regionID If it pass return info for given region or return all region info\n * @returns promise with A callback that will be called on success or error.\n */\nfunction getRegions(regionID?: string): Promise<Region[]> {\n if (regionID == null) {\n return PluginGeofencing.getAllRegions()\n .then((result: any[]) => {\n var formatted: Region[] = [];\n result.forEach((item) => {\n formatted.push(Region.jsonToObj(item));\n });\n return Promise.resolve(formatted);\n })\n .catch((e: any) => {\n return Promise.reject(e);\n });\n } else {\n return PluginGeofencing.getRegions(regionID)\n .then((result: any) => {\n var formatted: Region[] = [];\n formatted.push(Region.jsonToObj(result));\n return Promise.resolve(formatted);\n })\n .catch((e: any) => {\n return Promise.reject(e);\n });\n }\n}\n\n/**\n * Retrieve saved location info\n * @param locationID - Optional in case of location id pass it return only that location info\n * @returns promise with A callback that will be called on success or error.\n */\nfunction getLocations(locationID?: string): Promise<Location[]> {\n if (locationID == null) {\n return PluginGeofencing.getAllLocations()\n .then((result: any[]) => {\n var formatted: Location[] = [];\n result.forEach((item) => {\n formatted.push(Location.jsonToObj(item));\n });\n return Promise.resolve(formatted);\n })\n .catch((e: any) => {\n return Promise.reject(e);\n });\n } else {\n return PluginGeofencing.getLocation(locationID)\n .then((result: any) => {\n var formatted: Location[] = [];\n formatted.push(Location.jsonToObj(result));\n return Promise.resolve(formatted);\n })\n .catch((e: any) => {\n return Promise.reject(e);\n });\n }\n}\n\n/**\n * Retrieve saved POI info\n * @param poiID - Optional in case of poi id (LocationID or StoreID) pass it return only that POI info\n * @returns promise with A callback that will be called on success or error.\n */\nfunction getPois(poiID?: string): Promise<Poi[]> {\n if (poiID == null) {\n return PluginGeofencing.getAllPois()\n .then((result: any[]) => {\n var formatted: Poi[] = [];\n result.forEach((item) => {\n formatted.push(Poi.jsonToObj(item));\n });\n return Promise.resolve(formatted);\n })\n .catch((e: any) => {\n return Promise.reject(e);\n });\n } else {\n return PluginGeofencing.getPoi(poiID)\n .then((result: any) => {\n var formatted: Poi[] = [];\n formatted.push(Poi.jsonToObj(result));\n return Promise.resolve(formatted);\n })\n .catch((e: any) => {\n return Promise.reject(e);\n });\n }\n}\n\n/**\n * Remove saved region info\n * @param regionID If it pass remove info for given region or removes all region info\n * @returns promise with A callback that will be called on success or error.\n */\nfunction removeRegions(regionID?: string): Promise<string> {\n if (regionID == null) {\n return PluginGeofencing.removeAllRegions();\n } else {\n return PluginGeofencing.removeRegion(regionID);\n }\n}\n\n/**\n * Remove saved location info\n * @returns promise with A callback that will be called on success or error.\n */\nfunction removeLocations(): Promise<string> {\n return PluginGeofencing.removeAllLocations();\n}\n\n/**\n * Remove saved POI info\n * @returns promise with A callback that will be called on success or error.\n */\nfunction removePois(): Promise<string> {\n return PluginGeofencing.removeAllPois();\n}\n/**\n * if preset tracking profiles don’t fit with your use cases, you can build your own profile and uses the startCustomTracking() method. \n * There are two way to host the json file:\n * - included in the client application (local)\n * - hosted externally in a file folder in your information system (external)\n * @param sourceType local/external\n * @param source location of profile to be fetch\n * @returns promise with A callback that will be called on success or error.\n */\nfunction startCustomTracking(\n sourceType: ProfileSource,\n source: string\n): Promise<string> {\n return PluginGeofencing.startCustomTracking(sourceType, source);\n}\n\nexport type {\n RegionType,\n GeofenceRegion,\n Region,\n Location,\n Poi,\n ProfileSource,\n};\n\nconst WoosmapGeofencing = {\n initialize,\n setWoosmapApiKey,\n startTracking,\n requestPermissions,\n getPermissionsStatus,\n stopTracking,\n watchLocation,\n clearLocationWatch,\n watchRegions,\n clearRegionsWatch,\n setSFMCCredentials,\n setPoiRadius,\n addRegion,\n getRegions,\n removeRegions,\n getLocations,\n removeLocations,\n getPois,\n removePois,\n startCustomTracking,\n};\n\nexport default WoosmapGeofencing;\n"],"mappings":"AAAA,SAASA,kBAAT,QAAmC,cAAnC;AACA,OAAOC,IAAP,MAAiB,mBAAjB;AACA,OAAOC,gBAAP,MAA6B,4BAA7B;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,GAAP,MAAgB,gBAAhB;AAOA,MAAMC,YAAY,GAAG,IAAIN,kBAAJ,CAAuBE,gBAAvB,CAArB;AAEA,IAAIK,qBAA0B,GAAG,EAAjC;AACA,IAAIC,mBAAwB,GAAG,EAA/B;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,UAAT,CAAoBC,IAApB,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S,UAnBwB;EAoBxBE;AApBwB,CAA1B;AAuBA,eAAeG,iBAAf"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Airship","constructor","name","properties","Name","Properties","jsonToObj","json","module","exports"],"sources":["Airship.tsx"],"sourcesContent":["/**\n * @classdesc A class that represents the Airship object.\n * @constructs Airship\n * @param {string} name The name of the custom event.\n * @param {string} properties The attributes of the POI such as `name`, `address`, `zipCode` etc.\n */\nclass Airship {\n Name: String;\n Properties: String;\n constructor(name: String, properties: String) {\n this.Name = name;\n this.Properties = properties;\n }\n /**\n * Converts json object to an object of type Airship.\n * @param {Object} json The json representation of Airship.\n * @returns Object\n * @memberof Airship\n */\n static jsonToObj(json: any) {\n return new Airship(json.name, json.properties);\n }\n}\nmodule.exports = Airship;\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,OAAN,CAAc;EAGZC,WAAW,CAACC,IAAD,EAAeC,UAAf,EAAmC;IAAA;;IAAA;;IAC5C,KAAKC,IAAL,GAAYF,IAAZ;IACA,KAAKG,UAAL,GAAkBF,UAAlB;EACD;EACD;AACF;AACA;AACA;AACA;AACA;;;EACkB,OAATG,SAAS,CAACC,IAAD,EAAY;IAC1B,OAAO,IAAIP,OAAJ,CAAYO,IAAI,CAACL,IAAjB,EAAuBK,IAAI,CAACJ,UAA5B,CAAP;EACD;;AAfW;;AAiBdK,MAAM,CAACC,OAAP,GAAiBT,OAAjB"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Location","constructor","date","latitude","locationdescription","locationid","longitude","Date","Latitude","Locationdescription","Locationid","Longitude","jsonToObj","json"],"sources":["Location.tsx"],"sourcesContent":["/**\n * @classdesc A class that represents the location object.\n * @constructs Location\n * @param {number} date The datetime stamp.\n * @param {number} latitude The latitude of the location.\n\n * @param {string} Locationdescription The description of the location. \n * @param {string} Locationid A unique identifier for the location.\n * @param {number} longitude The longitude of the location.\n */\nclass Location {\n Date: number;\n Latitude: number;\n Locationdescription: string;\n Locationid: string;\n Longitude: number;\n constructor(\n date: number,\n latitude: number,\n locationdescription: string,\n locationid: string,\n longitude: number\n ) {\n this.Date = date;\n this.Latitude = latitude;\n this.Locationdescription = locationdescription;\n this.Locationid = locationid;\n this.Longitude = longitude;\n }\n /**\n * Converts json object to an object of type Location.\n * @param {Object} json The json representation of the Location.\n * @returns Object\n * @memberof Location\n */\n static jsonToObj(json: any) {\n return new Location(\n json.date,\n json.latitude,\n json.locationdescription,\n json.locationid,\n json.longitude\n );\n }\n}\nexport default Location;\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,QAAN,CAAe;EAMbC,WAAW,CACTC,IADS,EAETC,QAFS,EAGTC,mBAHS,EAITC,UAJS,EAKTC,SALS,EAMT;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IACA,KAAKC,IAAL,GAAYL,IAAZ;IACA,KAAKM,QAAL,GAAgBL,QAAhB;IACA,KAAKM,mBAAL,GAA2BL,mBAA3B;IACA,KAAKM,UAAL,GAAkBL,UAAlB;IACA,KAAKM,SAAL,GAAiBL,SAAjB;EACD;EACD;AACF;AACA;AACA;AACA;AACA;;;EACkB,OAATM,SAAS,CAACC,IAAD,EAAY;IAC1B,OAAO,IAAIb,QAAJ,CACLa,IAAI,CAACX,IADA,EAELW,IAAI,CAACV,QAFA,EAGLU,IAAI,CAACT,mBAHA,EAILS,IAAI,CAACR,UAJA,EAKLQ,IAAI,CAACP,SALA,CAAP;EAOD;;AAjCY;;AAmCf,eAAeN,QAAf"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["MarketingCloud","constructor","name","properties","Name","Properties","jsonToObj","json","module","exports"],"sources":["MarketingCloud.tsx"],"sourcesContent":["/**\n * @classdesc A class that represents the Marketing Cloud object.\n * @constructs MarketingCloud\n * @param {string} name The name of the custom event.\n * @param {string} properties The attributes of the POI such as `name`, `address`, `zipCode` etc.\n */\nclass MarketingCloud {\n Name: string;\n Properties: string;\n constructor(name: string, properties: string) {\n this.Name = name;\n this.Properties = properties;\n }\n /**\n * Converts json object to an object of type MarketingCloud.\n * @param {Object} json The json representation of MarketingCloud.\n * @returns Object\n * @memberof MarketingCloud\n */\n static jsonToObj(json: any) {\n return new MarketingCloud(json.name, json.properties);\n }\n}\nmodule.exports = MarketingCloud;\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,cAAN,CAAqB;EAGnBC,WAAW,CAACC,IAAD,EAAeC,UAAf,EAAmC;IAAA;;IAAA;;IAC5C,KAAKC,IAAL,GAAYF,IAAZ;IACA,KAAKG,UAAL,GAAkBF,UAAlB;EACD;EACD;AACF;AACA;AACA;AACA;AACA;;;EACkB,OAATG,SAAS,CAACC,IAAD,EAAY;IAC1B,OAAO,IAAIP,cAAJ,CAAmBO,IAAI,CAACL,IAAxB,EAA8BK,IAAI,CAACJ,UAAnC,CAAP;EACD;;AAfkB;;AAiBrBK,MAAM,CAACC,OAAP,GAAiBT,cAAjB"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
1
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4
2
|
|
|
5
3
|
/**
|
|
@@ -14,6 +12,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
14
12
|
* @param {number} distance The distance between the POI and the user's location.
|
|
15
13
|
* @param {number} duration The duration to travel to the POI from the user's location.
|
|
16
14
|
* @param {number} latitude The latitude of the POI.
|
|
15
|
+
* @param {string} locationid Location id of the POI.
|
|
17
16
|
* @param {number} longitude The longitude of the POI.
|
|
18
17
|
* @param {string} zipcode The zip code of the POI.
|
|
19
18
|
* @param {number} radius The radius of the POI.
|
|
@@ -92,5 +91,5 @@ class Poi {
|
|
|
92
91
|
|
|
93
92
|
}
|
|
94
93
|
|
|
95
|
-
|
|
94
|
+
export default Poi;
|
|
96
95
|
//# sourceMappingURL=Poi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Poi","constructor","jsondata","city","idstore","name","date","distance","duration","latitude","locationid","longitude","zipcode","radius","address","countrycode","tags","types","contact","Jsondata","City","Idstore","Name","Date","Distance","Duration","Latitude","Locationid","Longitude","Zipcode","Radius","Countrycode","Tags","Types","Contact","Address","jsonToObj","json"],"sources":["Poi.tsx"],"sourcesContent":["/**\n * A class that represents the POI object.\n * @classdesc A class that represents the POI object.\n * @constructs Poi\n * @param {Object} jsonData A json object representing the POI.\n * @param {string} city The name of the city the POI belongs to.\n * @param {string} idstore A unique identifier for the POI.\n * @param {name} name The name of the POI.\n * @param {number} date The datetime stamp.\n * @param {number} distance The distance between the POI and the user's location.\n * @param {number} duration The duration to travel to the POI from the user's location.\n * @param {number} latitude The latitude of the POI.\n * @param {string} locationid Location id of the POI.\n * @param {number} longitude The longitude of the POI.\n * @param {string} zipcode The zip code of the POI.\n * @param {number} radius The radius of the POI.\n * @param {string} address The address of the POI.\n * @param {string} countrycode The countrycode of the POI.\n * @param {string} tags The tags for the POI.\n * @param {string} types The types of the POI.\n * @param {string} contact The contact for the POI.\n */\nclass Poi {\n Jsondata: object;\n City: string;\n Idstore: string;\n Name: string;\n Date: number;\n Distance: number;\n Duration: number;\n Latitude: number;\n Locationid: string;\n Longitude: number;\n Zipcode: string;\n Radius: number;\n Countrycode: string;\n Tags: string;\n Types: string;\n Contact: string;\n Address: string;\n constructor(\n jsondata: object,\n city: string,\n idstore: string,\n name: string,\n date: number,\n distance: number,\n duration: number,\n latitude: number,\n locationid: string,\n longitude: number,\n zipcode: string,\n radius: number,\n address: string,\n countrycode: string,\n tags: string,\n types: string,\n contact: string\n ) {\n this.Jsondata = jsondata;\n this.City = city;\n this.Idstore = idstore;\n this.Name = name;\n this.Date = date;\n this.Distance = distance;\n this.Duration = duration;\n this.Latitude = latitude;\n this.Locationid = locationid;\n this.Longitude = longitude;\n this.Zipcode = zipcode;\n this.Radius = radius;\n this.Idstore = idstore;\n this.Countrycode = countrycode;\n this.Tags = tags;\n this.Types = types;\n this.Contact = contact;\n this.Address = address;\n }\n /**\n * Converts json object to an object of type Poi.\n * @param {Object} json The json representation of the Poi.\n * @returns Object\n * @memberof Poi\n */\n static jsonToObj(json: any) {\n return new Poi(\n json.jsondata,\n json.city,\n json.idstore,\n json.name,\n json.date,\n json.distance,\n json.duration,\n json.latitude,\n json.locationid,\n json.longitude,\n json.zipcode,\n json.radius,\n json.address,\n json.countrycode,\n json.tags,\n json.types,\n json.contact\n );\n }\n}\nexport default Poi;\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,GAAN,CAAU;EAkBRC,WAAW,CACTC,QADS,EAETC,IAFS,EAGTC,OAHS,EAITC,IAJS,EAKTC,IALS,EAMTC,QANS,EAOTC,QAPS,EAQTC,QARS,EASTC,UATS,EAUTC,SAVS,EAWTC,OAXS,EAYTC,MAZS,EAaTC,OAbS,EAcTC,WAdS,EAeTC,IAfS,EAgBTC,KAhBS,EAiBTC,OAjBS,EAkBT;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IACA,KAAKC,QAAL,GAAgBjB,QAAhB;IACA,KAAKkB,IAAL,GAAYjB,IAAZ;IACA,KAAKkB,OAAL,GAAejB,OAAf;IACA,KAAKkB,IAAL,GAAYjB,IAAZ;IACA,KAAKkB,IAAL,GAAYjB,IAAZ;IACA,KAAKkB,QAAL,GAAgBjB,QAAhB;IACA,KAAKkB,QAAL,GAAgBjB,QAAhB;IACA,KAAKkB,QAAL,GAAgBjB,QAAhB;IACA,KAAKkB,UAAL,GAAkBjB,UAAlB;IACA,KAAKkB,SAAL,GAAiBjB,SAAjB;IACA,KAAKkB,OAAL,GAAejB,OAAf;IACA,KAAKkB,MAAL,GAAcjB,MAAd;IACA,KAAKQ,OAAL,GAAejB,OAAf;IACA,KAAK2B,WAAL,GAAmBhB,WAAnB;IACA,KAAKiB,IAAL,GAAYhB,IAAZ;IACA,KAAKiB,KAAL,GAAahB,KAAb;IACA,KAAKiB,OAAL,GAAehB,OAAf;IACA,KAAKiB,OAAL,GAAerB,OAAf;EACD;EACD;AACF;AACA;AACA;AACA;AACA;;;EACkB,OAATsB,SAAS,CAACC,IAAD,EAAY;IAC1B,OAAO,IAAIrC,GAAJ,CACLqC,IAAI,CAACnC,QADA,EAELmC,IAAI,CAAClC,IAFA,EAGLkC,IAAI,CAACjC,OAHA,EAILiC,IAAI,CAAChC,IAJA,EAKLgC,IAAI,CAAC/B,IALA,EAML+B,IAAI,CAAC9B,QANA,EAOL8B,IAAI,CAAC7B,QAPA,EAQL6B,IAAI,CAAC5B,QARA,EASL4B,IAAI,CAAC3B,UATA,EAUL2B,IAAI,CAAC1B,SAVA,EAWL0B,IAAI,CAACzB,OAXA,EAYLyB,IAAI,CAACxB,MAZA,EAaLwB,IAAI,CAACvB,OAbA,EAcLuB,IAAI,CAACtB,WAdA,EAeLsB,IAAI,CAACrB,IAfA,EAgBLqB,IAAI,CAACpB,KAhBA,EAiBLoB,IAAI,CAACnB,OAjBA,CAAP;EAmBD;;AAlFO;;AAoFV,eAAelB,GAAf"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Region","constructor","date","didenter","identifier","latitude","longitude","radius","frompositiondetection","Date","Didenter","Identifier","Latitude","Longitude","Radius","Frompositiondetection","jsonToObj","json"],"sources":["Region.tsx"],"sourcesContent":["/**\n * A class that represents the Region object.\n * @classdesc A class that represents the Region object.\n * @constructs Region\n * @param {number} date The datetime stamp.\n * @param {boolean} didEnter A boolean value indicating whether the region was entered.\n * @param {string} identifier An alphanumeric unique identifier for the region.\n * @param {number} latitude The latitude of the region.\n * @param {number} longitude The longitude of the region.\n * @param {number} radius The radius of the region in meters.\n * @param {boolean} frompositiondetection Determines whether the user's cuurent position is inside the region.\n */\nclass Region {\n Date: number;\n Didenter: boolean;\n Identifier: string;\n Latitude: number;\n Longitude: number;\n Radius: number;\n Frompositiondetection: boolean;\n constructor(\n date: number,\n didenter: boolean,\n identifier: string,\n latitude: number,\n longitude: number,\n radius: number,\n frompositiondetection: boolean\n ) {\n this.Date = date;\n this.Didenter = didenter;\n this.Identifier = identifier;\n this.Latitude = latitude;\n this.Longitude = longitude;\n this.Radius = radius;\n this.Frompositiondetection = frompositiondetection;\n }\n /**\n * Converts json object to an object of type Region.\n * @param {Object} json The json representation of the region.\n * @returns Object\n * @memberof Region\n */\n static jsonToObj(json: any) {\n return new Region(\n json.date,\n json.didenter,\n json.identifier,\n json.latitude,\n json.longitude,\n json.radius,\n json.frompositiondetection\n );\n }\n}\nexport default Region;\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,MAAN,CAAa;EAQXC,WAAW,CACTC,IADS,EAETC,QAFS,EAGTC,UAHS,EAITC,QAJS,EAKTC,SALS,EAMTC,MANS,EAOTC,qBAPS,EAQT;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IACA,KAAKC,IAAL,GAAYP,IAAZ;IACA,KAAKQ,QAAL,GAAgBP,QAAhB;IACA,KAAKQ,UAAL,GAAkBP,UAAlB;IACA,KAAKQ,QAAL,GAAgBP,QAAhB;IACA,KAAKQ,SAAL,GAAiBP,SAAjB;IACA,KAAKQ,MAAL,GAAcP,MAAd;IACA,KAAKQ,qBAAL,GAA6BP,qBAA7B;EACD;EACD;AACF;AACA;AACA;AACA;AACA;;;EACkB,OAATQ,SAAS,CAACC,IAAD,EAAY;IAC1B,OAAO,IAAIjB,MAAJ,CACLiB,IAAI,CAACf,IADA,EAELe,IAAI,CAACd,QAFA,EAGLc,IAAI,CAACb,UAHA,EAILa,IAAI,CAACZ,QAJA,EAKLY,IAAI,CAACX,SALA,EAMLW,IAAI,CAACV,MANA,EAOLU,IAAI,CAACT,qBAPA,CAAP;EASD;;AAzCU;;AA2Cb,eAAeR,MAAf"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Visit","constructor","accuracy","arrivaldate","date","departuredate","latitude","longitude","Accuracy","Arrivaldate","Date","Departuredate","Latitude","Longitude","jsonToObj","json","module","exports"],"sources":["Visit.tsx"],"sourcesContent":["/**\n * @classdesc A class that represents the visits object.\n * @constructs Visit\n * @param {number} accuracy The accuracy in meters.\n * @param {number} arrivalDate The datetime stamp for the arrival at the place of visit.\n * @param {number} date Current datetime stamp.\n * @param {number} latitude The latitude of the place of visit.\n * @param {number} longitude The longitude of the plaee of visit.\n */\nclass Visit {\n Accuracy: number;\n Arrivaldate: number;\n Date: number;\n Departuredate: number;\n Latitude: number;\n Longitude: number;\n constructor(\n accuracy: number,\n arrivaldate: number,\n date: number,\n departuredate: number,\n latitude: number,\n longitude: number\n ) {\n this.Accuracy = accuracy;\n this.Arrivaldate = arrivaldate;\n this.Date = date;\n this.Departuredate = departuredate;\n this.Latitude = latitude;\n this.Longitude = longitude;\n }\n /**\n * Converts json object to an object of type Visits.\n * @param {Object} json The json representation of the Visits.\n * @returns Visit\n * @memberof Visit\n */\n static jsonToObj(json: any): Visit {\n return new Visit(\n json.accuracy,\n json.arrivaldate,\n json.date,\n json.departuredate,\n json.latitude,\n json.longitude\n );\n }\n}\nmodule.exports = Visit;\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,KAAN,CAAY;EAOVC,WAAW,CACTC,QADS,EAETC,WAFS,EAGTC,IAHS,EAITC,aAJS,EAKTC,QALS,EAMTC,SANS,EAOT;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IACA,KAAKC,QAAL,GAAgBN,QAAhB;IACA,KAAKO,WAAL,GAAmBN,WAAnB;IACA,KAAKO,IAAL,GAAYN,IAAZ;IACA,KAAKO,aAAL,GAAqBN,aAArB;IACA,KAAKO,QAAL,GAAgBN,QAAhB;IACA,KAAKO,SAAL,GAAiBN,SAAjB;EACD;EACD;AACF;AACA;AACA;AACA;AACA;;;EACkB,OAATO,SAAS,CAACC,IAAD,EAAmB;IACjC,OAAO,IAAIf,KAAJ,CACLe,IAAI,CAACb,QADA,EAELa,IAAI,CAACZ,WAFA,EAGLY,IAAI,CAACX,IAHA,EAILW,IAAI,CAACV,aAJA,EAKLU,IAAI,CAACT,QALA,EAMLS,IAAI,CAACR,SANA,CAAP;EAQD;;AArCS;;AAuCZS,MAAM,CAACC,OAAP,GAAiBjB,KAAjB"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Zoi","constructor","accumulator","age","covariance_det","duration","endtime","idvisits","latmean","lngmean","period","prior_probability","starttime","weekly_density","wktpolygon","x00covariance_matrix_inverse","x01covariance_matrix_inverse","x10covariance_matrix_inverse","x11covariance_matrix_inverse","Accumulator","Age","Covariance_Det","Duration","Endtime","Idvisits","Latmean","Lngmean","Period","Prior_Probability","Starttime","Weekly_Density","Wktpolygon","X00Covariance_Matrix_Inverse","X01Covariance_Matrix_Inverse","X10Covariance_Matrix_Inverse","X11Covariance_Matrix_Inverse","jsonToObj","json","module","exports"],"sources":["Zoi.tsx"],"sourcesContent":["/**\n * @classdesc A class that represents the Zones of Interest (ZOI) object.\n * @constructs Zoi\n * @param {number} accumulator Represents the number of visits used to build the ZOI (only for calculation of ZOI)\n * @param {number} age Age is used to determine if a ZOI should be deleted by the algorithm (only for calculation of ZOI)\n * @param {number} covariance_det The covariance determinant (only for calculation of ZOI)\n * @param {number} duration The duration of all the accumulated visits of the ZOI\n * @param {number} endtime The exit date of the last ZOI visit\n * @param {string[]} idvisits The list of id visits included in this ZOI\n * @param {number} latmean The latitude of the center of the ZOI\n * @param {number} lngmean The longitude of the center of the ZOI\n * @param {string} period The classification of the period (HOME, WORK, OTHER or NO QUALIFIER)\n * @param {number} prior_probability Estimation of probability (only for calculation of ZOI)\n * @param {number} starttime The entry date for the first ZOI visit\n * @param {number} weekly_density The weekly density of the ZOI visit (only for classification of ZOI)\n * @param {string} wktpolygon This is the Well-known text representation of geometry of the ZOI polygon.\n * @param {number} x00covariance_matrix_inverse The covariance of a cluster (only for calculation of ZOI)\n * @param {number} x01covariance_matrix_inverse The covariance of a cluster (only for calculation of ZOI)\n * @param {number} x10covariance_matrix_inverse The covariance of a cluster (only for calculation of ZOI)\n * @param {number} x11covariance_matrix_inverse The covariance of a cluster (only for calculation of ZOI)\n\n */\nclass Zoi {\n Accumulator: number;\n Age: number;\n Covariance_Det: number;\n Duration: number;\n Endtime: number;\n Idvisits: string[];\n Latmean: number;\n Lngmean: number;\n Period: string;\n Prior_Probability: number;\n Starttime: number;\n Weekly_Density: number;\n X00Covariance_Matrix_Inverse: number;\n X01Covariance_Matrix_Inverse: number;\n X10Covariance_Matrix_Inverse: number;\n X11Covariance_Matrix_Inverse: number;\n Wktpolygon: string;\n constructor(\n accumulator: number,\n age: number,\n covariance_det: number,\n duration: number,\n endtime: number,\n idvisits: string[],\n latmean: number,\n lngmean: number,\n period: string,\n prior_probability: number,\n starttime: number,\n weekly_density: number,\n wktpolygon: string,\n x00covariance_matrix_inverse: number,\n x01covariance_matrix_inverse: number,\n x10covariance_matrix_inverse: number,\n x11covariance_matrix_inverse: number\n ) {\n this.Accumulator = accumulator;\n this.Age = age;\n this.Covariance_Det = covariance_det;\n this.Duration = duration;\n this.Endtime = endtime;\n this.Idvisits = idvisits;\n this.Latmean = latmean;\n this.Lngmean = lngmean;\n this.Period = period;\n this.Prior_Probability = prior_probability;\n this.Starttime = starttime;\n this.Weekly_Density = weekly_density;\n this.Covariance_Det = covariance_det;\n this.Wktpolygon = wktpolygon;\n this.X00Covariance_Matrix_Inverse = x00covariance_matrix_inverse;\n this.X01Covariance_Matrix_Inverse = x01covariance_matrix_inverse;\n this.X10Covariance_Matrix_Inverse = x10covariance_matrix_inverse;\n this.X11Covariance_Matrix_Inverse = x11covariance_matrix_inverse;\n }\n /**\n * Converts json object to an object of type Zoi.\n * @param {Object} json The json representation of the Zoi.\n * @returns Object\n * @memberof Zoi\n */\n static jsonToObj(json: any) {\n return new Zoi(\n json.accumulator,\n json.age,\n json.covariance_det,\n json.duration,\n json.endtime,\n json.idvisits,\n json.latmean,\n json.lngmean,\n json.period,\n json.prior_probability,\n json.starttime,\n json.weekly_density,\n json.wktpolygon,\n json.x00covariance_matrix_inverse,\n json.x01covariance_matrix_inverse,\n json.x10covariance_matrix_inverse,\n json.x11covariance_matrix_inverse\n );\n }\n}\nmodule.exports = Zoi;\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,GAAN,CAAU;EAkBRC,WAAW,CACTC,WADS,EAETC,GAFS,EAGTC,cAHS,EAITC,QAJS,EAKTC,OALS,EAMTC,QANS,EAOTC,OAPS,EAQTC,OARS,EASTC,MATS,EAUTC,iBAVS,EAWTC,SAXS,EAYTC,cAZS,EAaTC,UAbS,EAcTC,4BAdS,EAeTC,4BAfS,EAgBTC,4BAhBS,EAiBTC,4BAjBS,EAkBT;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IACA,KAAKC,WAAL,GAAmBjB,WAAnB;IACA,KAAKkB,GAAL,GAAWjB,GAAX;IACA,KAAKkB,cAAL,GAAsBjB,cAAtB;IACA,KAAKkB,QAAL,GAAgBjB,QAAhB;IACA,KAAKkB,OAAL,GAAejB,OAAf;IACA,KAAKkB,QAAL,GAAgBjB,QAAhB;IACA,KAAKkB,OAAL,GAAejB,OAAf;IACA,KAAKkB,OAAL,GAAejB,OAAf;IACA,KAAKkB,MAAL,GAAcjB,MAAd;IACA,KAAKkB,iBAAL,GAAyBjB,iBAAzB;IACA,KAAKkB,SAAL,GAAiBjB,SAAjB;IACA,KAAKkB,cAAL,GAAsBjB,cAAtB;IACA,KAAKQ,cAAL,GAAsBjB,cAAtB;IACA,KAAK2B,UAAL,GAAkBjB,UAAlB;IACA,KAAKkB,4BAAL,GAAoCjB,4BAApC;IACA,KAAKkB,4BAAL,GAAoCjB,4BAApC;IACA,KAAKkB,4BAAL,GAAoCjB,4BAApC;IACA,KAAKkB,4BAAL,GAAoCjB,4BAApC;EACD;EACD;AACF;AACA;AACA;AACA;AACA;;;EACkB,OAATkB,SAAS,CAACC,IAAD,EAAY;IAC1B,OAAO,IAAIrC,GAAJ,CACLqC,IAAI,CAACnC,WADA,EAELmC,IAAI,CAAClC,GAFA,EAGLkC,IAAI,CAACjC,cAHA,EAILiC,IAAI,CAAChC,QAJA,EAKLgC,IAAI,CAAC/B,OALA,EAML+B,IAAI,CAAC9B,QANA,EAOL8B,IAAI,CAAC7B,OAPA,EAQL6B,IAAI,CAAC5B,OARA,EASL4B,IAAI,CAAC3B,MATA,EAUL2B,IAAI,CAAC1B,iBAVA,EAWL0B,IAAI,CAACzB,SAXA,EAYLyB,IAAI,CAACxB,cAZA,EAaLwB,IAAI,CAACvB,UAbA,EAcLuB,IAAI,CAACtB,4BAdA,EAeLsB,IAAI,CAACrB,4BAfA,EAgBLqB,IAAI,CAACpB,4BAhBA,EAiBLoB,IAAI,CAACnB,4BAjBA,CAAP;EAmBD;;AAlFO;;AAoFVoB,MAAM,CAACC,OAAP,GAAiBvC,GAAjB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { NativeModules } from 'react-native';
|
|
2
|
+
let PluginGeofencing = NativeModules.PluginGeofencing;
|
|
3
|
+
|
|
4
|
+
if (!PluginGeofencing) {
|
|
5
|
+
throw new Error('NativeModules.PluginGeofencing is undefined');
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export default PluginGeofencing;
|
|
9
|
+
//# sourceMappingURL=nativeInterface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["NativeModules","PluginGeofencing","Error"],"sources":["nativeInterface.tsx"],"sourcesContent":["import { NativeModules } from 'react-native';\nlet PluginGeofencing = NativeModules.PluginGeofencing;\n\nif (!PluginGeofencing) {\n throw new Error('NativeModules.PluginGeofencing is undefined');\n}\n\nexport default PluginGeofencing;\n"],"mappings":"AAAA,SAASA,aAAT,QAA8B,cAA9B;AACA,IAAIC,gBAAgB,GAAGD,aAAa,CAACC,gBAArC;;AAEA,IAAI,CAACA,gBAAL,EAAuB;EACrB,MAAM,IAAIC,KAAJ,CAAU,6CAAV,CAAN;AACD;;AAED,eAAeD,gBAAf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["types.tsx"],"sourcesContent":["/**\n * Geofence region types\n */\nexport type RegionType = 'circle' | 'isochrone';\n\n/**\n * Location of custom profile to fetch\n */\nexport type ProfileSource = 'local' | 'external';\n\n/**\n * GeofenceRegion structure\n */\nexport interface GeofenceRegion {\n regionId: string;\n lat: number;\n lng: number;\n radius: number;\n type: RegionType;\n}\n"],"mappings":""}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import Location from './Location';
|
|
2
|
-
import Region from './Region';
|
|
3
|
-
|
|
1
|
+
import Location from './internal/Location';
|
|
2
|
+
import Region from './internal/Region';
|
|
3
|
+
import Poi from './internal/Poi';
|
|
4
|
+
import type { GeofenceRegion, RegionType, ProfileSource } from './internal/types';
|
|
4
5
|
/**
|
|
5
6
|
* Initializes the Woosmap object
|
|
6
7
|
* @param arg0 A JSON object with Woosmap Key (optional) and tracking profile (`liveTracking`,`passiveTracking`,`visitsTracking`).
|
|
@@ -79,8 +80,58 @@ declare function setSFMCCredentials(arg0: Object): Promise<string>;
|
|
|
79
80
|
* @returns promise with A callback that will be called on success or error.
|
|
80
81
|
*/
|
|
81
82
|
declare function setPoiRadius(radius: string): Promise<string>;
|
|
83
|
+
/**
|
|
84
|
+
* Adds a custom region that you want to monitor.
|
|
85
|
+
* @param region A GeofenceRegion object with latitude, longitude, radius and type.
|
|
86
|
+
* @returns promise with A callback that will be called on success or error.
|
|
87
|
+
*/
|
|
88
|
+
declare function addRegion(region: GeofenceRegion): Promise<string>;
|
|
89
|
+
/**
|
|
90
|
+
* Retrieve saved region info
|
|
91
|
+
* @param regionID If it pass return info for given region or return all region info
|
|
92
|
+
* @returns promise with A callback that will be called on success or error.
|
|
93
|
+
*/
|
|
94
|
+
declare function getRegions(regionID?: string): Promise<Region[]>;
|
|
95
|
+
/**
|
|
96
|
+
* Retrieve saved location info
|
|
97
|
+
* @param locationID - Optional in case of location id pass it return only that location info
|
|
98
|
+
* @returns promise with A callback that will be called on success or error.
|
|
99
|
+
*/
|
|
100
|
+
declare function getLocations(locationID?: string): Promise<Location[]>;
|
|
101
|
+
/**
|
|
102
|
+
* Retrieve saved POI info
|
|
103
|
+
* @param poiID - Optional in case of poi id (LocationID or StoreID) pass it return only that POI info
|
|
104
|
+
* @returns promise with A callback that will be called on success or error.
|
|
105
|
+
*/
|
|
106
|
+
declare function getPois(poiID?: string): Promise<Poi[]>;
|
|
107
|
+
/**
|
|
108
|
+
* Remove saved region info
|
|
109
|
+
* @param regionID If it pass remove info for given region or removes all region info
|
|
110
|
+
* @returns promise with A callback that will be called on success or error.
|
|
111
|
+
*/
|
|
112
|
+
declare function removeRegions(regionID?: string): Promise<string>;
|
|
113
|
+
/**
|
|
114
|
+
* Remove saved location info
|
|
115
|
+
* @returns promise with A callback that will be called on success or error.
|
|
116
|
+
*/
|
|
117
|
+
declare function removeLocations(): Promise<string>;
|
|
118
|
+
/**
|
|
119
|
+
* Remove saved POI info
|
|
120
|
+
* @returns promise with A callback that will be called on success or error.
|
|
121
|
+
*/
|
|
122
|
+
declare function removePois(): Promise<string>;
|
|
123
|
+
/**
|
|
124
|
+
* if preset tracking profiles don’t fit with your use cases, you can build your own profile and uses the startCustomTracking() method.
|
|
125
|
+
* There are two way to host the json file:
|
|
126
|
+
* - included in the client application (local)
|
|
127
|
+
* - hosted externally in a file folder in your information system (external)
|
|
128
|
+
* @param sourceType local/external
|
|
129
|
+
* @param source location of profile to be fetch
|
|
130
|
+
* @returns promise with A callback that will be called on success or error.
|
|
131
|
+
*/
|
|
132
|
+
declare function startCustomTracking(sourceType: ProfileSource, source: string): Promise<string>;
|
|
133
|
+
export type { RegionType, GeofenceRegion, Region, Location, Poi, ProfileSource, };
|
|
82
134
|
declare const WoosmapGeofencing: {
|
|
83
|
-
multiply: typeof multiply;
|
|
84
135
|
initialize: typeof initialize;
|
|
85
136
|
setWoosmapApiKey: typeof setWoosmapApiKey;
|
|
86
137
|
startTracking: typeof startTracking;
|
|
@@ -93,5 +144,13 @@ declare const WoosmapGeofencing: {
|
|
|
93
144
|
clearRegionsWatch: typeof clearRegionsWatch;
|
|
94
145
|
setSFMCCredentials: typeof setSFMCCredentials;
|
|
95
146
|
setPoiRadius: typeof setPoiRadius;
|
|
147
|
+
addRegion: typeof addRegion;
|
|
148
|
+
getRegions: typeof getRegions;
|
|
149
|
+
removeRegions: typeof removeRegions;
|
|
150
|
+
getLocations: typeof getLocations;
|
|
151
|
+
removeLocations: typeof removeLocations;
|
|
152
|
+
getPois: typeof getPois;
|
|
153
|
+
removePois: typeof removePois;
|
|
154
|
+
startCustomTracking: typeof startCustomTracking;
|
|
96
155
|
};
|
|
97
156
|
export default WoosmapGeofencing;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* @param {number} distance The distance between the POI and the user's location.
|
|
11
11
|
* @param {number} duration The duration to travel to the POI from the user's location.
|
|
12
12
|
* @param {number} latitude The latitude of the POI.
|
|
13
|
+
* @param {string} locationid Location id of the POI.
|
|
13
14
|
* @param {number} longitude The longitude of the POI.
|
|
14
15
|
* @param {string} zipcode The zip code of the POI.
|
|
15
16
|
* @param {number} radius The radius of the POI.
|
|
@@ -28,7 +29,7 @@ declare class Poi {
|
|
|
28
29
|
Distance: number;
|
|
29
30
|
Duration: number;
|
|
30
31
|
Latitude: number;
|
|
31
|
-
Locationid:
|
|
32
|
+
Locationid: string;
|
|
32
33
|
Longitude: number;
|
|
33
34
|
Zipcode: string;
|
|
34
35
|
Radius: number;
|
|
@@ -37,7 +38,7 @@ declare class Poi {
|
|
|
37
38
|
Types: string;
|
|
38
39
|
Contact: string;
|
|
39
40
|
Address: string;
|
|
40
|
-
constructor(jsondata: object, city: string, idstore: string, name: string, date: number, distance: number, duration: number, latitude: number, locationid:
|
|
41
|
+
constructor(jsondata: object, city: string, idstore: string, name: string, date: number, distance: number, duration: number, latitude: number, locationid: string, longitude: number, zipcode: string, radius: number, address: string, countrycode: string, tags: string, types: string, contact: string);
|
|
41
42
|
/**
|
|
42
43
|
* Converts json object to an object of type Poi.
|
|
43
44
|
* @param {Object} json The json representation of the Poi.
|
|
@@ -46,3 +47,4 @@ declare class Poi {
|
|
|
46
47
|
*/
|
|
47
48
|
static jsonToObj(json: any): Poi;
|
|
48
49
|
}
|
|
50
|
+
export default Poi;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Geofence region types
|
|
3
|
+
*/
|
|
4
|
+
export declare type RegionType = 'circle' | 'isochrone';
|
|
5
|
+
/**
|
|
6
|
+
* Location of custom profile to fetch
|
|
7
|
+
*/
|
|
8
|
+
export declare type ProfileSource = 'local' | 'external';
|
|
9
|
+
/**
|
|
10
|
+
* GeofenceRegion structure
|
|
11
|
+
*/
|
|
12
|
+
export interface GeofenceRegion {
|
|
13
|
+
regionId: string;
|
|
14
|
+
lat: number;
|
|
15
|
+
lng: number;
|
|
16
|
+
radius: number;
|
|
17
|
+
type: RegionType;
|
|
18
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@woosmap/react-native-plugin-geofencing",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "This react-native plugin extends the functionality offered by the Woosmap Geofencing Mobile SDKs. Find more about the Woosmap Geofencing SDK",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|