Xamarin.CustomPermissions.Droid 1.0.1

A Xamarin wrapper binding around Android permission model

Install-Package Xamarin.CustomPermissions.Droid -Version 1.0.1
dotnet add package Xamarin.CustomPermissions.Droid --version 1.0.1
<PackageReference Include="Xamarin.CustomPermissions.Droid" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Xamarin.CustomPermissions.Droid --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

CustomPermission

A Xamarin wrapper binding around Android permission model

Usage

    using Subsystems.CustomPermissionsDroid.External;
    ....
    private CMPPermissionsProxy _permissionsProxy;
    ....
    _permissionsProxy = new CMPPermissionsProxy(this);
    _permissionsProxy.AddPermissionToWishList(Manifest.Permission.ReadContacts, "RCN");
    _permissionsProxy.AddPermissionToWishList(Manifest.Permission.ReadCalendar, "RCL");

    var lst = new List<string>();
    lst.Add("RCN");
    lst.Add("RCL");

    _permissionsProxy.CheckForListOfPermissions(lst, 0, (permissionInfoList, responseCallback) => 
    {

        var permissionsArray = CMPPermissionsProxy.ExtractPermissions(permissionInfoList);
        
        // Can show reasons here, if needed, before calling callback
        responseCallback.Invoke(permissionsArray?.ToList());

    });
    
    public override void OnRequestPermissionsResult(int requestCode, string[] permissions, Android.Content.PM.Permission[] grantResults)
    {
        Console.WriteLine("OnRequestPermissionsResult");
        
    }

CustomPermission

A Xamarin wrapper binding around Android permission model

Usage

    using Subsystems.CustomPermissionsDroid.External;
    ....
    private CMPPermissionsProxy _permissionsProxy;
    ....
    _permissionsProxy = new CMPPermissionsProxy(this);
    _permissionsProxy.AddPermissionToWishList(Manifest.Permission.ReadContacts, "RCN");
    _permissionsProxy.AddPermissionToWishList(Manifest.Permission.ReadCalendar, "RCL");

    var lst = new List<string>();
    lst.Add("RCN");
    lst.Add("RCL");

    _permissionsProxy.CheckForListOfPermissions(lst, 0, (permissionInfoList, responseCallback) => 
    {

        var permissionsArray = CMPPermissionsProxy.ExtractPermissions(permissionInfoList);
        
        // Can show reasons here, if needed, before calling callback
        responseCallback.Invoke(permissionsArray?.ToList());

    });
    
    public override void OnRequestPermissionsResult(int requestCode, string[] permissions, Android.Content.PM.Permission[] grantResults)
    {
        Console.WriteLine("OnRequestPermissionsResult");
        
    }

Release Notes

1. Icon udpated

  • MonoAndroid 9.0

    • No dependencies.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.1 217 10/22/2018
1.0.0 236 8/2/2018