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

How can I open metamask and trust wallet app directly? #59

Open
hungMta opened this issue Jan 27, 2022 · 3 comments
Open

How can I open metamask and trust wallet app directly? #59

hungMta opened this issue Jan 27, 2022 · 3 comments

Comments

@hungMta
Copy link

hungMta commented Jan 27, 2022

I see in the example using "wc:" schema to open wallet app and I have to choose which app I want to open in a dialog. But I want to open the app directly so how can I do that? There are any schemas to open Metmask or Trust wallet directly?

I appreciate your help.

@nghiatesuji
Copy link

nghiatesuji commented Mar 31, 2022

Try this:

val intent = context?.packageManager?.getLaunchIntentForPackage("io.metamask")
intent?.action = Intent.ACTION_VIEW
intent?.data = Uri.parse(config.toWCUri())
startActivity(intent)

@wangtingshun
Copy link

val intent = context?.packageManager?.getLaunchIntentForPackage("io.metamask")
intent?.action = Intent.ACTION_VIEW
intent?.data = Uri.parse(config.toWCUri())
startActivity(intent)

report an error:
image

@wangtingshun
Copy link

Try this:
intent = Intent(Intent.ACTION_VIEW)
intent?.setPackage("io.metamask")
intent?.data = Uri.parse(config.toWCUri())
startActivity(intent)

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

4 participants
@hungMta @wangtingshun @nghiatesuji and others