UNPKG

@d4l/react-native-wear-connectivity

Version:
29 lines (28 loc) 1.29 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.openRemoteURI = void 0; var _reactNative = require("react-native"); var _index = require("./index"); var _constants = require("./constants"); const UNHANDLED_CALLBACK = 'The openRemoteURI function was called without a callback function. '; const UNHANDLED_CALLBACK_REPLY = 'The callback function was invoked with the uri: '; const UNHANDLED_CALLBACK_ERROR = 'The callback function was invoked with the error: '; const defaultReplyCb = reply => { console.log(UNHANDLED_CALLBACK + UNHANDLED_CALLBACK_REPLY, reply); }; const defaultErrCb = err => { console.warn(UNHANDLED_CALLBACK + UNHANDLED_CALLBACK_ERROR, err); }; const openRemoteURI = (uri, nodeId, cb, errCb) => { const callbackWithDefault = cb ?? defaultReplyCb; const errCbWithDefault = errCb ?? defaultErrCb; return _index.WearConnectivity.openRemoteURI(uri, nodeId, callbackWithDefault, errCbWithDefault); }; const openRemoteURIMock = () => console.warn(_constants.LIBRARY_NAME + 'intent' + _constants.IOS_NOT_SUPPORTED_WARNING); let openRemoteURIExport = exports.openRemoteURI = openRemoteURIMock; if (_reactNative.Platform.OS !== 'ios') { exports.openRemoteURI = openRemoteURIExport = openRemoteURI; } //# sourceMappingURL=intent.js.map