-
Notifications
You must be signed in to change notification settings - Fork 611
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connecting on mobile v2 #2058
Comments
@weber77 Seems to be a WalletConnect issue. Can you check if you've added your preview link to the "Allowed Domains" section in the WalletConnect dashboard ? ![]() |
Hey @weber77 It's working after allow domain. But new issue. When i click button that call metamask action, No action at metamask. Need another configuration? |
same with me no action at MM |
@sniper365 Are you saying that whenever you try to connect with MetaMask it doesn't do anything or it's not prompting you to connect to the dApp ? Are you able to show any console errors ? |
@magiziz First. MetaMask doesn't do anything when I call action after connect. |
@sniper365 Can you share a minimal reproducible example ? |
@weber77 Seems to work for me since i use my own
Don't use that in production, i'm just trying to see if you have configured everything in WalletConnect dashboard. Also are you using any VPN's ? |
Yes, I configured projectId correctly and verified on the walletconnect |
I used it but it still doesn't work. Here's the repo Screen_Recording_20240625_161013_MetaMask.mp4 |
@magiziz @ I followed wagmi ssr guide e.g |
@sniper365 The reason this might be a WalletConnect issue is because you're not being deep linked correctly into the MetaMask app and we use WalletConnect to initiate the deep links. You also mentioned that you use VPN ? Can you describe more where the VPN is pointed at ? Also can you show the console errors you get once trying to connect with MetaMask ? |
VPN location is Germany |
@sniper365 Are you able to fully turn off your VPN and try again ? Make sure to first disconnect in MetaMask and try again using this project id Also it would be helpful if you can share any console errors you get on mobile. You can use any android simulators for that. |
Everything seem to work just find when using default configs. Without configuring urls export const rainbowConfig = getDefaultConfig({
appName: 'PaalX Sniper🎯',
projectId: PROJECT_ID,
chains: [mainnet],
ssr: false, // If your dApp uses server side rendering (SSR)
}); If you absolutely want to choose your own set of wallets, you can use import { connectorsForWallets, getDefaultConfig } from "@rainbow-me/rainbowkit";
import { mainnet } from "wagmi/chains";
import { createConfig, http } from "wagmi";
import { PROJECT_ID } from "@/utils/env";
import { metaMask, walletConnect } from "wagmi/connectors";
import {
walletConnectWallet,
metaMaskWallet,
phantomWallet,
} from "@rainbow-me/rainbowkit/wallets";
const connectors = connectorsForWallets([
{
groupName: "Recommended",
wallets: [metaMaskWallet, walletConnectWallet],
},
], { projectId: PROJECT_ID, walletConnectParameters: {}, appName: "xxx", appDescription: "", appUrl: "", appIcon: "" });
const wagmiWallets = [walletConnect({
projectId: PROJECT_ID, metadata: {
name: 'xxxx',
description: "xxxx",
url: "https://xxxx.ai/",
icons: [""]
}
}), metaMask()]
function isMobileDevice() {
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
}
export const wagmiConfig = createConfig({
connectors: isMobileDevice() ? wagmiWallets : connectors,
chains: [mainnet],
transports: {
[mainnet.id]: http(''),
},
}); In <WagmiProvider config={wagmiConfig}> // replace with "rainbowConfig" if you want to use defaults
<QueryClientProvider client={queryClient}>
<App />
</QueryClientProvider>
</WagmiProvider> |
@weber77 Are you saying everything seems to work with Here is another alternative to your const connectors = connectorsForWallets(
[
{
groupName: "Recommended",
wallets: [metaMaskWallet, walletConnectWallet],
},
],
{
projectId: "...",
appName: "...",
// Add your own WalletConnect parameters
walletConnectParameters: {
metadata: {
name: "xxxx",
description: "xxxx",
url: "https://xxxx.ai/",
icons: [""],
},
},
}
); |
Is there an existing issue for this?
RainbowKit Version
^2.1.2
wagmi Version
^2.10.2
Current Behavior
when I connect on mobile it opens in metamask but does prompt for connection
Screen_Recording_20240618_210121_MetaMask.mp4
Expected Behavior
Screen_Recording_20240618_211254_MetaMask.mp4
Steps To Reproduce
connect wallet
Link to Minimal Reproducible Example (CodeSandbox, StackBlitz, etc.)
CodeSandBox
The text was updated successfully, but these errors were encountered: