Hierarchy

  • PermissionAndroidProps

Methods

  • This method checks for a permission is shown before to user and the program is about to request the same permission again.

    Method

    shouldShowRequestPermissionRationale

    Returns

    Android

    Since

    1.2

    Parameters

    Returns boolean

  • This function checks if one of the dangerous permissions is granted at beginning or not. For permissions in same category with one of the permissions is approved earlier, checking will return as it is not required to request for the same category permission.

    Method

    checkPermission

    Returns

    Android

    Since

    1.2

    Parameters

    Returns boolean

  • With requestPermissions, the System Dialog will appear to ask for permission grant by user for dangerous(privacy) permissions. Application.android#onRequestPermissionsResult onRequestPermissionsResult will be fired after user interact with permission dialog.

    Example

    import Application from '@smartface/native/application';
    const PERMISSION_CODE = 1002;
    Application.android.requestPermissions(PERMISSION_CODE, Application.Android.Permissions.WRITE_EXTERNAL_STORAGE)
    Application.android.onRequestPermissionsResult = (e) => {
    console.log(JSON.stringify(e));
    }

    Method

    requestPermissions

    Android

    Since

    1.2

    Parameters

    Returns Promise<PermissionResult[]>

Properties

onRequestPermissionsResult: ((params: { requestCode: number; result: boolean[] }) => void)

Type declaration

    • (params: { requestCode: number; result: boolean[] }): void
    • This event is called after Application.requestPermissions function. This event is fired in asynchronous way.

      Since

      1.2

      Android

      Since

      1.2

      Parameters

      • params: { requestCode: number; result: boolean[] }
        • requestCode: number
        • result: boolean[]

      Returns void

Generated using TypeDoc