Skip to content
This repository has been archived by the owner on Oct 5, 2021. It is now read-only.

iOS Permission Best Practices #31

Open
1 task
DavidCorrado opened this issue Feb 16, 2020 · 2 comments
Open
1 task

iOS Permission Best Practices #31

DavidCorrado opened this issue Feb 16, 2020 · 2 comments

Comments

@DavidCorrado
Copy link

馃彈 Enhancement Proposal

I have been evaluating the popular location permission libraries with flutter to see how it matches with the best practices. Below is what I found with your library. Let me know if there are ways to get this to work that I missed.

Pitch

So below is my understanding of the best practices. You can see Google Maps and other apps doing the below

If (Location Services Disabled)
    A) Show Location Services Dialog
        Redirect to Location Services Settings
else if(Location permission denied)
    B) Show Dialog saying to enable permission
        Redirect to App Settings
else
    C) Show Permission dialog

So the library does not support
A. The library does not show the dialog that gives the user the option to enable location services.

B. The library ignores the permission request. It would be good if you had an option to show a dialog and redirect to the app settings.

Summary
I think these are the changes required for users of the library to implement permissions.

  1. Show dialog to enable location services when location services are disabled.
  2. Automatically show a dialog that we can pass the title and message when requesting location when permission denied. Have an option to not do that automatically.
    Let me know if you need any clarification.

Platforms affected (mark all that apply)

  • [X ] 馃摫 iOS
  • 馃 Android
@DavidCorrado
Copy link
Author

Added a repo with Android and iOS examples of this best practice for review of how this works and for clarification and to validate things I said above are possible
https://github.com/DavidCorrado/LocationPermissions

@DavidCorrado
Copy link
Author

I created a specific example of how to do what I think is best practices as a flutter plugin here. This example is really specific for my usecase but I think you could make it more flexible for a use in a plugin. Feel free to take any of my code or ideas from this example
https://github.com/DavidCorrado/LocationPermissions/tree/master/Flutter/location_services_permissions

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant