Closed zoechi closed 6 years ago
The image_picker plugin had a similar problem recently.
When I go to Settings > Apps & notifications > My App > Permissions I get Contacts shown as disabled. When I enable it, reading the contacts works.
I'd expect to get asked in a popup if permissions are not set (like the image_picker plugin does for camera and storage access)
I wish we would have a permission plugin such as https://github.com/yonahforst/react-native-permissions
I haven't done any mobile development before Flutter and didn't have time yet to dive into it. I hope someone else knows how to get this fixed ;-)
https://github.com/Lyokone/flutterlocation/pull/25 seems to fix a similar issue
There seems to be a new plugin https://github.com/Ethras/flutter_simple_permissions . It looks incomplete though - no "shouldShowRationale" for Android, and only a subset of permissions supported for now. I wrote a tutorial about Android permissions in Flutter ( http://cogitas.net/android-runtime-permission-flow-flutter/ ) so I'm going to see if I can improve that plugin for the Android side, as it would be great to have a plugin handling this.
I am confused whether we need to have a separate plugin for permission handling or the plugin itself should take care of permissions ?
how can get all contacts automatic without user interaction for enabling permission
@reeteshkumar39 I don't think you should be able to access a users contacts without his consent.
@zoechi @reeteshkumar39 nope you can't access without the user giving the permission, thsts why its crashing
There needs to be a way to request contacts permission on initPlatformState and provide a fallback if permission is denied. The app will crash otherwise.
Following from my previous comment, I have done the PR to add Android contact permissions (read/write) to the simple_permissions plugin; the maintainer has now done the iOS code and has published an updated version of the plugin. Therefore, I would recommend using that plugin.
I will work on the PR for "shouldShowRationale" flow soon (see my comment above), but I prioritised the PR for adding contacts.
@freewheelnat thanks for that I had actually today just finished getting the permissions working on iOS 9.0 and later for Reading and Writing Contacts.
Thanks for handling contact permissions in your plugin, i'll add a link to this in the Readme.
I added
<uses-permission android:name="android.permission.READ_CONTACTS" />
toAndroidManifest.xml
, but I still getDo you have any idea how to fix that?