Closed aryella-lacerda closed 8 months ago
You can handle the BrowserResult promise for the cancel event, for deeplinking and successful callbacks i have a separate deeplink handler in my code that dismisses it. This is how I have been handling the success and failure situations in my code. Both approaches lead to closing of the browser
You can handle the BrowserResult promise for the cancel event, for deeplinking and successful callbacks i have a separate deeplink handler in my code that dismisses it. This is how I have been handling the success and failure situations in my code. Both approaches lead to closing of the browser
can you attach an example that how you are doing it? any help will be appreciated.
try {
if (await InAppBrowser.isAvailable()) {
const result = await InAppBrowser.open(url, {...});
// when the users presses the cancel/close button
if (result.type === 'cancel') {
onCancel();
}
// when you call the close() method
if (result.type === 'dismiss') {
onDismiss();
}
} else {
Linking.openURL(url);
}
} catch (error) {
console.log(error.message);
}
try { if (await InAppBrowser.isAvailable()) { const result = await InAppBrowser.open(url, {...}); // when the users presses the cancel/close button if (result.type === 'cancel') { onCancel(); } // when you call the close() method if (result.type === 'dismiss') { onDismiss(); } } else { Linking.openURL(url); } } catch (error) { console.log(error.message); }
thanks for the response aryella. i am trying to integrate keycloak login with react native app using inapp-browser. issue is that after opening browser, i can't get any response. only response i get is "type:cancel" when i close the browser. how to close the browser after successful login in inapp-browser. thanks in advance.
how to close the browser after successful login in inapp-browser.
you need to redirect users to the app using deep linking
Hello! Thanks for maintaining this project, it's been very helpful to our team. But we're stuck on a minor issue: is it possible to trigger a callback when the user closes out of the browser? 🤔