Loading...
Use these buttons to test different scenarios:
Test the library with different simulated in-app browsers:
import InAppBrowserEscaper, { InAppBrowserDetector } from '@jhrunning/inappbrowserescaper';
// Check if user is in an in-app browser
if (InAppBrowserDetector.isInAppBrowser()) {
// Escape the in-app browser
InAppBrowserEscaper.escape();
}
InAppBrowserEscaper.escape({
message: 'For the best experience, please open this in your browser',
buttonText: 'Open in Browser',
showModal: true
});
const browserInfo = InAppBrowserDetector.analyze();
if (browserInfo.appName === 'instagram') {
// Calling escape() without showModal will auto-redirect
InAppBrowserEscaper.escape();
}
// Redirect to a specific URL instead of current page
InAppBrowserEscaper.escape({
fallbackUrl: 'https://jhrun.com',
showModal: true,
buttonText: 'Continue to Site'
});
// Auto-redirect to app store or landing page
InAppBrowserEscaper.escape({
fallbackUrl: 'https://apps.apple.com/app/your-app',
message: 'Get the best experience with our mobile app!'
// showModal: false is default, so it will auto-redirect
});