kotlin-walletconnect-lib icon indicating copy to clipboard operation
kotlin-walletconnect-lib copied to clipboard

How can I open metamask and trust wallet app directly?

Open hungMta opened this issue 3 years ago • 3 comments
trafficstars

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.

hungMta avatar Jan 27 '22 04:01 hungMta

Try this:

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

nghiatesuji avatar Mar 31 '22 02:03 nghiatesuji

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 avatar Jun 15 '22 03:06 wangtingshun

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

wangtingshun avatar Jun 15 '22 04:06 wangtingshun