expo-web-browser
Advanced tools
Comparing version 8.1.0 to 8.1.1
@@ -109,3 +109,12 @@ import { UnavailabilityError } from '@unimodules/core'; | ||
let _onWebBrowserCloseAndroid = null; | ||
// If the initial AppState.currentState is null, we assume that the first call to | ||
// AppState#change event is not actually triggered by a real change, | ||
// is triggered instead by the bridge capturing the current state | ||
// (https://facebook.github.io/react-native/docs/appstate#basic-usage) | ||
let _isAppStateAvailable = AppState.currentState !== null; | ||
function _onAppStateChangeAndroid(state) { | ||
if (!_isAppStateAvailable) { | ||
_isAppStateAvailable = true; | ||
return; | ||
} | ||
if (state === 'active' && _onWebBrowserCloseAndroid) { | ||
@@ -116,3 +125,3 @@ _onWebBrowserCloseAndroid(); | ||
async function _openBrowserAndWaitAndroidAsync(startUrl, browserParams = {}) { | ||
let appStateChangedToActive = new Promise(resolve => { | ||
const appStateChangedToActive = new Promise(resolve => { | ||
_onWebBrowserCloseAndroid = resolve; | ||
@@ -122,3 +131,3 @@ AppState.addEventListener('change', _onAppStateChangeAndroid); | ||
let result = { type: 'cancel' }; | ||
let { type } = await openBrowserAsync(startUrl, browserParams); | ||
const { type } = await openBrowserAsync(startUrl, browserParams); | ||
if (type === 'opened') { | ||
@@ -125,0 +134,0 @@ await appStateChangedToActive; |
{ | ||
"name": "expo-web-browser", | ||
"version": "8.1.0", | ||
"version": "8.1.1", | ||
"description": "Provides access to the system's web browser and supports handling redirects. On iOS, it uses SFSafariViewController or SFAuthenticationSession, depending on the method you call, and on Android it uses ChromeCustomTabs. As of iOS 11, SFSafariViewController no longer shares cookies with the Safari, so if you are using WebBrowser for authentication you will want to use WebBrowser.openAuthSessionAsync, and if you just want to open a webpage (such as your app privacy policy), then use WebBrowser.openBrowserAsync.", | ||
@@ -44,3 +44,3 @@ "main": "build/WebBrowser.js", | ||
}, | ||
"gitHead": "3ad68bbd9847ebc8a55272c263b17d998a92f64f" | ||
"gitHead": "2f1fb3daa49eca6b03e903a45db312bbfe3e4b5c" | ||
} |
@@ -152,3 +152,13 @@ import { UnavailabilityError } from '@unimodules/core'; | ||
// If the initial AppState.currentState is null, we assume that the first call to | ||
// AppState#change event is not actually triggered by a real change, | ||
// is triggered instead by the bridge capturing the current state | ||
// (https://facebook.github.io/react-native/docs/appstate#basic-usage) | ||
let _isAppStateAvailable: boolean = AppState.currentState !== null; | ||
function _onAppStateChangeAndroid(state: AppStateStatus) { | ||
if (!_isAppStateAvailable) { | ||
_isAppStateAvailable = true; | ||
return; | ||
} | ||
if (state === 'active' && _onWebBrowserCloseAndroid) { | ||
@@ -163,3 +173,3 @@ _onWebBrowserCloseAndroid(); | ||
): Promise<WebBrowserResult> { | ||
let appStateChangedToActive = new Promise(resolve => { | ||
const appStateChangedToActive = new Promise(resolve => { | ||
_onWebBrowserCloseAndroid = resolve; | ||
@@ -170,3 +180,3 @@ AppState.addEventListener('change', _onAppStateChangeAndroid); | ||
let result: WebBrowserResult = { type: 'cancel' }; | ||
let { type } = await openBrowserAsync(startUrl, browserParams); | ||
const { type } = await openBrowserAsync(startUrl, browserParams); | ||
@@ -173,0 +183,0 @@ if (type === 'opened') { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
69883
605
0