stripe / stripe-terminal-android

Stripe Terminal Android SDK
https://stripe.dev/stripe-terminal-android/
Other
94 stars 46 forks source link

What is the best practice for requesting location access? #391

Closed rscherf closed 1 year ago

rscherf commented 1 year ago

The Stripe Terminal Android docs suggest that only ACCESS_FINE_LOCATION is required:

https://stripe.com/docs/terminal/payments/setup-integration?terminal-sdk-platform=android#configure

However, the repo README suggests that ACCESS_COARSE_LOCATION is required:

https://github.com/stripe/stripe-terminal-android#configure-your-app

The example app has logic for asking for both.

https://github.com/stripe/stripe-terminal-android/blob/d400175c5e52b10b089c744d4695d071947416b2/Example/javaapp/src/main/java/com/stripe/example/javaapp/fragment/discovery/DiscoveryFragment.java#L245-L252

https://github.com/stripe/stripe-terminal-android/blob/d400175c5e52b10b089c744d4695d071947416b2/Example/kotlinapp/src/main/java/com/stripe/example/viewmodel/DiscoveryViewModel.kt#L47-L52

ugochukwu-stripe commented 1 year ago

Hi @rscherf , apologies for the confusion here. The Terminal SDK requires the ACCESS_FINE_LOCATION permission when the device supports precise location updates via a dedicated GPS. According the official android docs ^1, best practise for requesting fine location permissions is to request both fine and coarse location access permissions. We'll take an ai to update all our docs to be consistent.

rscherf commented 1 year ago

Thank you for clarifying!