-
Notifications
You must be signed in to change notification settings - Fork 121
[Mobile Payments] Prevent TTP reconnection if no location authorisation #9821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Mobile Payments] Prevent TTP reconnection if no location authorisation #9821
Conversation
We reconnect to the reader automatically on foregrounding the app, if the device and store support it and TTP has been used before. For users which grant `allow once` permissions, this means that in the next app session, they’ll be asked to provide location permission without the context of a payment attempt, which is strange – the system permission alert pops up over whatever screen they happen to be on, interrupting their flow. With this change, we only attempt to reconnect if we already have location permission – this means we no longer show a location permission request out of context.
|
I've put this down for 13.9 – no rush @iamgabrielma |
You can test the changes from this Pull Request by:
|
iamgabrielma
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests well! LGTM 🚢
| guard supportDeterminer.siteSupportsLocalMobileReader(), | ||
| guard supportDeterminer.locationIsAuthorized, | ||
| supportDeterminer.siteSupportsLocalMobileReader(), | ||
| await supportDeterminer.deviceSupportsLocalMobileReader(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not directly related to this PR, but TIL we can suspend the guard until the await chain has been resolved 💯
…ocation-permission
Closes: #9773
Description
We now reconnect to the reader automatically on foregrounding the app, if the device and store support it and TTP has been used before.
For users which grant
allow oncepermissions, this means that in the next app session (i.e. after it's been force quit or kicked from memory), they’ll be asked to provide location permission without the context of a payment attempt, which is strange – the system permission alert pops up over whatever screen they happen to be on, interrupting their flow.With this change, we only attempt to reconnect if we already have location permission – this means we no longer show a location permission request out of context.
Users who choose to
allow oncewill still get the benefit of automatic reconnection when the app is foregrounded, but only after they first connect to the TTP reader in that app session.Testing instructions
Using a US-based store with WCPay, an iPhone XS or newer, and iOS 16+
Ask Next Time Or When I ShareMenu > Payments > Collect PaymentAllow onceScreenshots
RELEASE-NOTES.txtif necessary.