Metamask on板上/安装重定向铬扩展/移动

发布于 2025-01-24 22:47:06 字数 536 浏览 2 评论 0原文

在用户安装移动应用程序 / Chrome扩展程序后,是否有一种方法可以强制 /告诉MetAmask将其重定向到特定页面。

我已经使用了MetAmask DeepLink /入职库,但根本没有重定向。 当前的过程是以下 在桌面上:

1/客户到达页面询问ETH帐户,入职库检测是否安装了MetAmask

2/如果未安装MetAmask,inboarding lib将用户重定向到另一个标签

3/一旦完成的注册过程,请将用户重定向到Chrome Store Extension,如果完成了,用户在此Chrome扩展页面中被“卡住”,他需要独自访问选项卡,询问他

在移动设备

1/客户到达页面上的ADRESS询问ETH帐户,入职库检测是否安装了MetAmask

2/是否安装了MetAmask ,我将用户重定向到MetAmask Deeplink,将他重定向到Android Store

3/一旦注册过程完成,用户就会在应用程序上“卡住”,他需要亲自访问Tab询问他的Adress

。在这两个过程上添加步骤3上的重定向的一种方法?

Is there a way to force / tell metamask to redirect to a specific page after the user has installed mobile app / chrome extension.

I already use metamask deeplink / onboarding library but there's no redirect at all.
The current process is the following
On desktop:

1/ The customer reach a page asking a eth account, onboarding library detect if metamask is installed

2/ If no metamask installed, onboarding lib redirect the user to chrome store extension in another tab

3/ Once the registration process if finished, user is "stucked" in this chrome extension page, and he need to go by himself to the tab asking his adress

On mobile

1/ Customer reach a page asking a eth account, onboarding library detect if metamask is installed

2/ If no metamask installed, i redirect the user to a metamask deeplink, which redirect him to the android store

3/ Once the registration process if finished, user is "stucked" on the app, and he need to go by himself to the tab asking his adress

Is there a way to add a redirection on step 3 for both process ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

风吹雨成花 2025-01-31 22:47:06
const dappUrl = "adljflajf.com"; // TODO enter your dapp URL. 
// For example: https://uniswap.exchange. (don't enter the "https://")
let metamaskAppDeepLink = "https://metamask.app.link/dapp/" + dappUrl;

window.open(metamaskAppDeepLink)

////您需要使用用户互动来执行此操作,或者您获得弹出block ////

这样的sweetAlert

import Swal from 'sweetalert2';

Swal.fire({
    title: 'changing to mobile',
    text: "you are open this dapp from a mobile device",
    icon: 'warning',
    showCancelButton: true,
    confirmButtonColor: '#3085d6',
    cancelButtonColor: '#d33',
    confirmButtonText: 'open in metamask'
    }).then((result) => {
       if (result.isConfirmed) {
          Swal.fire(
            'now click on metamask!',
            'continue on metamask.',
            'success'
          ).then( window.open(metamaskAppDeepLink));
       }else{(window.location.reload())}
    })

对其他步骤进行相同的操作

const dappUrl = "adljflajf.com"; // TODO enter your dapp URL. 
// For example: https://uniswap.exchange. (don't enter the "https://")
let metamaskAppDeepLink = "https://metamask.app.link/dapp/" + dappUrl;

window.open(metamaskAppDeepLink)

////you need to do this with user interaction or you get pop up block////

Use sweetalert like this

import Swal from 'sweetalert2';

Swal.fire({
    title: 'changing to mobile',
    text: "you are open this dapp from a mobile device",
    icon: 'warning',
    showCancelButton: true,
    confirmButtonColor: '#3085d6',
    cancelButtonColor: '#d33',
    confirmButtonText: 'open in metamask'
    }).then((result) => {
       if (result.isConfirmed) {
          Swal.fire(
            'now click on metamask!',
            'continue on metamask.',
            'success'
          ).then( window.open(metamaskAppDeepLink));
       }else{(window.location.reload())}
    })

do the same for other steps

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文