Skip to content
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

Make use of permission_handler instead of our own implementation #361

Conversation

TheLastGimbus
Copy link
Contributor

This PR adds permission_handler as a dependency, and makes use of it. Thanks to this, we will have easier job of messing with permissions, and we can check permissions without Activity (see discussion in #287 )

Changes made by me still need to be tested on iOS, and on new Android 11 !

If @CaiJingLong will decide to accept this, it will also be nice to remove old attempts in Android and iOS sides.

@CaiJingLong
Copy link
Member

CaiJingLong commented Sep 3, 2020

This PR will not be merged, because referencing other flutter libraries will cause version conflicts.

@TheLastGimbus
Copy link
Contributor Author

Not necessary

When you write library: ^2.0.0, pub will accept anything 2.*.*

So user can have ^2.4.3, other library can have ^2.0.1, and everything will work

@CaiJingLong
Copy link
Member

No, for example, if the plugin you posted is updated to 3.0, plugin 1 depends on 3.0, and plugin 2 depends on 2.0.
When they are used by the same person, they conflict.


The library part of this plugin will not depend on other plugins, nor will it in the future

@TheLastGimbus
Copy link
Contributor Author

So what can we do? I really need the library to work in the background - can we just check how permission_handler implemented it, and copy-paste the same in here?

@CaiJingLong
Copy link
Member

I think what you need may be to ignore the permission check, the default must have permissions, and the contentResolver must be available.

@CaiJingLong
Copy link
Member

I can add an option to support this, but correspondingly, the risk needs to be borne by the user of plugin.

@TheLastGimbus
Copy link
Contributor Author

I can implement everything what is needed to run this plugin in the background - just tell me what needs to be done

@CaiJingLong
Copy link
Member

CaiJingLong commented Sep 25, 2020

I push a change to ignore permission check.
You can try to use 0.6.0-dev.3 version in your project.
And, you can try to use permission_handler to handle permission.

Next code to ignore permission check.

await PhotoManager.setIgnorePermissionCheck(true);

Then you need to make sure that the permissions are available before calling the method.

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

Successfully merging this pull request may close these issues.

2 participants