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.
#r "nuget: Xamarin.CustomPermissions.Droid, 1.0.1"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Xamarin.CustomPermissions.Droid as a Cake Addin
#addin nuget:?package=Xamarin.CustomPermissions.Droid&version=1.0.1

// Install Xamarin.CustomPermissions.Droid as a Cake Tool
#tool nuget:?package=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.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.1 470 10/22/2018
1.0.0 459 8/2/2018