MetaMask / metamask-android-sdk

MetaMask SDK for Android
Other
47 stars 13 forks source link

When I call requestAccounts, only the first address is called. #51

Closed amuyu closed 1 year ago

amuyu commented 1 year ago

There are two addresses in Metamask.

After selecting Account2 in the Metamask app, when I call requestAccounts, only the address of Account1 is returned, so I cannot verify the address of Account2 in the app. It seems like the address of Account2 should be returned, but please verify this.(It seems like the Metamask app returns the address of the initially selected account when connected, rather than returning the currently selected account.)

CommunicationClient:: Got message: {"name":"metamask-provider","data":{"id":"e87a0f9a-a821-453e-8c45-e22d3dff8123","result":["0x851408ff3d202fd855d87c73784ed0d58ccc8ed9"]}}
CommunicationClient:: Response for request eth_requestAccounts
CommunicationClient:: Received account changed event: 0x851408ff3d202fd855d87c73784ed0d58ccc8ed9
drawing drawing drawing

To get 'Account2' through 'requestAccounts,' I need to clear the connected data by going to Settings > Security & Privacy and then reconnect". However, when calling 'requestAccounts' on mobile web (Chrome), there is no need to initialize or clear private data; the selected account is retrieved successfully. This behavior should be consistent in the Android SDK as well.

drawing drawing
christopherferreira9 commented 1 year ago

Hi @amuyu ! We have fixed this issue on the wallet side. It should be available in the appstores any time soon.

amuyu commented 1 year ago

Thank you!!