Skip to content
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

Error connecting wallet on Telegram Web App. #1881

Closed
1 task done
DmyKov opened this issue Mar 23, 2024 · 13 comments
Closed
1 task done

Error connecting wallet on Telegram Web App. #1881

DmyKov opened this issue Mar 23, 2024 · 13 comments

Comments

@DmyKov
Copy link

DmyKov commented Mar 23, 2024

Is there an existing issue for this?

  • I have searched the existing issues

RainbowKit Version

2.0

wagmi Version

2.5

Current Behavior

Telegram Mobile App - Android
Telegram Mobile App - iOS
Metamask Mobile App
Telegram Bot

When i try to connect Metamask via Telegram bot on Android Telegram App i get error page ( see screenshot) net::ERR_UNKNOWN_URL_SCHEME
Screenshot_2024-03-22-23-50-19-486_ir ilmili telegraph
Video - https://github.com/rainbow-me/rainbowkit/assets/117279331/86eb76cf-b153-4aee-8030-b08b2129e604

On iOS after click on Metamask icon on RainbowKit modal just do not happening nothing. I done get error page but Wallet do not open. Just nothing hapens.

I found closed issue with the same problem
#1531
And here nichitagutu/web3modal@a05574f some idea how to fix it. It seems that the problem is in the URL that WalletConnect useing to iniciate interaction with Metamask (or other wallet)
Screenshot_2024-03-23-00-02-23-380-edit_ir ilmili telegraph

Also i tried to open your home page just clicking on the URL in any Telegram chat. URL opens with the browser implemented in Telegram and it work good. The problem is only in TWA Apps (Telegram Web Apps)

Expected Behavior

Success wallet connection

Steps To Reproduce

  1. Open Telegram bot with Telegram mobile App
    https://t.me/dk_test_bot_bot
  2. Click on "Start" button to activate the bot
  3. Click on "Test" button (bottom left) to run Telegram web app
  4. Try to connect Metamask on RainbowKit home page

Link to Minimal Reproducible Example (CodeSandbox, StackBlitz, etc.)

https://t.me/dk_test_bot_bot

Anything else?

@DmyKov
Copy link
Author

DmyKov commented Mar 25, 2024

Hello
any update? Did you reproduce the error?

@LeMinhTuAnh
Copy link

i use telegram bot can not open (metamask, trust wallet, coinbase wallet) always failure in telegram bot for android and ios. Can you help me?

@magiziz
Copy link
Contributor

magiziz commented Mar 25, 2024

@DmyKov This seems to be an error with how deep linking works in telegram web app. Usually you would want to do this within a browser on your phone like safari, chrome or firefox and then get redirected to the app right after, but this is not the case with telegram web app.

Telegram uses embedded iframe which tries to redirect you to the app itself, but crashes and this is something that's out of our control. We've got a pretty similar issue here as well: #1531

What i would suggest doing is creating a web app where you can redirect users to and try to do your internal logic there instead of using telegram web app. Please feel free to raise another issue if you're facing with any other bugs 🙏

@meri-maki
Copy link

any news?

@zkgggggame
Copy link

Any news?...

@magiziz
Copy link
Contributor

magiziz commented Jul 22, 2024

@meri-maki @zkgggggame Currently RainbowKit doesn't work with Telegram Web App. Please refer to the comment here #1881 (comment)

@skhetcho
Copy link

skhetcho commented Sep 3, 2024

I submitted a PR for a similar issue on ConnectKit, @magiziz could this possibly be adopted into RainbowKit as well?
All it does is that if it is on android, open in _blank target which forces the TWA to open it outside the iframe:

family/connectkit#414

@meri-maki
Copy link

@skhetcho WalletConnect is planning to add support for twa (i really hope so)
see this issue

@skhetcho
Copy link

skhetcho commented Sep 8, 2024

@meri-maki @magiziz
I updated my connectkit fork, now it work seamlessly with metamask on all devices for Telegram Mini apps (the fork release)

As long as I have the deeplink uris (such as metamask://) there's a isAndroid conditional in my code that would automatically handle the wc uri with the deep link of the target wallet

@pouriya73
Copy link

@magiziz How does the Tonkeeper wallet work?
The main wrapper infrastructure is placed on the mini app program for Telegram, but it seems this feature has been disabled on the Wagmi and Rainbow Kit infrastructures.
Could you please explain why these two similar mechanisms wouldn't work?

@tx-tomcat
Copy link

@meri-maki @magiziz I updated my connectkit fork, now it work seamlessly with metamask on all devices for Telegram Mini apps (the fork release)

As long as I have the deeplink uris (such as metamask://) there's a isAndroid conditional in my code that would automatically handle the wc uri with the deep link of the target wallet

It working on iOS. on Android, metamask stuck at connecting state

@pouriya73
Copy link

You can also use this piece of code to open an external link from within Telegram, which opens the phone browser
@skhetcho @LeMinhTuAnh @tx-tomcat @magiziz

<a href="intent://YOUR-LINK#Intent;scheme=https;action=android.intent.action.VIEW;end;');">Open link in external browser</a>

@harissatti
Copy link

does any one find soution ?mine also not working

@github-actions github-actions bot deleted a comment from pouriya73 Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants