Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
],
)
})
if (!allowNonSecure) {
return
}
}
} catch {
Alert.alert('The provided URL is not supported')
return
}
if (await InAppBrowser.isAvailable()) {
try {
const response: any = await InAppBrowser.openAuth(authURL, 'berty://', {
dismissButtonStyle: 'cancel',
readerMode: false,
modalPresentationStyle: 'pageSheet',
modalEnabled: true,
showTitle: true,
enableDefaultShare: false,
ephemeralWebSession: true,
// forceCloseOnRedirection: false,
})
if (!response.url) {
return
}
const responseURL = response.url
await ctx.protocolClient?.authServiceCompleteFlow({
async tryDeepLinking() {
const loginUrl = 'https://proyecto26.github.io/react-native-inappbrowser/';
const redirectUrl = this.getDeepLink();
const url = `${loginUrl}?redirect_url=${encodeURIComponent(redirectUrl)}`;
try {
if (await InAppBrowser.isAvailable()) {
const result = await InAppBrowser.openAuth(url, redirectUrl, {
showTitle: true,
toolbarColor: '#6200EE',
secondaryToolbarColor: 'black',
enableUrlBarHiding: true,
enableDefaultShare: true
});
await this.sleep(800);
Alert.alert('Response', JSON.stringify(result));
} else {
Alert.alert('InAppBrowser is not supported :/');
}
} catch (error) {
Alert.alert('Something’s wrong with the app :(');
}
}