I am trying to find out if Metamask Wallet App is installed in the phone. This is my code:
const { value } = await AppLauncher.canOpenUrl({ url: 'metamask-blockchain-wallet://' });
I am testing this in my iOS device. I've also added LSApplicationQueriesSchemes in info.plist.
<key>LSApplicationQueriesSchemes</key>
<array>
<string>metamask-blockchain-wallet</string>
</array>
I'm getting this error:
-canOpenURL: failed for URL: "metamask-blockchain-wallet://" - error: "The operation couldn’t be completed. (OSStatus error -10814.)"
If I use change the LSApplicationQueriesSchemes like:
<key>LSApplicationQueriesSchemes</key>
<array>
<string>metamask</string>
</array>
I get an error which says
-canOpenURL: failed for URL: "metamask-blockchain-wallet://" - error: "This app is not allowed to query for scheme metamask-blockchain-wallet"
How do I fix this?
So I've found the answer after for this problem. The solution was given in the error. I was providing the wrong URL scheme in canOpenUrl() and LSApplicationQueriesSchemes. I just replaced metamask-blockchain-wallet with metamask and it worked like a charm.
and in the info.plist
(There should be a way for developers to find out the url schemes for the apps that are available on the app store and google play store!)