-
-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
I did not find sample usage details in demo app.
There is no existing issue related to this.
-
Android (not tested on iOS)
-
Android 8.1.0
-
ASUS Zenphone
-
CLI: 6.7.8
-
Cross-platform modules: "6.5.0"
-
Runtime(s): 6.5.0 (both)
-
Plugin(s): let me know if needed
Here is code example:
import { getTypes, request, RequestOptions, Rationale, check, Permissions } from '@nativescript-community/perms';
declare var global: any;
export const getPermissionTypes = () => {
console.log(`Getting permission types for the platform`)
console.log(getTypes());
}
export const requestContactsPermission = (): Promise<any> => {
let perm: Permissions = `contacts`;
let rationale: Rationale = {
title: global.AppName + ' contacts permission',
message: global.AppName + ' needs access to your contacts.',
buttonPositive: "OK", // optional
//buttonNegative?: string;
//buttonNeutral?: string;
},
opts: RequestOptions = {
type: 'always',
rationale
};
return request(perm, opts).then(response => {
//this.setState({ locationPermission: response[0] })
console.log(response)
});
}
getPermissionTypes works fine but requestContactsPermission throws the error in title in the calling function.
Metadata
Metadata
Assignees
Labels
No labels