1

I'm facing a challenge with my Next.js-based payment page and could use some help. Here's the situation:

I have a QR code that links to my payment page built with Next.js. When users scan this QR code using various payment apps, it opens in the in-app browser of those apps. I want to redirect users from the in-app browser to their device's default browser (Safari for iOS, Chrome for Android).

What I've done so far:

I've successfully implemented detection for whether the page is opened in an in-app browser. I can also detect the type of device (iOS or Android).

The problem: I can't seem to force the page to open in the default browser. I've tried methods like:

window.open("", "_blank")
window.location.href = url

But these aren't working as expected in the in-app browser context. What I need: A reliable method to redirect from the in-app browser to the default browser on both iOS and Android devices. Has anyone encountered a similar issue or knows of a solution that works across different in-app browsers? Any insights or code examples would be greatly appreciated. Thank you in advance for your help!

1 Answer 1

0

This behavior is not controlled by you, it is controlled by the device and the app opening the link and the user preferences, so there isn't a way to do that

however, you might try to display a notification or a message that reminds the user to open in chrome or other browser

Sign up to request clarification or add additional context in comments.

3 Comments

Website like chumbak.com does that. if you open their instagram account and click on the link in their bio. it opens in the in-app browser and then redirects to the default browser.
what phone do you have? there are some workarounds that works in older phones, but doesn't work on most modern phones (idk about IOS, but at least for android) I just tried the website u mentioned using my phone Samsung s9+, android 10, and it's not working
Do we find a solution for this issue?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.