Describe the bug
I can’t login using Metamask on mobile devices with the no-modal SDK
To Reproduce
Steps to reproduce the behavior:
- Clone the demo web3auth-web/demo/react-app-no-modal at master · Web3Auth/web3auth-web · GitHub
- Replace the default OpenLogin and WalletConnectV1 adapter with Metamask adapter
....
const init = async () => {
try {
const web3auth = new Web3AuthNoModal({
clientId,
chainConfig: {
chainNamespace: CHAIN_NAMESPACES.EIP155,
},
web3AuthNetwork: "testnet",
});
setWeb3auth(web3auth);
web3auth.configureAdapter(
new MetamaskAdapter({
web3AuthNetwork: "testnet",
chainConfig: {
chainNamespace: CHAIN_NAMESPACES.EIP155,
chainId: "0x1",
rpcTarget: "https://rpc.ankr.com/eth", // This is the public RPC we have added, please pass on your own endpoint while creating an app
},
})
);
....
const login = async () => {
try {
if (!web3auth) {
uiConsole("web3auth not initialized yet");
return;
}
const web3authProvider = await web3auth.connectTo(WALLET_ADAPTERS.METAMASK);
.....
- Run the project locally and access it on mobile device using router provided IP e.g 192.168.0.3:3000
Expected behavior
Able to login with metamask (similar to modal sdk behavior)
Screenshots
Device Info (please complete the following information):
- Device: [e.g. iPhoneSE2]
- OS: [iOS 15]
- Browser [safari, brave]
Additional context
It works in the desktop browser (chrome)