Click or drag to resize

AppManagerGrantPermissions Method

Call this method to grant an application the specified runtime permissions.

Namespace:  Com.Datalogic.Decode
Assembly:  datalogic-xamarin-sdk (in datalogic-xamarin-sdk.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
VB
public virtual int GrantPermissions (string packageName, System.Collections.Generic.IList<string> permissions);

Parameters

packageName
Type: System.String
String The application to grant permissions to.
permissions
Type: System.Collections.Generic.IList
ArrayList The list of permissions to be granted.

Return Value

Type: System.Int32
int AppManagerException.SUCCESS in case of success, otherwise a possible error code, matching one of the AppManagerException error constants.

Exceptions
Exception Condition
AppManagerException in case of error, when exceptions are enabled through the ErrorManager singleton.
Remarks
Call this method to grant an application the specified runtime permissions.
If the application is a system application the method fails and returns the exception AppManagerException.SECURITY_ERROR or the corresponding error.
The method works in best effort. If almost one of the requested permissions is not granted an error is returned. In case of error to check which permissions are granted use PackageManger.getPackageInfo(String packageName, int flags) with the flag PackageManager#GET_PERMISSIONS to get the PackageInfo of the application with the permissions information.

[Android Documentation]

See Also

Reference