Closed iketw closed 11 months ago
Hi @iketw ! Can you please share the piece of code where you initialise the SDK?
Hi @iketw ! Can you please share the piece of code where you initialise the SDK?
I just ran the code from the reactNativeDemo app, so this:
new MetaMaskSDK({
openDeeplink: (link: string) => {
if (canOpenLink) {
Linking.openURL(link);
}
},
timer: BackgroundTimer,
dappMetadata: {
url: 'ReactNativeTS',
name: 'ReactNativeTS',
},
});
Hi @iketw ! Does this issue happens in both iOS and Android?
Hi @iketw ! Does this issue happens in both iOS and Android?
Just tried on iOS and it works, the issue is only on Android.
On Android I see this in the logs:
DEBUG RCPMS::_write method eth_accounts doesn't need redirect.
DEBUG RCPMS::_write method eth_chainId doesn't need redirect.
and finally this:
Error rpcId=4120858626 metamask_getProviderState [Error: RPC 4120858626 timed out]
WARN Error rpcId=4120858627 eth_accounts [Error: RPC 4120858627 timed out]
WARN Error rpcId=4120858628 eth_chainId [Error: RPC 4120858628 timed out]
Wallet version: iOS: 7.4.0 (1159) Android: 7.4.0 (1159)
Hi @iketw ! We are aware of this issue and we have been working on this. I'll update this issue once we are able to release a fix for it.
Hi @iketw the fix is not yet ready and tested. Thanks for reporting.
Hi @iketw , the issue is that getAddress is calling eth_accounts which requires the wallet to be 'online'. On react native, it automatically shuts the connection after 30 seconds so instead you should use eth_requestAccounts which will automatically deeplinks into metamask and wake up the connection. We are working on ways to prevent this situation with read-only calls on the latest sdk 0.7.1 which should help you.
Hi @iketw ! This has been fixed on 0.7.1
. I will close this issue but feel free to open a new one if you still encounter issues with it.
Describe the bug Using the reactNativeDemo app I connect to MM 7.3.1. I then create an ethers Web3Provider and try to get the address from the signer. I get a warning saying
MM is not connected/installed, please call eth_getRequestAccounts to connect first
To Reproduce Steps to reproduce the behaviour:
In the sign button, remove the onPress code and the following code:
await signer.getAddress()
hangs indefinitely.Expected behaviour The address should be returned since the provider is already connected.
Provide environment information