@woosmap/react-native-plugin-geofencing 0.1.4 → 0.1.7
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 -20
- package/android/build.gradle +7 -0
- package/android/src/main/java/com/reactnativeplugingeofencing/PluginGeofencingModule.java +328 -35
- package/android/src/main/java/com/reactnativeplugingeofencing/WoosmapMessageAndKey.java +20 -3
- package/android/src/main/java/com/reactnativeplugingeofencing/WoosmapTask.java +299 -0
- package/android/src/main/java/com/reactnativeplugingeofencing/WoosmapUtil.java +108 -0
- package/ios/DataDistance.swift +14 -23
- package/ios/DataLocation.swift +16 -0
- package/ios/DataPOI.swift +11 -0
- package/ios/DataRegion.swift +32 -29
- package/ios/MarketingCloudEvents.swift +6 -6
- package/ios/PluginGeofencing.m +43 -0
- package/ios/PluginGeofencing.swift +380 -26
- 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/{Airship.js.map → internal/Airship.js.map} +0 -0
- package/lib/commonjs/{Location.js → internal/Location.js} +0 -0
- package/lib/commonjs/{Location.js.map → internal/Location.js.map} +0 -0
- package/lib/commonjs/{MarketingCloud.js → internal/MarketingCloud.js} +0 -0
- package/lib/commonjs/{MarketingCloud.js.map → internal/MarketingCloud.js.map} +0 -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/{Region.js.map → internal/Region.js.map} +0 -0
- package/lib/commonjs/{Visit.js → internal/Visit.js} +0 -0
- package/lib/commonjs/{Visit.js.map → internal/Visit.js.map} +0 -0
- package/lib/commonjs/{Zoi.js → internal/Zoi.js} +0 -0
- package/lib/commonjs/{Zoi.js.map → internal/Zoi.js.map} +0 -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/{Airship.js.map → internal/Airship.js.map} +0 -0
- package/lib/module/{Location.js → internal/Location.js} +0 -0
- package/lib/module/{Location.js.map → internal/Location.js.map} +0 -0
- package/lib/module/{MarketingCloud.js → internal/MarketingCloud.js} +0 -0
- package/lib/module/{MarketingCloud.js.map → internal/MarketingCloud.js.map} +0 -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/{Region.js.map → internal/Region.js.map} +0 -0
- package/lib/module/{Visit.js → internal/Visit.js} +0 -0
- package/lib/module/{Visit.js.map → internal/Visit.js.map} +0 -0
- package/lib/module/{Zoi.js → internal/Zoi.js} +0 -0
- package/lib/module/{Zoi.js.map → internal/Zoi.js.map} +0 -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/lib/commonjs/Poi.js.map +0 -1
- package/lib/module/Poi.js.map +0 -1
package/lib/commonjs/index.js
CHANGED
|
@@ -9,48 +9,19 @@ var _reactNative = require("react-native");
|
|
|
9
9
|
|
|
10
10
|
var _reactNativeUuid = _interopRequireDefault(require("react-native-uuid"));
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _nativeInterface = _interopRequireDefault(require("./internal/nativeInterface"));
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _Location = _interopRequireDefault(require("./internal/Location"));
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
var _Region = _interopRequireDefault(require("./internal/Region"));
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
// `The package 'react-native-plugin-geofencing' doesn't seem to be linked. Make sure: \n\n` +
|
|
20
|
-
// Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
|
|
21
|
-
// '- You rebuilt the app after installing the package\n' +
|
|
22
|
-
// '- You are not using Expo managed workflow\n';
|
|
23
|
-
// const PluginGeofencing = NativeModules.PluginGeofencing
|
|
24
|
-
// ? NativeModules.PluginGeofencing
|
|
25
|
-
// : new Proxy(
|
|
26
|
-
// {},
|
|
27
|
-
// {
|
|
28
|
-
// get() {
|
|
29
|
-
// throw new Error(LINKING_ERROR);
|
|
30
|
-
// },
|
|
31
|
-
// }
|
|
32
|
-
// );
|
|
33
|
-
if (!_reactNative.NativeModules.PluginGeofencing) {
|
|
34
|
-
throw new Error('NativeModules.PluginGeofencing is undefined');
|
|
35
|
-
}
|
|
18
|
+
var _Poi = _interopRequireDefault(require("./internal/Poi"));
|
|
36
19
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
// {
|
|
41
|
-
// get() {
|
|
42
|
-
// throw new Error(LINKING_ERROR);
|
|
43
|
-
// },
|
|
44
|
-
// }
|
|
45
|
-
// );
|
|
46
|
-
|
|
47
|
-
const eventEmitter = new _reactNative.NativeEventEmitter(PluginGeofencing);
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
|
|
22
|
+
const eventEmitter = new _reactNative.NativeEventEmitter(_nativeInterface.default);
|
|
48
23
|
let subscriptionsLocation = {};
|
|
49
24
|
let subscriptionsRegion = {};
|
|
50
|
-
|
|
51
|
-
function multiply(a, b) {
|
|
52
|
-
return PluginGeofencing.multiply(a, b);
|
|
53
|
-
}
|
|
54
25
|
/**
|
|
55
26
|
* Initializes the Woosmap object
|
|
56
27
|
* @param arg0 A JSON object with Woosmap Key (optional) and tracking profile (`liveTracking`,`passiveTracking`,`visitsTracking`).
|
|
@@ -58,13 +29,12 @@ function multiply(a, b) {
|
|
|
58
29
|
error - A callback function that will be called on error.
|
|
59
30
|
*/
|
|
60
31
|
|
|
61
|
-
|
|
62
32
|
function initialize(arg0) {
|
|
63
33
|
if (arg0 == null) {
|
|
64
34
|
arg0 = {};
|
|
65
35
|
}
|
|
66
36
|
|
|
67
|
-
return
|
|
37
|
+
return _nativeInterface.default.initialize(arg0);
|
|
68
38
|
}
|
|
69
39
|
/**
|
|
70
40
|
* A method that sets Woosmap private API key
|
|
@@ -75,7 +45,7 @@ function initialize(arg0) {
|
|
|
75
45
|
|
|
76
46
|
|
|
77
47
|
function setWoosmapApiKey(apiKey) {
|
|
78
|
-
return
|
|
48
|
+
return _nativeInterface.default.setWoosmapApiKey([apiKey]);
|
|
79
49
|
}
|
|
80
50
|
/**
|
|
81
51
|
* A method to start tracking the user's location.
|
|
@@ -86,7 +56,7 @@ function setWoosmapApiKey(apiKey) {
|
|
|
86
56
|
|
|
87
57
|
|
|
88
58
|
function startTracking(trackingProfile) {
|
|
89
|
-
return
|
|
59
|
+
return _nativeInterface.default.startTracking([trackingProfile]);
|
|
90
60
|
}
|
|
91
61
|
/**
|
|
92
62
|
* Stops tracking the user's location.
|
|
@@ -96,7 +66,7 @@ function startTracking(trackingProfile) {
|
|
|
96
66
|
|
|
97
67
|
|
|
98
68
|
function stopTracking() {
|
|
99
|
-
return
|
|
69
|
+
return _nativeInterface.default.stopTracking();
|
|
100
70
|
}
|
|
101
71
|
/**
|
|
102
72
|
* A method to request the required permissions to collect locations.
|
|
@@ -110,7 +80,7 @@ function requestPermissions(background) {
|
|
|
110
80
|
background = false;
|
|
111
81
|
}
|
|
112
82
|
|
|
113
|
-
return
|
|
83
|
+
return _nativeInterface.default.requestPermissions([background]);
|
|
114
84
|
}
|
|
115
85
|
/**
|
|
116
86
|
* A method to check if the app has granted required permissions to track location.
|
|
@@ -119,7 +89,7 @@ function requestPermissions(background) {
|
|
|
119
89
|
|
|
120
90
|
|
|
121
91
|
function getPermissionsStatus() {
|
|
122
|
-
return
|
|
92
|
+
return _nativeInterface.default.getPermissionsStatus();
|
|
123
93
|
}
|
|
124
94
|
/**
|
|
125
95
|
* Method will
|
|
@@ -138,7 +108,7 @@ function watchLocation(success, error) {
|
|
|
138
108
|
};
|
|
139
109
|
|
|
140
110
|
subscriptionsLocation[watchID] = [eventEmitter.addListener('geolocationDidChange', successCallback), error ? eventEmitter.addListener('geolocationError', error) : null];
|
|
141
|
-
return
|
|
111
|
+
return _nativeInterface.default.watchLocation(watchID);
|
|
142
112
|
}
|
|
143
113
|
/**
|
|
144
114
|
* A method to stop tracking location for a specified watch. If watchId is null or undefined the plugin will clear all watches.
|
|
@@ -152,7 +122,7 @@ function clearLocationWatch(watchID) {
|
|
|
152
122
|
eventEmitter.removeAllListeners('geolocationDidChange');
|
|
153
123
|
eventEmitter.removeAllListeners('geolocationError');
|
|
154
124
|
subscriptionsLocation = {};
|
|
155
|
-
return
|
|
125
|
+
return _nativeInterface.default.clearAllLocationWatch();
|
|
156
126
|
} else {
|
|
157
127
|
const saved = subscriptionsLocation[watchID];
|
|
158
128
|
|
|
@@ -168,7 +138,7 @@ function clearLocationWatch(watchID) {
|
|
|
168
138
|
subscriptionsLocation[watchID] = undefined;
|
|
169
139
|
}
|
|
170
140
|
|
|
171
|
-
return
|
|
141
|
+
return _nativeInterface.default.clearLocationWatch(watchID);
|
|
172
142
|
}
|
|
173
143
|
}
|
|
174
144
|
/**
|
|
@@ -188,7 +158,7 @@ function watchRegions(success, error) {
|
|
|
188
158
|
};
|
|
189
159
|
|
|
190
160
|
subscriptionsRegion[watchID] = [eventEmitter.addListener('woosmapgeofenceRegionDidChange', successCallback), error ? eventEmitter.addListener('woosmapgeofenceRegionError', error) : null];
|
|
191
|
-
return
|
|
161
|
+
return _nativeInterface.default.watchRegions(watchID);
|
|
192
162
|
}
|
|
193
163
|
/**
|
|
194
164
|
* 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.
|
|
@@ -202,7 +172,7 @@ function clearRegionsWatch(watchID) {
|
|
|
202
172
|
eventEmitter.removeAllListeners('woosmapgeofenceRegionDidChange');
|
|
203
173
|
eventEmitter.removeAllListeners('woosmapgeofenceRegionError');
|
|
204
174
|
subscriptionsRegion = {};
|
|
205
|
-
return
|
|
175
|
+
return _nativeInterface.default.clearAllRegionsWatch();
|
|
206
176
|
} else {
|
|
207
177
|
const saved = subscriptionsRegion[watchID];
|
|
208
178
|
|
|
@@ -218,7 +188,7 @@ function clearRegionsWatch(watchID) {
|
|
|
218
188
|
subscriptionsRegion[watchID] = undefined;
|
|
219
189
|
}
|
|
220
190
|
|
|
221
|
-
return
|
|
191
|
+
return _nativeInterface.default.clearRegionsWatch(watchID);
|
|
222
192
|
}
|
|
223
193
|
}
|
|
224
194
|
/**
|
|
@@ -229,7 +199,7 @@ function clearRegionsWatch(watchID) {
|
|
|
229
199
|
|
|
230
200
|
|
|
231
201
|
function setSFMCCredentials(arg0) {
|
|
232
|
-
return
|
|
202
|
+
return _nativeInterface.default.setSFMCCredentials(arg0);
|
|
233
203
|
}
|
|
234
204
|
/**
|
|
235
205
|
* 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").
|
|
@@ -239,11 +209,150 @@ function setSFMCCredentials(arg0) {
|
|
|
239
209
|
|
|
240
210
|
|
|
241
211
|
function setPoiRadius(radius) {
|
|
242
|
-
return
|
|
212
|
+
return _nativeInterface.default.setPoiRadius(radius);
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Adds a custom region that you want to monitor.
|
|
216
|
+
* @param region A GeofenceRegion object with latitude, longitude, radius and type.
|
|
217
|
+
* @returns promise with A callback that will be called on success or error.
|
|
218
|
+
*/
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
function addRegion(region) {
|
|
222
|
+
return _nativeInterface.default.addRegion(region);
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Retrieve saved region info
|
|
226
|
+
* @param regionID If it pass return info for given region or return all region info
|
|
227
|
+
* @returns promise with A callback that will be called on success or error.
|
|
228
|
+
*/
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
function getRegions(regionID) {
|
|
232
|
+
if (regionID == null) {
|
|
233
|
+
return _nativeInterface.default.getAllRegions().then(result => {
|
|
234
|
+
var formatted = [];
|
|
235
|
+
result.forEach(item => {
|
|
236
|
+
formatted.push(_Region.default.jsonToObj(item));
|
|
237
|
+
});
|
|
238
|
+
return Promise.resolve(formatted);
|
|
239
|
+
}).catch(e => {
|
|
240
|
+
return Promise.reject(e);
|
|
241
|
+
});
|
|
242
|
+
} else {
|
|
243
|
+
return _nativeInterface.default.getRegions(regionID).then(result => {
|
|
244
|
+
var formatted = [];
|
|
245
|
+
formatted.push(_Region.default.jsonToObj(result));
|
|
246
|
+
return Promise.resolve(formatted);
|
|
247
|
+
}).catch(e => {
|
|
248
|
+
return Promise.reject(e);
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Retrieve saved location info
|
|
254
|
+
* @param locationID - Optional in case of location id pass it return only that location info
|
|
255
|
+
* @returns promise with A callback that will be called on success or error.
|
|
256
|
+
*/
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
function getLocations(locationID) {
|
|
260
|
+
if (locationID == null) {
|
|
261
|
+
return _nativeInterface.default.getAllLocations().then(result => {
|
|
262
|
+
var formatted = [];
|
|
263
|
+
result.forEach(item => {
|
|
264
|
+
formatted.push(_Location.default.jsonToObj(item));
|
|
265
|
+
});
|
|
266
|
+
return Promise.resolve(formatted);
|
|
267
|
+
}).catch(e => {
|
|
268
|
+
return Promise.reject(e);
|
|
269
|
+
});
|
|
270
|
+
} else {
|
|
271
|
+
return _nativeInterface.default.getLocation(locationID).then(result => {
|
|
272
|
+
var formatted = [];
|
|
273
|
+
formatted.push(_Location.default.jsonToObj(result));
|
|
274
|
+
return Promise.resolve(formatted);
|
|
275
|
+
}).catch(e => {
|
|
276
|
+
return Promise.reject(e);
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Retrieve saved POI info
|
|
282
|
+
* @param poiID - Optional in case of poi id (LocationID or StoreID) pass it return only that POI info
|
|
283
|
+
* @returns promise with A callback that will be called on success or error.
|
|
284
|
+
*/
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
function getPois(poiID) {
|
|
288
|
+
if (poiID == null) {
|
|
289
|
+
return _nativeInterface.default.getAllPois().then(result => {
|
|
290
|
+
var formatted = [];
|
|
291
|
+
result.forEach(item => {
|
|
292
|
+
formatted.push(_Poi.default.jsonToObj(item));
|
|
293
|
+
});
|
|
294
|
+
return Promise.resolve(formatted);
|
|
295
|
+
}).catch(e => {
|
|
296
|
+
return Promise.reject(e);
|
|
297
|
+
});
|
|
298
|
+
} else {
|
|
299
|
+
return _nativeInterface.default.getPoi(poiID).then(result => {
|
|
300
|
+
var formatted = [];
|
|
301
|
+
formatted.push(_Poi.default.jsonToObj(result));
|
|
302
|
+
return Promise.resolve(formatted);
|
|
303
|
+
}).catch(e => {
|
|
304
|
+
return Promise.reject(e);
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Remove saved region info
|
|
310
|
+
* @param regionID If it pass remove info for given region or removes all region info
|
|
311
|
+
* @returns promise with A callback that will be called on success or error.
|
|
312
|
+
*/
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
function removeRegions(regionID) {
|
|
316
|
+
if (regionID == null) {
|
|
317
|
+
return _nativeInterface.default.removeAllRegions();
|
|
318
|
+
} else {
|
|
319
|
+
return _nativeInterface.default.removeRegion(regionID);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Remove saved location info
|
|
324
|
+
* @returns promise with A callback that will be called on success or error.
|
|
325
|
+
*/
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
function removeLocations() {
|
|
329
|
+
return _nativeInterface.default.removeAllLocations();
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Remove saved POI info
|
|
333
|
+
* @returns promise with A callback that will be called on success or error.
|
|
334
|
+
*/
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
function removePois() {
|
|
338
|
+
return _nativeInterface.default.removeAllPois();
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* if preset tracking profiles don’t fit with your use cases, you can build your own profile and uses the startCustomTracking() method.
|
|
342
|
+
* There are two way to host the json file:
|
|
343
|
+
* - included in the client application (local)
|
|
344
|
+
* - hosted externally in a file folder in your information system (external)
|
|
345
|
+
* @param sourceType local/external
|
|
346
|
+
* @param source location of profile to be fetch
|
|
347
|
+
* @returns promise with A callback that will be called on success or error.
|
|
348
|
+
*/
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
function startCustomTracking(sourceType, source) {
|
|
352
|
+
return _nativeInterface.default.startCustomTracking(sourceType, source);
|
|
243
353
|
}
|
|
244
354
|
|
|
245
355
|
const WoosmapGeofencing = {
|
|
246
|
-
multiply,
|
|
247
356
|
initialize,
|
|
248
357
|
setWoosmapApiKey,
|
|
249
358
|
startTracking,
|
|
@@ -255,22 +364,16 @@ const WoosmapGeofencing = {
|
|
|
255
364
|
watchRegions,
|
|
256
365
|
clearRegionsWatch,
|
|
257
366
|
setSFMCCredentials,
|
|
258
|
-
setPoiRadius
|
|
367
|
+
setPoiRadius,
|
|
368
|
+
addRegion,
|
|
369
|
+
getRegions,
|
|
370
|
+
removeRegions,
|
|
371
|
+
getLocations,
|
|
372
|
+
removeLocations,
|
|
373
|
+
getPois,
|
|
374
|
+
removePois,
|
|
375
|
+
startCustomTracking
|
|
259
376
|
};
|
|
260
|
-
|
|
261
|
-
* JavaScript code and the tests
|
|
262
|
-
*/
|
|
263
|
-
//let nativeEventEmitter: NativeEventEmitter | null = null;
|
|
264
|
-
|
|
265
|
-
var _default = WoosmapGeofencing; // module.exports = {
|
|
266
|
-
// WoosmapGeofencing,
|
|
267
|
-
// get GeolocationEventEmitter() {
|
|
268
|
-
// if (!nativeEventEmitter) {
|
|
269
|
-
// nativeEventEmitter = new NativeEventEmitter(PluginGeofencing);
|
|
270
|
-
// }
|
|
271
|
-
// return nativeEventEmitter;
|
|
272
|
-
// },
|
|
273
|
-
// };
|
|
274
|
-
|
|
377
|
+
var _default = WoosmapGeofencing;
|
|
275
378
|
exports.default = _default;
|
|
276
379
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.tsx"],"names":["NativeModules","PluginGeofencing","Error","eventEmitter","NativeEventEmitter","subscriptionsLocation","subscriptionsRegion","multiply","a","b","initialize","arg0","setWoosmapApiKey","apiKey","startTracking","trackingProfile","stopTracking","requestPermissions","background","getPermissionsStatus","watchLocation","success","error","watchID","uuid","v1","toString","successCallback","result","Location","jsonToObj","addListener","clearLocationWatch","removeAllListeners","clearAllLocationWatch","saved","removeListener","arg1","undefined","watchRegions","Region","clearRegionsWatch","clearAllRegionsWatch","setSFMCCredentials","setPoiRadius","radius","WoosmapGeofencing"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;;;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,IAAI,CAACA,2BAAcC,gBAAnB,EAAqC;AACnC,QAAM,IAAIC,KAAJ,CAAU,6CAAV,CAAN;AACD;;AACD,MAAMD,gBAAgB,GAAGD,2BAAcC,gBAAvC,C,CACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAME,YAAY,GAAG,IAAIC,+BAAJ,CAAuBH,gBAAvB,CAArB;AAEA,IAAII,qBAA0B,GAAG,EAAjC;AACA,IAAIC,mBAAwB,GAAG,EAA/B;;AAEA,SAASC,QAAT,CAAkBC,CAAlB,EAA6BC,CAA7B,EAAyD;AACvD,SAAOR,gBAAgB,CAACM,QAAjB,CAA0BC,CAA1B,EAA6BC,CAA7B,CAAP;AACD;AACD;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASC,UAAT,CAAoBC,IAApB,EAAiD;AAC/C,MAAIA,IAAI,IAAI,IAAZ,EAAkB;AAChBA,IAAAA,IAAI,GAAG,EAAP;AACD;;AACD,SAAOV,gBAAgB,CAACS,UAAjB,CAA4BC,IAA5B,CAAP;AACD;AAED;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASC,gBAAT,CAA0BC,MAA1B,EAA2D;AACzD,SAAOZ,gBAAgB,CAACW,gBAAjB,CAAkC,CAACC,MAAD,CAAlC,CAAP;AACD;AAED;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASC,aAAT,CAAuBC,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A,YAVwB;AAWxBE,EAAAA,iBAXwB;AAYxBE,EAAAA,kBAZwB;AAaxBC,EAAAA;AAbwB,CAA1B;AAgBA;AACA;AACA;AACA;;eAEeE,iB,EACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sourcesContent":["import { NativeModules, NativeEventEmitter } 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,"sources":["index.tsx"],"names":["eventEmitter","NativeEventEmitter","PluginGeofencing","subscriptionsLocation","subscriptionsRegion","initialize","arg0","setWoosmapApiKey","apiKey","startTracking","trackingProfile","stopTracking","requestPermissions","background","getPermissionsStatus","watchLocation","success","error","watchID","uuid","v1","toString","successCallback","result","Location","jsonToObj","addListener","clearLocationWatch","removeAllListeners","clearAllLocationWatch","saved","removeListener","arg1","undefined","watchRegions","Region","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","Poi","getPoi","removeRegions","removeAllRegions","removeRegion","removeLocations","removeAllLocations","removePois","removeAllPois","startCustomTracking","sourceType","source","WoosmapGeofencing"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAOA,MAAMA,YAAY,GAAG,IAAIC,+BAAJ,CAAuBC,wBAAvB,CAArB;AAEA,IAAIC,qBAA0B,GAAG,EAAjC;AACA,IAAIC,mBAAwB,GAAG,EAA/B;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,UAAT,CAAoBC,IAApB,EAAiD;AAC/C,MAAIA,IAAI,IAAI,IAAZ,EAAkB;AAChBA,IAAAA,IAAI,GAAG,EAAP;AACD;;AACD,SAAOJ,yBAAiBG,UAAjB,CAA4BC,IAA5B,CAAP;AACD;AAED;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASC,gBAAT,CAA0BC,MAA1B,EAA2D;AACzD,SAAON,yBAAiBK,gBAAjB,CAAkC,CAACC,MAAD,CAAlC,CAAP;AACD;AAED;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASC,aAAT,CAAuBC,eAAvB,EAAiE;AAC/D,SAAOR,yBAAiBO,aAAjB,CAA+B,CAACC,eAAD,CAA/B,CAAP;AACD;AAED;AACA;AACA;AACA;AACA;;;AACA,SAASC,YAAT,GAAyC;AACvC,SAAOT,yBAAiBS,YAAjB,EAAP;AACD;AAED;AACA;AACA;AACA;AACA;;;AACA,SAASC,kBAAT,CAA4BC,UAA5B,EAAmE;AACjE,MAAIA,UAAU,IAAI,IAAlB,EAAwB;AACtBA,IAAAA,UAAU,GAAG,KAAb;AACD;;AACD,SAAOX,yBAAiBU,kBAAjB,CAAoC,CAACC,UAAD,CAApC,CAAP;AACD;AAED;AACA;AACA;AACA;;;AACA,SAASC,oBAAT,GAAiD;AAC/C,SAAOZ,yBAAiBY,oBAAjB,EAAP;AACD;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASC,aAAT,CACEC,OADF,EAEEC,KAFF,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AAjD,CAAP;AACD;;AAWD,MAAMC,iBAAiB,GAAG;AACxBtE,EAAAA,UADwB;AAExBE,EAAAA,gBAFwB;AAGxBE,EAAAA,aAHwB;AAIxBG,EAAAA,kBAJwB;AAKxBE,EAAAA,oBALwB;AAMxBH,EAAAA,YANwB;AAOxBI,EAAAA,aAPwB;AAQxBY,EAAAA,kBARwB;AASxBO,EAAAA,YATwB;AAUxBE,EAAAA,iBAVwB;AAWxBE,EAAAA,kBAXwB;AAYxBC,EAAAA,YAZwB;AAaxBE,EAAAA,SAbwB;AAcxBE,EAAAA,UAdwB;AAexBsB,EAAAA,aAfwB;AAgBxBT,EAAAA,YAhBwB;AAiBxBY,EAAAA,eAjBwB;AAkBxBR,EAAAA,OAlBwB;AAmBxBU,EAAAA,UAnBwB;AAoBxBE,EAAAA;AApBwB,CAA1B;eAuBeG,iB","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"]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
1
8
|
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; }
|
|
2
9
|
|
|
3
10
|
/**
|
|
@@ -12,6 +19,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
12
19
|
* @param {number} distance The distance between the POI and the user's location.
|
|
13
20
|
* @param {number} duration The duration to travel to the POI from the user's location.
|
|
14
21
|
* @param {number} latitude The latitude of the POI.
|
|
22
|
+
* @param {string} locationid Location id of the POI.
|
|
15
23
|
* @param {number} longitude The longitude of the POI.
|
|
16
24
|
* @param {string} zipcode The zip code of the POI.
|
|
17
25
|
* @param {number} radius The radius of the POI.
|
|
@@ -90,5 +98,6 @@ class Poi {
|
|
|
90
98
|
|
|
91
99
|
}
|
|
92
100
|
|
|
93
|
-
|
|
101
|
+
var _default = Poi;
|
|
102
|
+
exports.default = _default;
|
|
94
103
|
//# sourceMappingURL=Poi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Poi.tsx"],"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"],"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;AAkBRC,EAAAA,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;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AACA,SAAKC,QAAL,GAAgBjB,QAAhB;AACA,SAAKkB,IAAL,GAAYjB,IAAZ;AACA,SAAKkB,OAAL,GAAejB,OAAf;AACA,SAAKkB,IAAL,GAAYjB,IAAZ;AACA,SAAKkB,IAAL,GAAYjB,IAAZ;AACA,SAAKkB,QAAL,GAAgBjB,QAAhB;AACA,SAAKkB,QAAL,GAAgBjB,QAAhB;AACA,SAAKkB,QAAL,GAAgBjB,QAAhB;AACA,SAAKkB,UAAL,GAAkBjB,UAAlB;AACA,SAAKkB,SAAL,GAAiBjB,SAAjB;AACA,SAAKkB,OAAL,GAAejB,OAAf;AACA,SAAKkB,MAAL,GAAcjB,MAAd;AACA,SAAKQ,OAAL,GAAejB,OAAf;AACA,SAAK2B,WAAL,GAAmBhB,WAAnB;AACA,SAAKiB,IAAL,GAAYhB,IAAZ;AACA,SAAKiB,KAAL,GAAahB,KAAb;AACA,SAAKiB,OAAL,GAAehB,OAAf;AACA,SAAKiB,OAAL,GAAerB,OAAf;AACD;AACD;AACF;AACA;AACA;AACA;AACA;;;AACkB,SAATsB,SAAS,CAACC,IAAD,EAAY;AAC1B,WAAO,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;AAmBD;;AAlFO;;eAoFKlB,G","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"]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
|
|
10
|
+
let PluginGeofencing = _reactNative.NativeModules.PluginGeofencing;
|
|
11
|
+
|
|
12
|
+
if (!PluginGeofencing) {
|
|
13
|
+
throw new Error('NativeModules.PluginGeofencing is undefined');
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
var _default = PluginGeofencing;
|
|
17
|
+
exports.default = _default;
|
|
18
|
+
//# sourceMappingURL=nativeInterface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["nativeInterface.tsx"],"names":["PluginGeofencing","NativeModules","Error"],"mappings":";;;;;;;AAAA;;AACA,IAAIA,gBAAgB,GAAGC,2BAAcD,gBAArC;;AAEA,IAAI,CAACA,gBAAL,EAAuB;AACrB,QAAM,IAAIE,KAAJ,CAAU,6CAAV,CAAN;AACD;;eAEcF,gB","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"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|