MetaMask detect connection does not detect my mobile MetaMask App

オープン
#57 コメント 21 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
javascript
領域
frontend, web-dev

調査の方向性

detectEthereumProviderのエントリーポイントから開始し、window.ethereumとethereum#initializedイベントを含む、提供されたJavaScriptフローをデスクトップ版およびモバイル版のMetaMaskで再現します。各プラットフォームで返されるproviderを比較し、モバイルでの検出がサポートされているか、文書化された変更が必要かを判断します。動作と次のアクションが確定すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

const detectProv = async () => {
        const provider = await detectEthereumProvider()
        let web3 = new Web3(provider)
        let chainID = await web3.eth.getChainId()
        window.alert(chainID)

        if (window.ethereum) {
            handleEthereum();
        } else {
            window.addEventListener('ethereum#initialized', handleEthereum, {
                once: true,
            });

            // If the event is not dispatched by the end of the timeout,
            // the user probably doesn't have MetaMask installed.
            setTimeout(handleEthereum, 3000); // 3 seconds
        }

        function handleEthereum() {
            const { ethereum } = window;
            if (ethereum && ethereum.isMetaMask) {
                console.log('Ethereum successfully detected!');
                window.alert("detected")
                // Access the decentralized web!
            } else {
                console.log('Please install MetaMask!');
            }
        }
    }

I try to detect my MetaMask application as the provider via a web-site using detect-provider library. In the desktop, it works fine but when I try to detect the provider using the same website and connect it to via my phone, it does not detect any provider. Where am I wrong?

主要言語
JavaScript
スター
238
フォーク
63
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

MetaMask/detect-provider のほかの issue

MetaMask/detect-provider の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。