web3-react icon indicating copy to clipboard operation
web3-react copied to clipboard

isMobile()

Open yansusanto opened this issue 3 years ago • 2 comments

Has anyone got the working sample of how to properly activate connection on mobile browser using deep link?


async function connect() {
    try {
	await activate(injected);
    } catch (ex) {
        console.log(ex);
    }
}

if(isMobile()){
    const dappUrl = 'xxxx.netlify.app'
    const metamaskAppDeepLink = "https://metamask.app.link/dapp/" + dappUrl
    return (

    )
}

Just couldn't wrap my head around it. Thank you.

yansusanto avatar May 19 '22 11:05 yansusanto

@Donovan043 Well, no I'm using Web3-react to connect to metamask which works on browser with metamask extension but on mobile browser without the extension, it will not work.

I'm just trying to find if anyone has ever done deeplinking to connect to metamask.

yansusanto avatar May 19 '22 12:05 yansusanto

@yansusanto Am not quite sure about that but you can do a brief research on it and hopefully find your answer.

Donovan043 avatar May 19 '22 12:05 Donovan043