Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use hostname to fetch approvedhosts (#7489)
## **Description** This PR fixes an Android SDK bug whereby: - The wallet was always returning the first permitted account instead of the selected account when connecting the SDK to MetaMask - Changing the selected account on MetaMask did not fire a `metamask_accountsChanged` event so the SDK did not get selected account updated. This change implements the `getApprovedHosts` to fix this issue. ## **Manual testing steps** _1. Have more than one address in your metamask account and select any address as active address _2. Connect from Android Metamask SDK and ensure the active account is the selected address on the SDK _3. Switch to another account on the wallet, and ensure that the SDK updates to the new address ## **Related issues** _Fixes #???_ ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've clearly explained: - [x] What problem this PR is solving. - [x] How this problem was solved. - [x] How reviewers can test my changes. - [ ] I’ve indicated what issue this PR is linked to: Fixes #??? - [ ] I’ve included tests if applicable. - [x] I’ve documented any added code. - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). - [x] I’ve properly set the pull request status: - [ ] In case it's not yet "ready for review", I've set it to "draft". - [ ] In case it's "ready for review", I've changed it from "draft" to "non-draft". ## **Pre-merge reviewer checklist** - [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
- Loading branch information