jamesmontemagno / Xamarin.Plugins

Cross-platform Native API Access from Shared Code!
MIT License
1.3k stars 380 forks source link

Added convenience method with combined check and request of permissions #301

Closed ferrydeboer closed 7 years ago

ferrydeboer commented 8 years ago

I found myself repeatedly writing the same code to check and if necessary request the permissions. I implemented this method in my own project by extending the interface and implementing it in a decorator style that simply proxies the other three functions of the interface. Here I put it in a base, since I seems to make sense to only have one interface exposed.

After having to modify all the implementations another style with a helper/wrapper might be more appropriate. But this does impede discoverability of the API whereas having it all on still a small interface does not. I at first like to know what you think of the general idea?

Changes Proposed in this pull request:

Which plugin does this impact: