Forum Xamarin.Forms

Permissions Management Library - Android Request Permissions

MelbourneDeveloperMelbourneDeveloper AUMember ✭✭✭
edited August 2017 in Xamarin.Forms

Since Android M, there has been a new permissions request system in place. Permissions are not fixed from the point of install. The app can ask the user if they would like to allow for a permission to be added at runtime. James Montemagno created a library which sits across all the platforms for permissions management and generally works well, but it hasn't been updated for a while, and I found that it didn't work with the new Android permissions request system. The code for that version is here:

We've been working on a Xamarin Forms library that sits across all platforms and attempts to put a later over the top of platform specific things like permissions etc. I have cleaned up and fixed the Android permissions request system and tested it fairly thoroughly from the original library and it is now available in version 1.2.0 of the Adapt.Presentation library for Xamarin Forms along with a bunch of other common components. The samples that come with the repo have examples of permissions requests.

The added advantage of this library is that there are a bunch of common components like camera, and geolocation that depend on the permissions request component built in to this library so you don't need to add a bunch of separate NuGet packages just to get this working.

Here is the open source library repo (Pull Request and Issue logging welcome):

Install-Package Adapt.Presentation

Sign In or Register to comment.