@woosmap/react-native-plugin-geofencing 0.3.0 → 0.4.1
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/android/src/main/java/com/reactnativeplugingeofencing/PluginGeofencingModule.java +52 -6
- package/android/src/main/java/com/reactnativeplugingeofencing/WoosmapMessageAndKey.java +1 -0
- package/android/src/main/java/com/reactnativeplugingeofencing/WoosmapTask.java +50 -3
- package/android/src/main/java/com/reactnativeplugingeofencing/WoosmapUtil.java +35 -0
- package/ios/DataPOI.swift +7 -1
- package/ios/PluginGeofencing.m +10 -0
- package/ios/PluginGeofencing.swift +88 -0
- package/ios/WoosmapGeofenceMessage.swift +2 -0
- package/ios/WoosmapGeofenceService.swift +37 -6
- package/lib/commonjs/index.js +70 -12
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/internal/IndoorBeacon.js +76 -0
- package/lib/commonjs/internal/IndoorBeacon.js.map +1 -0
- package/lib/commonjs/internal/Location.js +1 -2
- package/lib/commonjs/internal/Location.js.map +1 -1
- package/lib/commonjs/internal/Poi.js +5 -4
- package/lib/commonjs/internal/Poi.js.map +1 -1
- package/lib/commonjs/internal/Region.js +1 -2
- package/lib/commonjs/internal/Region.js.map +1 -1
- package/lib/commonjs/internal/nativeInterface.js +1 -2
- package/lib/commonjs/internal/nativeInterface.js.map +1 -1
- package/lib/module/index.js +69 -10
- package/lib/module/index.js.map +1 -1
- package/lib/module/internal/IndoorBeacon.js +70 -0
- package/lib/module/internal/IndoorBeacon.js.map +1 -0
- package/lib/module/internal/Poi.js +4 -2
- package/lib/module/internal/Poi.js.map +1 -1
- package/lib/typescript/index.d.ts +16 -1
- package/lib/typescript/internal/IndoorBeacon.d.ts +49 -0
- package/lib/typescript/internal/Poi.d.ts +2 -1
- package/package.json +3 -3
- package/react-native-plugin-geofencing.podspec +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_reactNativeUuid","_interopRequireDefault","_nativeInterface","_Location","_Region","_Poi","obj","__esModule","default","eventEmitter","NativeEventEmitter","PluginGeofencing","subscriptionsLocation","subscriptionsRegion","initialize","arg0","setWoosmapApiKey","apiKey","startTracking","trackingProfile","stopTracking","requestPermissions","background","requestBLEPermissions","Platform","OS","Promise","resolve","getPermissionsStatus","getBLEPermissionsStatus","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","catch","e","reject","getLocations","locationID","getAllLocations","getLocation","getPois","poiID","getAllPois","Poi","getPoi","removeRegions","removeAllRegions","removeRegion","removeLocations","removeAllLocations","removePois","removeAllPois","startCustomTracking","sourceType","source","WoosmapGeofencing","_default","exports"],"sources":["index.tsx"],"sourcesContent":["import { NativeEventEmitter, Platform } 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 request the required permissions to collect locations.\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. \n * The plugin will return an object with either one of the messages - BACKGROUND_LOCATION_DENIED, GRANTED, DENIED\n */\nfunction requestBLEPermissions(): Promise<string> {\n if (Platform.OS == 'android'){\n return PluginGeofencing.requestBLEPermissions();\n }\n else{\n return new Promise((resolve) => {\n resolve(\"GRANTED\");\n });\n }\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 * 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 - BACKGROUND_LOCATION_DENIED, GRANTED, DENIED\n */\nfunction getBLEPermissionsStatus(): Promise<string> {\n if (Platform.OS == 'android'){\n return PluginGeofencing.getBLEPermissionsStatus();\n }\n else{\n return new Promise((resolve) => {\n resolve(\"GRANTED\");\n });\n }\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 requestBLEPermissions,\n getPermissionsStatus,\n getBLEPermissionsStatus,\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,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,SAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,OAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,IAAA,GAAAJ,sBAAA,CAAAF,OAAA;AAAiC,SAAAE,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAOjC,MAAMG,YA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AAC,CAAC;EACN;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA,SAASW,aAAaA,CAACnB,QAAiB,EAAmB;EACzD,IAAIA,QAAQ,IAAI,IAAI,EAAE;IACpB,OAAOhD,wBAAgB,CAACoE,gBAAgB,CAAC,CAAC;EAC5C,CAAC,MAAM;IACL,OAAOpE,wBAAgB,CAACqE,YAAY,CAACrB,QAAQ,CAAC;EAChD;AACF;;AAEA;AACA;AACA;AACA;AACA,SAASsB,eAAeA,CAAA,EAAoB;EAC1C,OAAOtE,wBAAgB,CAACuE,kBAAkB,CAAC,CAAC;AAC9C;;AAEA;AACA;AACA;AACA;AACA,SAASC,UAAUA,CAAA,EAAoB;EACrC,OAAOxE,wBAAgB,CAACyE,aAAa,CAAC,CAAC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,mBAAmBA,CAC1BC,UAAyB,EACzBC,MAAc,EACG;EACjB,OAAO5E,wBAAgB,CAAC0E,mBAAmB,CAACC,UAAU,EAAEC,MAAM,CAAC;AACjE;AAWA,MAAMC,iBAAiB,GAAG;EACxB1E,UAAU;EACVE,gBAAgB;EAChBE,aAAa;EACbG,kBAAkB;EAClBE,qBAAqB;EACrBK,oBAAoB;EACpBC,uBAAuB;EACvBT,YAAY;EACZU,aAAa;EACbY,kBAAkB;EAClBO,YAAY;EACZE,iBAAiB;EACjBE,kBAAkB;EAClBC,YAAY;EACZE,SAAS;EACTE,UAAU;EACVoB,aAAa;EACbT,YAAY;EACZY,eAAe;EACfR,OAAO;EACPU,UAAU;EACVE;AACF,CAAC;AAAC,IAAAI,QAAA,GAEaD,iBAAiB;AAAAE,OAAA,CAAAlF,OAAA,GAAAiF,QAAA"}
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_reactNativeUuid","_interopRequireDefault","_nativeInterface","_Location","_Region","_Poi","_IndoorBeacon","obj","__esModule","default","eventEmitter","NativeEventEmitter","PluginGeofencing","subscriptionsLocation","subscriptionsRegion","initialize","arg0","setWoosmapApiKey","apiKey","startTracking","trackingProfile","stopTracking","requestPermissions","background","requestBLEPermissions","Platform","OS","Promise","resolve","getPermissionsStatus","getBLEPermissionsStatus","watchLocation","success","error","watchID","uuid","v1","toString","successCallback","result","Location","jsonToObj","addListener","clearLocationWatch","removeAllListeners","clearAllLocationWatch","saved","remove","arg1","undefined","watchRegions","Region","clearRegionsWatch","clearAllRegionsWatch","setSFMCCredentials","setPoiRadius","radius","addRegion","region","getRegions","regionID","getAllRegions","then","formatted","forEach","item","push","catch","e","reject","getLocations","locationID","getAllLocations","getLocation","getPois","poiID","getAllPois","Poi","getPoi","removeRegions","removeAllRegions","removeRegion","removeLocations","removeAllLocations","removePois","removeAllPois","startCustomTracking","sourceType","source","getIndoorBeacons","venueID","ref","getAllIndoorBeacons","identifier","IndoorBeacon","removeIndoorBeacons","WoosmapGeofencing","_default","exports"],"sources":["index.tsx"],"sourcesContent":["import { NativeEventEmitter, Platform } 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 IndoorBeacon from './internal/IndoorBeacon';\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 request the required permissions to collect locations.\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.\n * The plugin will return an object with either one of the messages - BACKGROUND_LOCATION_DENIED, GRANTED, DENIED\n */\nfunction requestBLEPermissions(): Promise<string> {\n if (Platform.OS === 'android') {\n return PluginGeofencing.requestBLEPermissions();\n } else {\n return new Promise((resolve) => {\n resolve('GRANTED');\n });\n }\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 * 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 - BACKGROUND_LOCATION_DENIED, GRANTED, DENIED\n */\nfunction getBLEPermissionsStatus(): Promise<string> {\n if (Platform.OS == 'android') {\n return PluginGeofencing.getBLEPermissionsStatus();\n } else {\n return new Promise((resolve) => {\n resolve('GRANTED');\n });\n }\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 arg0.remove();\n //eventEmitter.removeListener('geolocationDidChange', arg0);\n const arg1 = saved[1];\n if (arg1) {\n arg1.remove();\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 arg0.remove();\n //eventEmitter.removeListener('woosmapgeofenceRegionDidChange', arg0);\n const arg1 = saved[1];\n if (arg1) {\n arg1.remove();\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\n/**\n * Retrieve Beacon info for venue\n * @param venueID - Optional venue id\n * @param ref - Optional beacon id return by region event\n * @returns promise with A callback that will be called on success or error.\n */\nfunction getIndoorBeacons(\n venueID?: string,\n ref?: string\n): Promise<IndoorBeacon[]> {\n if (venueID == null) {\n return PluginGeofencing.getAllIndoorBeacons()\n .then((result: any[]) => {\n var formatted: IndoorBeacon[] = [];\n result.forEach((item) => {\n if (ref !== undefined) {\n if (item.identifier === ref) {\n formatted.push(IndoorBeacon.jsonToObj(item));\n }\n } else {\n formatted.push(IndoorBeacon.jsonToObj(item));\n }\n });\n return Promise.resolve(formatted);\n })\n .catch((e: any) => {\n return Promise.reject(e);\n });\n } else {\n return PluginGeofencing.getIndoorBeacons(venueID)\n .then((result: any[]) => {\n var formatted: IndoorBeacon[] = [];\n result.forEach((item) => {\n if (ref !== undefined) {\n if (item.identifier === ref) {\n formatted.push(IndoorBeacon.jsonToObj(item));\n }\n } else {\n formatted.push(IndoorBeacon.jsonToObj(item));\n }\n });\n return Promise.resolve(formatted);\n })\n .catch((e: any) => {\n return Promise.reject(e);\n });\n }\n}\n\n/**\n * Remove saved POI info\n * @returns promise with A callback that will be called on success or error.\n */\nfunction removeIndoorBeacons(): Promise<string> {\n return PluginGeofencing.removeIndoorBeacons();\n}\n\nexport type {\n RegionType,\n GeofenceRegion,\n Region,\n Location,\n Poi,\n ProfileSource,\n IndoorBeacon,\n};\n\nconst WoosmapGeofencing = {\n initialize,\n setWoosmapApiKey,\n startTracking,\n requestPermissions,\n requestBLEPermissions,\n getPermissionsStatus,\n getBLEPermissionsStatus,\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 getIndoorBeacons,\n removeIndoorBeacons,\n};\n\nexport default WoosmapGeofencing;\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,SAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,OAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,IAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,aAAA,GAAAL,sBAAA,CAAAF,OAAA;AAAmD,SAAAE,uBAAAM,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAOnD,MAAMG,YAAY,GAAG,IAAIC,+BAAkB,CAACC,wBAAgB,CAAC;AAE7D,IAAIC,qBAA0B,GAAG,CAAC,CAAC;AACnC,IAAIC,mBAAwB,GAAG,CAAC,CAAC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,UAAUA,CAACC,IAAU,EAAmB;EAC/C,IAAIA,IAAI,IAAI,IAAI,EAAE;IAChBA,IAAI,GAAG,CAAC,CAAC;EACX;EACA,OAAOJ,wBAAgB,CAACG,UAAU,CAACC,IAAI,CAAC;AAC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AAK1C,SAAS,EAAE;UACrB,IAAIgB,IAAI,CAAC4B,UAAU,KAAKF,GAAG,EAAE;YAC3B5B,SAAS,CAACG,IAAI,CAAC4B,qBAAY,CAACrD,SAAS,CAACwB,IAAI,CAAC,CAAC;UAC9C;QACF,CAAC,MAAM;UACLF,SAAS,CAACG,IAAI,CAAC4B,qBAAY,CAACrD,SAAS,CAACwB,IAAI,CAAC,CAAC;QAC9C;MACF,CAAC,CAAC;MACF,OAAOtC,OAAO,CAACC,OAAO,CAACmC,SAAS,CAAC;IACnC,CAAC,CAAC,CACDI,KAAK,CAAEC,CAAM,IAAK;MACjB,OAAOzC,OAAO,CAAC0C,MAAM,CAACD,CAAC,CAAC;IAC1B,CAAC,CAAC;EACN;AACF;;AAEA;AACA;AACA;AACA;AACA,SAAS2B,mBAAmBA,CAAA,EAAoB;EAC9C,OAAOnF,wBAAgB,CAACmF,mBAAmB,CAAC,CAAC;AAC/C;AAYA,MAAMC,iBAAiB,GAAG;EACxBjF,UAAU;EACVE,gBAAgB;EAChBE,aAAa;EACbG,kBAAkB;EAClBE,qBAAqB;EACrBK,oBAAoB;EACpBC,uBAAuB;EACvBT,YAAY;EACZU,aAAa;EACbY,kBAAkB;EAClBO,YAAY;EACZE,iBAAiB;EACjBE,kBAAkB;EAClBC,YAAY;EACZE,SAAS;EACTE,UAAU;EACVoB,aAAa;EACbT,YAAY;EACZY,eAAe;EACfR,OAAO;EACPU,UAAU;EACVE,mBAAmB;EACnBG,gBAAgB;EAChBM;AACF,CAAC;AAAC,IAAAE,QAAA,GAAAC,OAAA,CAAAzF,OAAA,GAEauF,iBAAiB"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
9
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
10
|
+
/**
|
|
11
|
+
* Represents an indoor beacon.
|
|
12
|
+
* @class
|
|
13
|
+
* @param {string} beaconId - The ID of the beacon.
|
|
14
|
+
* @param {number} major - The major version number of the beacon.
|
|
15
|
+
* @param {number} minor - The minor version number of the beacon.
|
|
16
|
+
* @param {string} venueId - The ID of the venue where the beacon is located.
|
|
17
|
+
* @param {string} identifier - The identifier of the beacon.
|
|
18
|
+
* @param {number} latitude - The latitude coordinate of the beacon's location.
|
|
19
|
+
* @param {number} longitude - The longitude coordinate of the beacon's location.
|
|
20
|
+
* @param {number} date - The date when the beacon was created.
|
|
21
|
+
* @param {Object} properties - custom property share with beacon
|
|
22
|
+
*/
|
|
23
|
+
class IndoorBeacon {
|
|
24
|
+
/**
|
|
25
|
+
* Creates a new instance of the Beacon class.
|
|
26
|
+
* @param {string} beaconId - The ID of the beacon.
|
|
27
|
+
* @param {number} major - The major version number of the beacon.
|
|
28
|
+
* @param {number} minor - The minor version number of the beacon.
|
|
29
|
+
* @param {string} venueId - The ID of the venue where the beacon is located.
|
|
30
|
+
* @param {string} identifier - The identifier of the beacon.
|
|
31
|
+
* @param {number} latitude - The latitude coordinate of the beacon's location.
|
|
32
|
+
* @param {number} longitude - The longitude coordinate of the beacon's location.
|
|
33
|
+
* @param {number} date - The date when the beacon was created.
|
|
34
|
+
* @param {Object} properties - custom property share with beacon
|
|
35
|
+
*/
|
|
36
|
+
constructor(beaconId, major, minor, venueId, identifier, latitude, longitude, date, properties) {
|
|
37
|
+
/// The UUID of the beacon.
|
|
38
|
+
_defineProperty(this, "beaconId", void 0);
|
|
39
|
+
/// The Major version of the beacon.
|
|
40
|
+
_defineProperty(this, "major", void 0);
|
|
41
|
+
/// The Minor version of the beacon.
|
|
42
|
+
_defineProperty(this, "minor", void 0);
|
|
43
|
+
/// The ID of the venue to which this beacon belongs to.
|
|
44
|
+
_defineProperty(this, "venueId", void 0);
|
|
45
|
+
/// Woosmap identifier of the beacon.
|
|
46
|
+
_defineProperty(this, "identifier", void 0);
|
|
47
|
+
/// Latitude of the beacon.
|
|
48
|
+
_defineProperty(this, "latitude", void 0);
|
|
49
|
+
/// Longitude of the beacon.
|
|
50
|
+
_defineProperty(this, "longitude", void 0);
|
|
51
|
+
/// The date when the beacon was added/updated.
|
|
52
|
+
_defineProperty(this, "date", void 0);
|
|
53
|
+
/// Custom properties associated to the beacon.
|
|
54
|
+
_defineProperty(this, "properties", void 0);
|
|
55
|
+
this.beaconId = beaconId;
|
|
56
|
+
this.major = major;
|
|
57
|
+
this.minor = minor;
|
|
58
|
+
this.venueId = venueId;
|
|
59
|
+
this.identifier = identifier;
|
|
60
|
+
this.latitude = latitude;
|
|
61
|
+
this.longitude = longitude;
|
|
62
|
+
this.date = date;
|
|
63
|
+
this.properties = properties;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Converts json object to an object of type IndoorBeacon.
|
|
67
|
+
* @param {Object} json The json representation of the IndoorBeacon.
|
|
68
|
+
* @returns Object
|
|
69
|
+
* @memberof Poi
|
|
70
|
+
*/
|
|
71
|
+
static jsonToObj(json) {
|
|
72
|
+
return new IndoorBeacon(json.beaconId, json.major, json.minor, json.venueId, json.identifier, json.latitude, json.longitude, json.date, json.properties);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
var _default = exports.default = IndoorBeacon;
|
|
76
|
+
//# sourceMappingURL=IndoorBeacon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["IndoorBeacon","constructor","beaconId","major","minor","venueId","identifier","latitude","longitude","date","properties","_defineProperty","jsonToObj","json","_default","exports","default"],"sources":["IndoorBeacon.tsx"],"sourcesContent":["/**\n * Represents an indoor beacon.\n * @class\n * @param {string} beaconId - The ID of the beacon.\n * @param {number} major - The major version number of the beacon.\n * @param {number} minor - The minor version number of the beacon.\n * @param {string} venueId - The ID of the venue where the beacon is located.\n * @param {string} identifier - The identifier of the beacon.\n * @param {number} latitude - The latitude coordinate of the beacon's location.\n * @param {number} longitude - The longitude coordinate of the beacon's location.\n * @param {number} date - The date when the beacon was created.\n * @param {Object} properties - custom property share with beacon\n */\nclass IndoorBeacon {\n /// The UUID of the beacon.\n beaconId: string;\n\n /// The Major version of the beacon.\n major: number;\n\n /// The Minor version of the beacon.\n minor: number;\n\n /// The ID of the venue to which this beacon belongs to.\n venueId: string;\n\n /// Woosmap identifier of the beacon.\n identifier: string;\n\n /// Latitude of the beacon.\n latitude: number;\n\n /// Longitude of the beacon.\n longitude: number;\n\n /// The date when the beacon was added/updated.\n date: number;\n\n /// Custom properties associated to the beacon.\n properties: { [key: string]: any };\n\n /**\n * Creates a new instance of the Beacon class.\n * @param {string} beaconId - The ID of the beacon.\n * @param {number} major - The major version number of the beacon.\n * @param {number} minor - The minor version number of the beacon.\n * @param {string} venueId - The ID of the venue where the beacon is located.\n * @param {string} identifier - The identifier of the beacon.\n * @param {number} latitude - The latitude coordinate of the beacon's location.\n * @param {number} longitude - The longitude coordinate of the beacon's location.\n * @param {number} date - The date when the beacon was created.\n * @param {Object} properties - custom property share with beacon\n */\n constructor(\n beaconId: string,\n major: number,\n minor: number,\n venueId: string,\n identifier: string,\n latitude: number,\n longitude: number,\n date: number,\n properties: { [key: string]: any }\n ) {\n this.beaconId = beaconId;\n this.major = major;\n this.minor = minor;\n this.venueId = venueId;\n this.identifier = identifier;\n this.latitude = latitude;\n this.longitude = longitude;\n this.date = date;\n this.properties = properties;\n }\n /**\n * Converts json object to an object of type IndoorBeacon.\n * @param {Object} json The json representation of the IndoorBeacon.\n * @returns Object\n * @memberof Poi\n */\n static jsonToObj(json: any) {\n return new IndoorBeacon(\n json.beaconId,\n json.major,\n json.minor,\n json.venueId,\n json.identifier,\n json.latitude,\n json.longitude,\n json.date,\n json.properties\n );\n }\n}\nexport default IndoorBeacon;\n"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,YAAY,CAAC;EA4BjB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,WAAWA,CACTC,QAAgB,EAChBC,KAAa,EACbC,KAAa,EACbC,OAAe,EACfC,UAAkB,EAClBC,QAAgB,EAChBC,SAAiB,EACjBC,IAAY,EACZC,UAAkC,EAClC;IAjDF;IAAAC,eAAA;IAGA;IAAAA,eAAA;IAGA;IAAAA,eAAA;IAGA;IAAAA,eAAA;IAGA;IAAAA,eAAA;IAGA;IAAAA,eAAA;IAGA;IAAAA,eAAA;IAGA;IAAAA,eAAA;IAGA;IAAAA,eAAA;IA0BE,IAAI,CAACT,QAAQ,GAAGA,QAAQ;IACxB,IAAI,CAACC,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACC,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACC,OAAO,GAAGA,OAAO;IACtB,IAAI,CAACC,UAAU,GAAGA,UAAU;IAC5B,IAAI,CAACC,QAAQ,GAAGA,QAAQ;IACxB,IAAI,CAACC,SAAS,GAAGA,SAAS;IAC1B,IAAI,CAACC,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACC,UAAU,GAAGA,UAAU;EAC9B;EACA;AACF;AACA;AACA;AACA;AACA;EACE,OAAOE,SAASA,CAACC,IAAS,EAAE;IAC1B,OAAO,IAAIb,YAAY,CACrBa,IAAI,CAACX,QAAQ,EACbW,IAAI,CAACV,KAAK,EACVU,IAAI,CAACT,KAAK,EACVS,IAAI,CAACR,OAAO,EACZQ,IAAI,CAACP,UAAU,EACfO,IAAI,CAACN,QAAQ,EACbM,IAAI,CAACL,SAAS,EACdK,IAAI,CAACJ,IAAI,EACTI,IAAI,CAACH,UACP,CAAC;EACH;AACF;AAAC,IAAAI,QAAA,GAAAC,OAAA,CAAAC,OAAA,GACchB,YAAY"}
|
|
@@ -40,6 +40,5 @@ class Location {
|
|
|
40
40
|
return new Location(json.date, json.latitude, json.locationdescription, json.locationid, json.longitude);
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
var _default = Location;
|
|
44
|
-
exports.default = _default;
|
|
43
|
+
var _default = exports.default = Location;
|
|
45
44
|
//# sourceMappingURL=Location.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Location","constructor","date","latitude","locationdescription","locationid","longitude","_defineProperty","Date","Latitude","Locationdescription","Locationid","Longitude","jsonToObj","json","_default","exports","default"],"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,QAAQ,CAAC;EAMbC,WAAWA,CACTC,IAAY,EACZC,QAAgB,EAChBC,mBAA2B,EAC3BC,UAAkB,EAClBC,SAAiB,EACjB;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IACA,IAAI,CAACC,IAAI,GAAGN,IAAI;IAChB,IAAI,CAACO,QAAQ,GAAGN,QAAQ;IACxB,IAAI,CAACO,mBAAmB,GAAGN,mBAAmB;IAC9C,IAAI,CAACO,UAAU,GAAGN,UAAU;IAC5B,IAAI,CAACO,SAAS,GAAGN,SAAS;EAC5B;EACA;AACF;AACA;AACA;AACA;AACA;EACE,OAAOO,SAASA,CAACC,IAAS,EAAE;IAC1B,OAAO,IAAId,QAAQ,CACjBc,IAAI,CAACZ,IAAI,EACTY,IAAI,CAACX,QAAQ,EACbW,IAAI,CAACV,mBAAmB,EACxBU,IAAI,CAACT,UAAU,EACfS,IAAI,CAACR,SACP,CAAC;EACH;AACF;AAAC,IAAAS,QAAA,
|
|
1
|
+
{"version":3,"names":["Location","constructor","date","latitude","locationdescription","locationid","longitude","_defineProperty","Date","Latitude","Locationdescription","Locationid","Longitude","jsonToObj","json","_default","exports","default"],"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,QAAQ,CAAC;EAMbC,WAAWA,CACTC,IAAY,EACZC,QAAgB,EAChBC,mBAA2B,EAC3BC,UAAkB,EAClBC,SAAiB,EACjB;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IACA,IAAI,CAACC,IAAI,GAAGN,IAAI;IAChB,IAAI,CAACO,QAAQ,GAAGN,QAAQ;IACxB,IAAI,CAACO,mBAAmB,GAAGN,mBAAmB;IAC9C,IAAI,CAACO,UAAU,GAAGN,UAAU;IAC5B,IAAI,CAACO,SAAS,GAAGN,SAAS;EAC5B;EACA;AACF;AACA;AACA;AACA;AACA;EACE,OAAOO,SAASA,CAACC,IAAS,EAAE;IAC1B,OAAO,IAAId,QAAQ,CACjBc,IAAI,CAACZ,IAAI,EACTY,IAAI,CAACX,QAAQ,EACbW,IAAI,CAACV,mBAAmB,EACxBU,IAAI,CAACT,UAAU,EACfS,IAAI,CAACR,SACP,CAAC;EACH;AACF;AAAC,IAAAS,QAAA,GAAAC,OAAA,CAAAC,OAAA,GACcjB,QAAQ"}
|
|
@@ -30,7 +30,7 @@ function _toPrimitive(input, hint) { if (typeof input !== "object" || input ===
|
|
|
30
30
|
* @param {string} contact The contact for the POI.
|
|
31
31
|
*/
|
|
32
32
|
class Poi {
|
|
33
|
-
constructor(jsondata, city, idstore, name, date, distance, duration, latitude, locationid, longitude, zipcode, radius, address, countrycode, tags, types, contact) {
|
|
33
|
+
constructor(jsondata, city, idstore, name, date, distance, duration, latitude, locationid, longitude, zipcode, radius, address, countrycode, tags, types, contact, userProperties) {
|
|
34
34
|
_defineProperty(this, "Jsondata", void 0);
|
|
35
35
|
_defineProperty(this, "City", void 0);
|
|
36
36
|
_defineProperty(this, "Idstore", void 0);
|
|
@@ -48,6 +48,7 @@ class Poi {
|
|
|
48
48
|
_defineProperty(this, "Types", void 0);
|
|
49
49
|
_defineProperty(this, "Contact", void 0);
|
|
50
50
|
_defineProperty(this, "Address", void 0);
|
|
51
|
+
_defineProperty(this, "userProperties", void 0);
|
|
51
52
|
this.Jsondata = jsondata;
|
|
52
53
|
this.City = city;
|
|
53
54
|
this.Idstore = idstore;
|
|
@@ -66,6 +67,7 @@ class Poi {
|
|
|
66
67
|
this.Types = types;
|
|
67
68
|
this.Contact = contact;
|
|
68
69
|
this.Address = address;
|
|
70
|
+
this.userProperties = userProperties;
|
|
69
71
|
}
|
|
70
72
|
/**
|
|
71
73
|
* Converts json object to an object of type Poi.
|
|
@@ -74,9 +76,8 @@ class Poi {
|
|
|
74
76
|
* @memberof Poi
|
|
75
77
|
*/
|
|
76
78
|
static jsonToObj(json) {
|
|
77
|
-
return new Poi(json.jsondata, json.city, json.idstore, json.name, json.date, json.distance, json.duration, json.latitude, json.locationid, json.longitude, json.zipcode, json.radius, json.address, json.countrycode, json.tags, json.types, json.contact);
|
|
79
|
+
return new Poi(json.jsondata, json.city, json.idstore, json.name, json.date, json.distance, json.duration, json.latitude, json.locationid, json.longitude, json.zipcode, json.radius, json.address, json.countrycode, json.tags, json.types, json.contact, json.userProperties);
|
|
78
80
|
}
|
|
79
81
|
}
|
|
80
|
-
var _default = Poi;
|
|
81
|
-
exports.default = _default;
|
|
82
|
+
var _default = exports.default = Poi;
|
|
82
83
|
//# sourceMappingURL=Poi.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Poi","constructor","jsondata","city","idstore","name","date","distance","duration","latitude","locationid","longitude","zipcode","radius","address","countrycode","tags","types","contact","_defineProperty","Jsondata","City","Idstore","Name","Date","Distance","Duration","Latitude","Locationid","Longitude","Zipcode","Radius","Countrycode","Tags","Types","Contact","Address","jsonToObj","json","_default","exports","default"],"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,GAAG,CAAC;
|
|
1
|
+
{"version":3,"names":["Poi","constructor","jsondata","city","idstore","name","date","distance","duration","latitude","locationid","longitude","zipcode","radius","address","countrycode","tags","types","contact","userProperties","_defineProperty","Jsondata","City","Idstore","Name","Date","Distance","Duration","Latitude","Locationid","Longitude","Zipcode","Radius","Countrycode","Tags","Types","Contact","Address","jsonToObj","json","_default","exports","default"],"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 userProperties: [string: any];\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 userProperties: [string: any]\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 this.userProperties = userProperties;\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 json.userProperties\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,GAAG,CAAC;EAmBRC,WAAWA,CACTC,QAAgB,EAChBC,IAAY,EACZC,OAAe,EACfC,IAAY,EACZC,IAAY,EACZC,QAAgB,EAChBC,QAAgB,EAChBC,QAAgB,EAChBC,UAAkB,EAClBC,SAAiB,EACjBC,OAAe,EACfC,MAAc,EACdC,OAAe,EACfC,WAAmB,EACnBC,IAAY,EACZC,KAAa,EACbC,OAAe,EACfC,cAA6B,EAC7B;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IACA,IAAI,CAACC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ChBwB,IAAI,CAACvB,IAAI,EACTuB,IAAI,CAACtB,KAAK,EACVsB,IAAI,CAACrB,OAAO,EACZqB,IAAI,CAACpB,cACP,CAAC;EACH;AACF;AAAC,IAAAqB,QAAA,GAAAC,OAAA,CAAAC,OAAA,GACc1C,GAAG"}
|
|
@@ -52,6 +52,5 @@ class Region {
|
|
|
52
52
|
return new Region(json.date, json.didenter, json.identifier, json.latitude, json.longitude, json.radius, json.frompositiondetection, json.eventname, json.spenttime);
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
var _default = Region;
|
|
56
|
-
exports.default = _default;
|
|
55
|
+
var _default = exports.default = Region;
|
|
57
56
|
//# sourceMappingURL=Region.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Region","constructor","date","didenter","identifier","latitude","longitude","radius","frompositiondetection","eventname","spenttime","_defineProperty","Date","Didenter","Identifier","Latitude","Longitude","Radius","Frompositiondetection","Eventname","SpentTime","jsonToObj","json","_default","exports","default"],"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 current position is inside the region.\n * @param {string} eventName Describe cause of region event, Entry or Exit.\n * @param {number} spenttime Number of seconds the user spent in region in case of event name Exit.\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 Eventname: string;\n SpentTime: number;\n constructor(\n date: number,\n didenter: boolean,\n identifier: string,\n latitude: number,\n longitude: number,\n radius: number,\n frompositiondetection: boolean,\n eventname: string,\n spenttime: number\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 this.Eventname = eventname;\n this.SpentTime = spenttime;\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 json.eventname,\n json.spenttime\n );\n }\n}\nexport default Region;\n"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,MAAM,CAAC;EAUXC,WAAWA,CACTC,IAAY,EACZC,QAAiB,EACjBC,UAAkB,EAClBC,QAAgB,EAChBC,SAAiB,EACjBC,MAAc,EACdC,qBAA8B,EAC9BC,SAAiB,EACjBC,SAAiB,EACjB;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IACA,IAAI,CAACC,IAAI,GAAGV,IAAI;IAChB,IAAI,CAACW,QAAQ,GAAGV,QAAQ;IACxB,IAAI,CAACW,UAAU,GAAGV,UAAU;IAC5B,IAAI,CAACW,QAAQ,GAAGV,QAAQ;IACxB,IAAI,CAACW,SAAS,GAAGV,SAAS;IAC1B,IAAI,CAACW,MAAM,GAAGV,MAAM;IACpB,IAAI,CAACW,qBAAqB,GAAGV,qBAAqB;IAClD,IAAI,CAACW,SAAS,GAAGV,SAAS;IAC1B,IAAI,CAACW,SAAS,GAAGV,SAAS;EAC5B;EACA;AACF;AACA;AACA;AACA;AACA;EACE,OAAOW,SAASA,CAACC,IAAS,EAAE;IAC1B,OAAO,IAAItB,MAAM,CACfsB,IAAI,CAACpB,IAAI,EACToB,IAAI,CAACnB,QAAQ,EACbmB,IAAI,CAAClB,UAAU,EACfkB,IAAI,CAACjB,QAAQ,EACbiB,IAAI,CAAChB,SAAS,EACdgB,IAAI,CAACf,MAAM,EACXe,IAAI,CAACd,qBAAqB,EAC1Bc,IAAI,CAACb,SAAS,EACda,IAAI,CAACZ,SACP,CAAC;EACH;AACF;AAAC,IAAAa,QAAA,
|
|
1
|
+
{"version":3,"names":["Region","constructor","date","didenter","identifier","latitude","longitude","radius","frompositiondetection","eventname","spenttime","_defineProperty","Date","Didenter","Identifier","Latitude","Longitude","Radius","Frompositiondetection","Eventname","SpentTime","jsonToObj","json","_default","exports","default"],"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 current position is inside the region.\n * @param {string} eventName Describe cause of region event, Entry or Exit.\n * @param {number} spenttime Number of seconds the user spent in region in case of event name Exit.\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 Eventname: string;\n SpentTime: number;\n constructor(\n date: number,\n didenter: boolean,\n identifier: string,\n latitude: number,\n longitude: number,\n radius: number,\n frompositiondetection: boolean,\n eventname: string,\n spenttime: number\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 this.Eventname = eventname;\n this.SpentTime = spenttime;\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 json.eventname,\n json.spenttime\n );\n }\n}\nexport default Region;\n"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,MAAM,CAAC;EAUXC,WAAWA,CACTC,IAAY,EACZC,QAAiB,EACjBC,UAAkB,EAClBC,QAAgB,EAChBC,SAAiB,EACjBC,MAAc,EACdC,qBAA8B,EAC9BC,SAAiB,EACjBC,SAAiB,EACjB;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IACA,IAAI,CAACC,IAAI,GAAGV,IAAI;IAChB,IAAI,CAACW,QAAQ,GAAGV,QAAQ;IACxB,IAAI,CAACW,UAAU,GAAGV,UAAU;IAC5B,IAAI,CAACW,QAAQ,GAAGV,QAAQ;IACxB,IAAI,CAACW,SAAS,GAAGV,SAAS;IAC1B,IAAI,CAACW,MAAM,GAAGV,MAAM;IACpB,IAAI,CAACW,qBAAqB,GAAGV,qBAAqB;IAClD,IAAI,CAACW,SAAS,GAAGV,SAAS;IAC1B,IAAI,CAACW,SAAS,GAAGV,SAAS;EAC5B;EACA;AACF;AACA;AACA;AACA;AACA;EACE,OAAOW,SAASA,CAACC,IAAS,EAAE;IAC1B,OAAO,IAAItB,MAAM,CACfsB,IAAI,CAACpB,IAAI,EACToB,IAAI,CAACnB,QAAQ,EACbmB,IAAI,CAAClB,UAAU,EACfkB,IAAI,CAACjB,QAAQ,EACbiB,IAAI,CAAChB,SAAS,EACdgB,IAAI,CAACf,MAAM,EACXe,IAAI,CAACd,qBAAqB,EAC1Bc,IAAI,CAACb,SAAS,EACda,IAAI,CAACZ,SACP,CAAC;EACH;AACF;AAAC,IAAAa,QAAA,GAAAC,OAAA,CAAAC,OAAA,GACczB,MAAM"}
|
|
@@ -9,6 +9,5 @@ let PluginGeofencing = _reactNative.NativeModules.PluginGeofencing;
|
|
|
9
9
|
if (!PluginGeofencing) {
|
|
10
10
|
throw new Error('NativeModules.PluginGeofencing is undefined');
|
|
11
11
|
}
|
|
12
|
-
var _default = PluginGeofencing;
|
|
13
|
-
exports.default = _default;
|
|
12
|
+
var _default = exports.default = PluginGeofencing;
|
|
14
13
|
//# sourceMappingURL=nativeInterface.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","PluginGeofencing","NativeModules","Error","_default","exports","default"],"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,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAIC,gBAAgB,GAAGC,0BAAa,CAACD,gBAAgB;AAErD,IAAI,CAACA,gBAAgB,EAAE;EACrB,MAAM,IAAIE,KAAK,CAAC,6CAA6C,CAAC;AAChE;AAAC,IAAAC,QAAA,
|
|
1
|
+
{"version":3,"names":["_reactNative","require","PluginGeofencing","NativeModules","Error","_default","exports","default"],"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,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAIC,gBAAgB,GAAGC,0BAAa,CAACD,gBAAgB;AAErD,IAAI,CAACA,gBAAgB,EAAE;EACrB,MAAM,IAAIE,KAAK,CAAC,6CAA6C,CAAC;AAChE;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcL,gBAAgB"}
|
package/lib/module/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import PluginGeofencing from './internal/nativeInterface';
|
|
|
4
4
|
import Location from './internal/Location';
|
|
5
5
|
import Region from './internal/Region';
|
|
6
6
|
import Poi from './internal/Poi';
|
|
7
|
+
import IndoorBeacon from './internal/IndoorBeacon';
|
|
7
8
|
const eventEmitter = new NativeEventEmitter(PluginGeofencing);
|
|
8
9
|
let subscriptionsLocation = {};
|
|
9
10
|
let subscriptionsRegion = {};
|
|
@@ -63,15 +64,15 @@ function requestPermissions(background) {
|
|
|
63
64
|
|
|
64
65
|
/**
|
|
65
66
|
* A method to request the required permissions to collect locations.
|
|
66
|
-
* @returns A callback that will be called on successful authorization by the app. A callback that will be called when the app denies permission.
|
|
67
|
+
* @returns A callback that will be called on successful authorization by the app. A callback that will be called when the app denies permission.
|
|
67
68
|
* The plugin will return an object with either one of the messages - BACKGROUND_LOCATION_DENIED, GRANTED, DENIED
|
|
68
69
|
*/
|
|
69
70
|
function requestBLEPermissions() {
|
|
70
|
-
if (Platform.OS
|
|
71
|
+
if (Platform.OS === 'android') {
|
|
71
72
|
return PluginGeofencing.requestBLEPermissions();
|
|
72
73
|
} else {
|
|
73
74
|
return new Promise(resolve => {
|
|
74
|
-
resolve(
|
|
75
|
+
resolve('GRANTED');
|
|
75
76
|
});
|
|
76
77
|
}
|
|
77
78
|
}
|
|
@@ -93,7 +94,7 @@ function getBLEPermissionsStatus() {
|
|
|
93
94
|
return PluginGeofencing.getBLEPermissionsStatus();
|
|
94
95
|
} else {
|
|
95
96
|
return new Promise(resolve => {
|
|
96
|
-
resolve(
|
|
97
|
+
resolve('GRANTED');
|
|
97
98
|
});
|
|
98
99
|
}
|
|
99
100
|
}
|
|
@@ -129,11 +130,14 @@ function clearLocationWatch(watchID) {
|
|
|
129
130
|
const saved = subscriptionsLocation[watchID];
|
|
130
131
|
if (saved) {
|
|
131
132
|
const arg0 = saved[0];
|
|
132
|
-
|
|
133
|
+
arg0.remove();
|
|
134
|
+
//eventEmitter.removeListener('geolocationDidChange', arg0);
|
|
133
135
|
const arg1 = saved[1];
|
|
134
136
|
if (arg1) {
|
|
135
|
-
|
|
137
|
+
arg1.remove();
|
|
138
|
+
//eventEmitter.removeListener('geolocationError', arg1);
|
|
136
139
|
}
|
|
140
|
+
|
|
137
141
|
subscriptionsLocation[watchID] = undefined;
|
|
138
142
|
}
|
|
139
143
|
return PluginGeofencing.clearLocationWatch(watchID);
|
|
@@ -171,11 +175,14 @@ function clearRegionsWatch(watchID) {
|
|
|
171
175
|
const saved = subscriptionsRegion[watchID];
|
|
172
176
|
if (saved) {
|
|
173
177
|
const arg0 = saved[0];
|
|
174
|
-
|
|
178
|
+
arg0.remove();
|
|
179
|
+
//eventEmitter.removeListener('woosmapgeofenceRegionDidChange', arg0);
|
|
175
180
|
const arg1 = saved[1];
|
|
176
181
|
if (arg1) {
|
|
177
|
-
|
|
182
|
+
arg1.remove();
|
|
183
|
+
//eventEmitter.removeListener('woosmapgeofenceRegionError', arg1);
|
|
178
184
|
}
|
|
185
|
+
|
|
179
186
|
subscriptionsRegion[watchID] = undefined;
|
|
180
187
|
}
|
|
181
188
|
return PluginGeofencing.clearRegionsWatch(watchID);
|
|
@@ -317,7 +324,7 @@ function removePois() {
|
|
|
317
324
|
return PluginGeofencing.removeAllPois();
|
|
318
325
|
}
|
|
319
326
|
/**
|
|
320
|
-
* if preset tracking profiles don’t fit with your use cases, you can build your own profile and uses the startCustomTracking() method.
|
|
327
|
+
* if preset tracking profiles don’t fit with your use cases, you can build your own profile and uses the startCustomTracking() method.
|
|
321
328
|
* There are two way to host the json file:
|
|
322
329
|
* - included in the client application (local)
|
|
323
330
|
* - hosted externally in a file folder in your information system (external)
|
|
@@ -328,6 +335,56 @@ function removePois() {
|
|
|
328
335
|
function startCustomTracking(sourceType, source) {
|
|
329
336
|
return PluginGeofencing.startCustomTracking(sourceType, source);
|
|
330
337
|
}
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* Retrieve Beacon info for venue
|
|
341
|
+
* @param venueID - Optional venue id
|
|
342
|
+
* @param ref - Optional beacon id return by region event
|
|
343
|
+
* @returns promise with A callback that will be called on success or error.
|
|
344
|
+
*/
|
|
345
|
+
function getIndoorBeacons(venueID, ref) {
|
|
346
|
+
if (venueID == null) {
|
|
347
|
+
return PluginGeofencing.getAllIndoorBeacons().then(result => {
|
|
348
|
+
var formatted = [];
|
|
349
|
+
result.forEach(item => {
|
|
350
|
+
if (ref !== undefined) {
|
|
351
|
+
if (item.identifier === ref) {
|
|
352
|
+
formatted.push(IndoorBeacon.jsonToObj(item));
|
|
353
|
+
}
|
|
354
|
+
} else {
|
|
355
|
+
formatted.push(IndoorBeacon.jsonToObj(item));
|
|
356
|
+
}
|
|
357
|
+
});
|
|
358
|
+
return Promise.resolve(formatted);
|
|
359
|
+
}).catch(e => {
|
|
360
|
+
return Promise.reject(e);
|
|
361
|
+
});
|
|
362
|
+
} else {
|
|
363
|
+
return PluginGeofencing.getIndoorBeacons(venueID).then(result => {
|
|
364
|
+
var formatted = [];
|
|
365
|
+
result.forEach(item => {
|
|
366
|
+
if (ref !== undefined) {
|
|
367
|
+
if (item.identifier === ref) {
|
|
368
|
+
formatted.push(IndoorBeacon.jsonToObj(item));
|
|
369
|
+
}
|
|
370
|
+
} else {
|
|
371
|
+
formatted.push(IndoorBeacon.jsonToObj(item));
|
|
372
|
+
}
|
|
373
|
+
});
|
|
374
|
+
return Promise.resolve(formatted);
|
|
375
|
+
}).catch(e => {
|
|
376
|
+
return Promise.reject(e);
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* Remove saved POI info
|
|
383
|
+
* @returns promise with A callback that will be called on success or error.
|
|
384
|
+
*/
|
|
385
|
+
function removeIndoorBeacons() {
|
|
386
|
+
return PluginGeofencing.removeIndoorBeacons();
|
|
387
|
+
}
|
|
331
388
|
const WoosmapGeofencing = {
|
|
332
389
|
initialize,
|
|
333
390
|
setWoosmapApiKey,
|
|
@@ -350,7 +407,9 @@ const WoosmapGeofencing = {
|
|
|
350
407
|
removeLocations,
|
|
351
408
|
getPois,
|
|
352
409
|
removePois,
|
|
353
|
-
startCustomTracking
|
|
410
|
+
startCustomTracking,
|
|
411
|
+
getIndoorBeacons,
|
|
412
|
+
removeIndoorBeacons
|
|
354
413
|
};
|
|
355
414
|
export default WoosmapGeofencing;
|
|
356
415
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeEventEmitter","Platform","uuid","PluginGeofencing","Location","Region","Poi","eventEmitter","subscriptionsLocation","subscriptionsRegion","initialize","arg0","setWoosmapApiKey","apiKey","startTracking","trackingProfile","stopTracking","requestPermissions","background","requestBLEPermissions","OS","Promise","resolve","getPermissionsStatus","getBLEPermissionsStatus","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","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, Platform } 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 request the required permissions to collect locations.\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. \n * The plugin will return an object with either one of the messages - BACKGROUND_LOCATION_DENIED, GRANTED, DENIED\n */\nfunction requestBLEPermissions(): Promise<string> {\n if (Platform.OS == 'android'){\n return PluginGeofencing.requestBLEPermissions();\n }\n else{\n return new Promise((resolve) => {\n resolve(\"GRANTED\");\n });\n }\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 * 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 - BACKGROUND_LOCATION_DENIED, GRANTED, DENIED\n */\nfunction getBLEPermissionsStatus(): Promise<string> {\n if (Platform.OS == 'android'){\n return PluginGeofencing.getBLEPermissionsStatus();\n }\n else{\n return new Promise((resolve) => {\n resolve(\"GRANTED\");\n });\n }\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 requestBLEPermissions,\n getPermissionsStatus,\n getBLEPermissionsStatus,\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,kBAAkB,EAAEC,QAAQ,QAAQ,cAAc;AAC3D,OAAOC,IAAI,MAAM,mBAAmB;AACpC,OAAOC,gBAAgB,MAAM,4BAA4B;AACzD,OAAOC,QAAQ,MAAM,qBAAqB;AAC1C,OAAOC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,KAAK,CAAEC,CAAM,IAAK;MACjB,OAAOtC,OAAO,CAACuC,MAAM,CAACD,CAAC,CAAC;IAC1B,CAAC,CAAC;EACN;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA,SAASU,aAAaA,CAAClB,QAAiB,EAAmB;EACzD,IAAIA,QAAQ,IAAI,IAAI,EAAE;IACpB,OAAOhD,gBAAgB,CAACmE,gBAAgB,CAAC,CAAC;EAC5C,CAAC,MAAM;IACL,OAAOnE,gBAAgB,CAACoE,YAAY,CAACpB,QAAQ,CAAC;EAChD;AACF;;AAEA;AACA;AACA;AACA;AACA,SAASqB,eAAeA,CAAA,EAAoB;EAC1C,OAAOrE,gBAAgB,CAACsE,kBAAkB,CAAC,CAAC;AAC9C;;AAEA;AACA;AACA;AACA;AACA,SAASC,UAAUA,CAAA,EAAoB;EACrC,OAAOvE,gBAAgB,CAACwE,aAAa,CAAC,CAAC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,mBAAmBA,CAC1BC,UAAyB,EACzBC,MAAc,EACG;EACjB,OAAO3E,gBAAgB,CAACyE,mBAAmB,CAACC,UAAU,EAAEC,MAAM,CAAC;AACjE;AAWA,MAAMC,iBAAiB,GAAG;EACxBrE,UAAU;EACVE,gBAAgB;EAChBE,aAAa;EACbG,kBAAkB;EAClBE,qBAAqB;EACrBI,oBAAoB;EACpBC,uBAAuB;EACvBR,YAAY;EACZS,aAAa;EACbU,kBAAkB;EAClBO,YAAY;EACZC,iBAAiB;EACjBE,kBAAkB;EAClBC,YAAY;EACZE,SAAS;EACTE,UAAU;EACVmB,aAAa;EACbR,YAAY;EACZW,eAAe;EACfP,OAAO;EACPS,UAAU;EACVE;AACF,CAAC;AAED,eAAeG,iBAAiB"}
|
|
1
|
+
{"version":3,"names":["NativeEventEmitter","Platform","uuid","PluginGeofencing","Location","Region","Poi","IndoorBeacon","eventEmitter","subscriptionsLocation","subscriptionsRegion","initialize","arg0","setWoosmapApiKey","apiKey","startTracking","trackingProfile","stopTracking","requestPermissions","background","requestBLEPermissions","OS","Promise","resolve","getPermissionsStatus","getBLEPermissionsStatus","watchLocation","success","error","watchID","v1","toString","successCallback","result","jsonToObj","addListener","clearLocationWatch","removeAllListeners","clearAllLocationWatch","saved","remove","arg1","undefined","watchRegions","clearRegionsWatch","clearAllRegionsWatch","setSFMCCredentials","setPoiRadius","radius","addRegion","region","getRegions","regionID","getAllRegions","then","formatted","forEach","item","push","catch","e","reject","getLocations","locationID","getAllLocations","getLocation","getPois","poiID","getAllPois","getPoi","removeRegions","removeAllRegions","removeRegion","removeLocations","removeAllLocations","removePois","removeAllPois","startCustomTracking","sourceType","source","getIndoorBeacons","venueID","ref","getAllIndoorBeacons","identifier","removeIndoorBeacons","WoosmapGeofencing"],"sources":["index.tsx"],"sourcesContent":["import { NativeEventEmitter, Platform } 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 IndoorBeacon from './internal/IndoorBeacon';\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 request the required permissions to collect locations.\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.\n * The plugin will return an object with either one of the messages - BACKGROUND_LOCATION_DENIED, GRANTED, DENIED\n */\nfunction requestBLEPermissions(): Promise<string> {\n if (Platform.OS === 'android') {\n return PluginGeofencing.requestBLEPermissions();\n } else {\n return new Promise((resolve) => {\n resolve('GRANTED');\n });\n }\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 * 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 - BACKGROUND_LOCATION_DENIED, GRANTED, DENIED\n */\nfunction getBLEPermissionsStatus(): Promise<string> {\n if (Platform.OS == 'android') {\n return PluginGeofencing.getBLEPermissionsStatus();\n } else {\n return new Promise((resolve) => {\n resolve('GRANTED');\n });\n }\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 arg0.remove();\n //eventEmitter.removeListener('geolocationDidChange', arg0);\n const arg1 = saved[1];\n if (arg1) {\n arg1.remove();\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 arg0.remove();\n //eventEmitter.removeListener('woosmapgeofenceRegionDidChange', arg0);\n const arg1 = saved[1];\n if (arg1) {\n arg1.remove();\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\n/**\n * Retrieve Beacon info for venue\n * @param venueID - Optional venue id\n * @param ref - Optional beacon id return by region event\n * @returns promise with A callback that will be called on success or error.\n */\nfunction getIndoorBeacons(\n venueID?: string,\n ref?: string\n): Promise<IndoorBeacon[]> {\n if (venueID == null) {\n return PluginGeofencing.getAllIndoorBeacons()\n .then((result: any[]) => {\n var formatted: IndoorBeacon[] = [];\n result.forEach((item) => {\n if (ref !== undefined) {\n if (item.identifier === ref) {\n formatted.push(IndoorBeacon.jsonToObj(item));\n }\n } else {\n formatted.push(IndoorBeacon.jsonToObj(item));\n }\n });\n return Promise.resolve(formatted);\n })\n .catch((e: any) => {\n return Promise.reject(e);\n });\n } else {\n return PluginGeofencing.getIndoorBeacons(venueID)\n .then((result: any[]) => {\n var formatted: IndoorBeacon[] = [];\n result.forEach((item) => {\n if (ref !== undefined) {\n if (item.identifier === ref) {\n formatted.push(IndoorBeacon.jsonToObj(item));\n }\n } else {\n formatted.push(IndoorBeacon.jsonToObj(item));\n }\n });\n return Promise.resolve(formatted);\n })\n .catch((e: any) => {\n return Promise.reject(e);\n });\n }\n}\n\n/**\n * Remove saved POI info\n * @returns promise with A callback that will be called on success or error.\n */\nfunction removeIndoorBeacons(): Promise<string> {\n return PluginGeofencing.removeIndoorBeacons();\n}\n\nexport type {\n RegionType,\n GeofenceRegion,\n Region,\n Location,\n Poi,\n ProfileSource,\n IndoorBeacon,\n};\n\nconst WoosmapGeofencing = {\n initialize,\n setWoosmapApiKey,\n startTracking,\n requestPermissions,\n requestBLEPermissions,\n getPermissionsStatus,\n getBLEPermissionsStatus,\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 getIndoorBeacons,\n removeIndoorBeacons,\n};\n\nexport default WoosmapGeofencing;\n"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,QAAQ,QAAQ,cAAc;AAC3D,OAAOC,IAAI,MAAM,mBAAmB;AACpC,OAAOC,gBAAgB,MAAM,4BAA4B;AACzD,OAAOC,QAAQ,MAAM,qBAAqB;AAC1C,OAAOC,MAAM,MAAM,mBAAmB;AACtC,OAAOC,GAAG,MAAM,gBAAgB;AAChC,OAAOC,YAAY,MAAM,yBAAyB;AAOlD,MAAMC,YAAY,GAAG,IAAIR,kBAAkB,CAACG,gBAAgB,CAAC;AAE7D,IAAIM,qBAA0B,GAAG,CAAC,CAAC;AACnC,IAAIC,mBAAwB,GAAG,CAAC,CAAC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,UAAUA,CAACC,IAAU,EAAmB;EAC/C,IAAIA,IAAI,IAAI,IAAI,EAAE;IAChBA,IAAI,GAAG,CAAC,CAAC;EACX;EACA,OAAOT,gBAAgB,CAACQ,UAAU,CAACC,IAAI,CAAC;AAC1C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,gBAAgBA,CAACC,MAAc,EAAmB;EACzD,OAAOX,gBAAgB,CAACU,gBAAgB,CAAC,CAACC,MAAM,CAAC,CAAC;AACpD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,aAAaA,CAACC,eAAuB,EAAmB;EAC/D,OAAOb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