Hi can anyone help me, I have a problem regarding MetaMask mobile browser, I have a redirect button to open an app in my android phone, I was using <a href="unitydl://mylink">Launch</a>
for my button, it was working in chrome but inside MetaMask mobile browser it doesn’t, does the MetaMask mobile browser supports deep link ?
1 Like
Hello !
Welcome to the MetaMask community!
Give me some time to check your problem
2 Likes
Of course support)
You should declare a device check function if you don’t have one in your code:
function isMobileDevice() {
return "ontouchstart" in window || "onmsgesturechange" in window;
}
And based on the result of its execution, declare the following redirection logic:
<Button
onClick={() => {
if (isMobileDevice()) {
window.open(metamaskAppDeepLink);
} else {
window.open("https://metamask.io/", "_blank");
}
}}
>
Launch
</Button>
Please let me know what results these actions bring to you
6 Likes
Sorry for the terrible
tabulation of the code, at the moment there is only access to a smartphone
2 Likes
Thank you for this !! It worked !! I’m having this problem since 8am today! you save me a day of craziness ! Thank you again you’re the best !
3 Likes
Wonderful! I’m glad I saved your time and nerves
If you want, you can close the topic with the mark solved
3 Likes