3395a3a0eba2003c775e60968796485f.json
18.4 KB
{"ast":null,"code":"var _interopRequireDefault=require(\"@babel/runtime/helpers/interopRequireDefault\");Object.defineProperty(exports,\"__esModule\",{value:true});exports.getCustomTabsSupportingBrowsersAsync=getCustomTabsSupportingBrowsersAsync;exports.warmUpAsync=warmUpAsync;exports.mayInitWithUrlAsync=mayInitWithUrlAsync;exports.coolDownAsync=coolDownAsync;exports.openBrowserAsync=openBrowserAsync;exports.dismissBrowser=dismissBrowser;exports.openAuthSessionAsync=openAuthSessionAsync;exports.dismissAuthSession=dismissAuthSession;var _regenerator=_interopRequireDefault(require(\"@babel/runtime/regenerator\"));var _AppState=_interopRequireDefault(require(\"react-native-web/dist/exports/AppState\"));var _Linking=_interopRequireDefault(require(\"react-native-web/dist/exports/Linking\"));var _Platform=_interopRequireDefault(require(\"react-native-web/dist/exports/Platform\"));var _core=require(\"@unimodules/core\");var _ExpoWebBrowser=_interopRequireDefault(require(\"./ExpoWebBrowser\"));var emptyCustomTabsPackages={defaultBrowserPackage:undefined,preferredBrowserPackage:undefined,browserPackages:[],servicePackages:[]};function getCustomTabsSupportingBrowsersAsync(){return _regenerator.default.async(function getCustomTabsSupportingBrowsersAsync$(_context){while(1){switch(_context.prev=_context.next){case 0:if(_ExpoWebBrowser.default.getCustomTabsSupportingBrowsersAsync){_context.next=2;break;}throw new _core.UnavailabilityError('WebBrowser','getCustomTabsSupportingBrowsersAsync');case 2:if(!(_Platform.default.OS!=='android')){_context.next=6;break;}return _context.abrupt(\"return\",emptyCustomTabsPackages);case 6:_context.next=8;return _regenerator.default.awrap(_ExpoWebBrowser.default.getCustomTabsSupportingBrowsersAsync());case 8:return _context.abrupt(\"return\",_context.sent);case 9:case\"end\":return _context.stop();}}});}function warmUpAsync(browserPackage){return _regenerator.default.async(function warmUpAsync$(_context2){while(1){switch(_context2.prev=_context2.next){case 0:if(_ExpoWebBrowser.default.warmUpAsync){_context2.next=2;break;}throw new _core.UnavailabilityError('WebBrowser','warmUpAsync');case 2:if(!(_Platform.default.OS!=='android')){_context2.next=6;break;}return _context2.abrupt(\"return\",{});case 6:_context2.next=8;return _regenerator.default.awrap(_ExpoWebBrowser.default.warmUpAsync(browserPackage));case 8:return _context2.abrupt(\"return\",_context2.sent);case 9:case\"end\":return _context2.stop();}}});}function mayInitWithUrlAsync(url,browserPackage){return _regenerator.default.async(function mayInitWithUrlAsync$(_context3){while(1){switch(_context3.prev=_context3.next){case 0:if(_ExpoWebBrowser.default.mayInitWithUrlAsync){_context3.next=2;break;}throw new _core.UnavailabilityError('WebBrowser','mayInitWithUrlAsync');case 2:if(!(_Platform.default.OS!=='android')){_context3.next=6;break;}return _context3.abrupt(\"return\",{});case 6:_context3.next=8;return _regenerator.default.awrap(_ExpoWebBrowser.default.mayInitWithUrlAsync(url,browserPackage));case 8:return _context3.abrupt(\"return\",_context3.sent);case 9:case\"end\":return _context3.stop();}}});}function coolDownAsync(browserPackage){return _regenerator.default.async(function coolDownAsync$(_context4){while(1){switch(_context4.prev=_context4.next){case 0:if(_ExpoWebBrowser.default.coolDownAsync){_context4.next=2;break;}throw new _core.UnavailabilityError('WebBrowser','coolDownAsync');case 2:if(!(_Platform.default.OS!=='android')){_context4.next=6;break;}return _context4.abrupt(\"return\",{});case 6:_context4.next=8;return _regenerator.default.awrap(_ExpoWebBrowser.default.coolDownAsync(browserPackage));case 8:return _context4.abrupt(\"return\",_context4.sent);case 9:case\"end\":return _context4.stop();}}});}function openBrowserAsync(url){var browserParams,_args5=arguments;return _regenerator.default.async(function openBrowserAsync$(_context5){while(1){switch(_context5.prev=_context5.next){case 0:browserParams=_args5.length>1&&_args5[1]!==undefined?_args5[1]:{};if(_ExpoWebBrowser.default.openBrowserAsync){_context5.next=3;break;}throw new _core.UnavailabilityError('WebBrowser','openBrowserAsync');case 3:_context5.next=5;return _regenerator.default.awrap(_ExpoWebBrowser.default.openBrowserAsync(url,browserParams));case 5:return _context5.abrupt(\"return\",_context5.sent);case 6:case\"end\":return _context5.stop();}}});}function dismissBrowser(){if(!_ExpoWebBrowser.default.dismissBrowser){throw new _core.UnavailabilityError('WebBrowser','dismissBrowser');}_ExpoWebBrowser.default.dismissBrowser();}function openAuthSessionAsync(url,redirectUrl){return _regenerator.default.async(function openAuthSessionAsync$(_context6){while(1){switch(_context6.prev=_context6.next){case 0:if(!_authSessionIsNativelySupported()){_context6.next=6;break;}if(_ExpoWebBrowser.default.openAuthSessionAsync){_context6.next=3;break;}throw new _core.UnavailabilityError('WebBrowser','openAuthSessionAsync');case 3:return _context6.abrupt(\"return\",_ExpoWebBrowser.default.openAuthSessionAsync(url,redirectUrl));case 6:return _context6.abrupt(\"return\",_openAuthSessionPolyfillAsync(url,redirectUrl));case 7:case\"end\":return _context6.stop();}}});}function dismissAuthSession(){if(_authSessionIsNativelySupported()){if(!_ExpoWebBrowser.default.dismissAuthSession){throw new _core.UnavailabilityError('WebBrowser','dismissAuthSession');}_ExpoWebBrowser.default.dismissAuthSession();}else{if(!_ExpoWebBrowser.default.dismissBrowser){throw new _core.UnavailabilityError('WebBrowser','dismissAuthSession');}_ExpoWebBrowser.default.dismissBrowser();}}function _authSessionIsNativelySupported(){if(_Platform.default.OS==='android'){return false;}var versionNumber=parseInt(String(_Platform.default.Version),10);return versionNumber>=11;}var _redirectHandler=null;var _onWebBrowserCloseAndroid=null;function _onAppStateChangeAndroid(state){if(state==='active'&&_onWebBrowserCloseAndroid){_onWebBrowserCloseAndroid();}}function _openBrowserAndWaitAndroidAsync(startUrl){var appStateChangedToActive,result,_ref,type;return _regenerator.default.async(function _openBrowserAndWaitAndroidAsync$(_context7){while(1){switch(_context7.prev=_context7.next){case 0:appStateChangedToActive=new Promise(function(resolve){_onWebBrowserCloseAndroid=resolve;_AppState.default.addEventListener('change',_onAppStateChangeAndroid);});result={type:'cancel'};_context7.next=4;return _regenerator.default.awrap(openBrowserAsync(startUrl));case 4:_ref=_context7.sent;type=_ref.type;if(!(type==='opened')){_context7.next=10;break;}_context7.next=9;return _regenerator.default.awrap(appStateChangedToActive);case 9:result={type:'dismiss'};case 10:_AppState.default.removeEventListener('change',_onAppStateChangeAndroid);_onWebBrowserCloseAndroid=null;return _context7.abrupt(\"return\",result);case 13:case\"end\":return _context7.stop();}}});}function _openAuthSessionPolyfillAsync(startUrl,returnUrl){return _regenerator.default.async(function _openAuthSessionPolyfillAsync$(_context8){while(1){switch(_context8.prev=_context8.next){case 0:if(!_redirectHandler){_context8.next=2;break;}throw new Error(\"The WebBrowser's auth session is in an invalid state with a redirect handler set when it should not be\");case 2:if(!_onWebBrowserCloseAndroid){_context8.next=4;break;}throw new Error(\"WebBrowser is already open, only one can be open at a time\");case 4:_context8.prev=4;if(!(_Platform.default.OS==='android')){_context8.next=11;break;}_context8.next=8;return _regenerator.default.awrap(Promise.race([_openBrowserAndWaitAndroidAsync(startUrl),_waitForRedirectAsync(returnUrl)]));case 8:return _context8.abrupt(\"return\",_context8.sent);case 11:_context8.next=13;return _regenerator.default.awrap(Promise.race([openBrowserAsync(startUrl),_waitForRedirectAsync(returnUrl)]));case 13:return _context8.abrupt(\"return\",_context8.sent);case 14:_context8.prev=14;if(_ExpoWebBrowser.default.dismissBrowser){_ExpoWebBrowser.default.dismissBrowser();}_stopWaitingForRedirect();return _context8.finish(14);case 18:case\"end\":return _context8.stop();}}},null,null,[[4,,14,18]]);}function _stopWaitingForRedirect(){if(!_redirectHandler){throw new Error(\"The WebBrowser auth session is in an invalid state with no redirect handler when one should be set\");}_Linking.default.removeEventListener('url',_redirectHandler);_redirectHandler=null;}function _waitForRedirectAsync(returnUrl){return new Promise(function(resolve){_redirectHandler=function _redirectHandler(event){if(event.url.startsWith(returnUrl)){resolve({url:event.url,type:'success'});}};_Linking.default.addEventListener('url',_redirectHandler);});}","map":{"version":3,"sources":["../src/WebBrowser.ts"],"names":[],"mappings":"u1BACA,sCACA,wEAcA,GAAM,CAAA,uBAAuB,CAA8B,CACzD,qBAAqB,CAAE,SADkC,CAEzD,uBAAuB,CAAE,SAFgC,CAGzD,e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ACnC,OAAO,CAAC,CAAE,GAAG,CAAE,KAAK,CAAC,GAAb,CAAkB,IAAI,CAAE,SAAxB,CAAD,CAAP,CACD,CACF,CAJD,CAMA,iBAAQ,gBAAR,CAAyB,KAAzB,CAAgC,gBAAhC,EACD,CARM,CAAP,CASD","sourcesContent":["import { AppState, Linking, Platform, AppStateStatus } from 'react-native';\nimport { UnavailabilityError } from '@unimodules/core';\nimport ExponentWebBrowser from './ExpoWebBrowser';\n\nimport {\n RedirectEvent,\n OpenBrowserOptions,\n AuthSessionResult,\n CustomTabsBrowsersResults,\n BrowserResult,\n RedirectResult,\n MayInitWithUrlResult,\n WarmUpResult,\n CoolDownResult,\n} from './WebBrowser.types';\n\nconst emptyCustomTabsPackages: CustomTabsBrowsersResults = {\n defaultBrowserPackage: undefined,\n preferredBrowserPackage: undefined,\n browserPackages: [],\n servicePackages: [],\n};\n\nexport async function getCustomTabsSupportingBrowsersAsync(): Promise<CustomTabsBrowsersResults> {\n if (!ExponentWebBrowser.getCustomTabsSupportingBrowsersAsync) {\n throw new UnavailabilityError('WebBrowser', 'getCustomTabsSupportingBrowsersAsync');\n }\n if (Platform.OS !== 'android') {\n return emptyCustomTabsPackages;\n } else {\n return await ExponentWebBrowser.getCustomTabsSupportingBrowsersAsync();\n }\n}\n\nexport async function warmUpAsync(browserPackage?: string): Promise<WarmUpResult> {\n if (!ExponentWebBrowser.warmUpAsync) {\n throw new UnavailabilityError('WebBrowser', 'warmUpAsync');\n }\n if (Platform.OS !== 'android') {\n return {};\n } else {\n return await ExponentWebBrowser.warmUpAsync(browserPackage);\n }\n}\n\nexport async function mayInitWithUrlAsync(\n url: string,\n browserPackage?: string\n): Promise<MayInitWithUrlResult> {\n if (!ExponentWebBrowser.mayInitWithUrlAsync) {\n throw new UnavailabilityError('WebBrowser', 'mayInitWithUrlAsync');\n }\n if (Platform.OS !== 'android') {\n return {};\n } else {\n return await ExponentWebBrowser.mayInitWithUrlAsync(url, browserPackage);\n }\n}\n\nexport async function coolDownAsync(browserPackage?: string): Promise<CoolDownResult> {\n if (!ExponentWebBrowser.coolDownAsync) {\n throw new UnavailabilityError('WebBrowser', 'coolDownAsync');\n }\n if (Platform.OS !== 'android') {\n return {};\n } else {\n return await ExponentWebBrowser.coolDownAsync(browserPackage);\n }\n}\n\nexport async function openBrowserAsync(\n url: string,\n browserParams: OpenBrowserOptions = {}\n): Promise<BrowserResult> {\n if (!ExponentWebBrowser.openBrowserAsync) {\n throw new UnavailabilityError('WebBrowser', 'openBrowserAsync');\n }\n return await ExponentWebBrowser.openBrowserAsync(url, browserParams);\n}\n\nexport function dismissBrowser(): void {\n if (!ExponentWebBrowser.dismissBrowser) {\n throw new UnavailabilityError('WebBrowser', 'dismissBrowser');\n }\n ExponentWebBrowser.dismissBrowser();\n}\n\nexport async function openAuthSessionAsync(\n url: string,\n redirectUrl: string\n): Promise<AuthSessionResult> {\n if (_authSessionIsNativelySupported()) {\n if (!ExponentWebBrowser.openAuthSessionAsync) {\n throw new UnavailabilityError('WebBrowser', 'openAuthSessionAsync');\n }\n return ExponentWebBrowser.openAuthSessionAsync(url, redirectUrl);\n } else {\n return _openAuthSessionPolyfillAsync(url, redirectUrl);\n }\n}\n\nexport function dismissAuthSession(): void {\n if (_authSessionIsNativelySupported()) {\n if (!ExponentWebBrowser.dismissAuthSession) {\n throw new UnavailabilityError('WebBrowser', 'dismissAuthSession');\n }\n ExponentWebBrowser.dismissAuthSession();\n } else {\n if (!ExponentWebBrowser.dismissBrowser) {\n throw new UnavailabilityError('WebBrowser', 'dismissAuthSession');\n }\n ExponentWebBrowser.dismissBrowser();\n }\n}\n\n/* iOS <= 10 and Android polyfill for SFAuthenticationSession flow */\n\nfunction _authSessionIsNativelySupported(): boolean {\n if (Platform.OS === 'android') {\n return false;\n }\n\n const versionNumber = parseInt(String(Platform.Version), 10);\n return versionNumber >= 11;\n}\n\nlet _redirectHandler: ((event: RedirectEvent) => void) | null = null;\n\n/*\n * openBrowserAsync on Android doesn't wait until closed, so we need to polyfill\n * it with AppState\n */\n\n// Store the `resolve` function from a Promise to fire when the AppState\n// returns to active\nlet _onWebBrowserCloseAndroid: null | (() => void) = null;\n\nfunction _onAppStateChangeAndroid(state: AppStateStatus) {\n if (state === 'active' && _onWebBrowserCloseAndroid) {\n _onWebBrowserCloseAndroid();\n }\n}\n\nasync function _openBrowserAndWaitAndroidAsync(startUrl: string): Promise<BrowserResult> {\n let appStateChangedToActive = new Promise(resolve => {\n _onWebBrowserCloseAndroid = resolve;\n AppState.addEventListener('change', _onAppStateChangeAndroid);\n });\n\n let result: BrowserResult = { type: 'cancel' };\n let { type } = await openBrowserAsync(startUrl);\n\n if (type === 'opened') {\n await appStateChangedToActive;\n result = { type: 'dismiss' };\n }\n\n AppState.removeEventListener('change', _onAppStateChangeAndroid);\n _onWebBrowserCloseAndroid = null;\n return result;\n}\n\nasync function _openAuthSessionPolyfillAsync(\n startUrl: string,\n returnUrl: string\n): Promise<AuthSessionResult> {\n if (_redirectHandler) {\n throw new Error(\n `The WebBrowser's auth session is in an invalid state with a redirect handler set when it should not be`\n );\n }\n\n if (_onWebBrowserCloseAndroid) {\n throw new Error(`WebBrowser is already open, only one can be open at a time`);\n }\n\n try {\n if (Platform.OS === 'android') {\n return await Promise.race([\n _openBrowserAndWaitAndroidAsync(startUrl),\n _waitForRedirectAsync(returnUrl),\n ]);\n } else {\n return await Promise.race([openBrowserAsync(startUrl), _waitForRedirectAsync(returnUrl)]);\n }\n } finally {\n // We can't dismiss the browser on Android, only call this when it's available.\n // Users on Android need to manually press the 'x' button in Chrome Custom Tabs, sadly.\n if (ExponentWebBrowser.dismissBrowser) {\n ExponentWebBrowser.dismissBrowser();\n }\n\n _stopWaitingForRedirect();\n }\n}\n\nfunction _stopWaitingForRedirect() {\n if (!_redirectHandler) {\n throw new Error(\n `The WebBrowser auth session is in an invalid state with no redirect handler when one should be set`\n );\n }\n\n Linking.removeEventListener('url', _redirectHandler);\n _redirectHandler = null;\n}\n\nfunction _waitForRedirectAsync(returnUrl: string): Promise<RedirectResult> {\n return new Promise(resolve => {\n _redirectHandler = (event: RedirectEvent) => {\n if (event.url.startsWith(returnUrl)) {\n resolve({ url: event.url, type: 'success' });\n }\n };\n\n Linking.addEventListener('url', _redirectHandler);\n });\n}\n"],"sourceRoot":""},"metadata":{},"sourceType":"script"}