stopGeolocation.js 2.0 KB

1
  1. "use strict";exports.__esModule=!0,exports.default=stopGeolocation;var _invoker=_interopRequireWildcard(require("./invoker"));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var o=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function(e){return e?t:o})(e)}function _interopRequireWildcard(e,o){if(!o&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(o);if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=r?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}return n.default=e,t&&t.set(e,n),n}function stopGeolocationHandler(e,o){var t=o.resolve,n=o.reject,r=o.containerType,i=o.platformType,a=o.appType,l=o.context;if(r){var u=function(o){_invoker.default.removeContinuesEvent(e.sceneId),_invoker.default.handleBridgeResponse(o,t,n)},s=function(o){_invoker.default.removeContinuesEvent(e.sceneId),_invoker.default.handleBridgeResponse(o,t,n)};a===_invoker.API_INVOKER_TYPE.MINI_APP?l&&l({m:"taurus.common.stopGeolocation",args:e,onSuccess:u,onFail:s}):i===_invoker.PLATFORM_TYPE_ENUM.ANDROID?l&&l(u,s,"taurus.common","stopGeolocation",e):i===_invoker.PLATFORM_TYPE_ENUM.IOS&&l.callHandler("taurus.common.stopGeolocation",Object.assign({},e),(function(o){_invoker.default.removeContinuesEvent(e.sceneId),_invoker.default.handleBridgeResponse(o,t,n)}))}else l&&l.call("stopGeolocation",e,(function(o){_invoker.default.removeContinuesEvent(e.sceneId),_invoker.default.handleBridgeResponse(o,t,n)}))}function stopGeolocation(e){return _invoker.default.invoke("stopGeolocation",e)}_invoker.default.registerAPI("stopGeolocation",{mobile:stopGeolocationHandler,mini:stopGeolocationHandler}),stopGeolocation.version={android:"1.3.2",ios:"1.3.2"},module.exports=exports.default,module.exports.default=exports.default;