I'm submitting a ... (check one with "x")
[x ] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or https://ionicworldwide.herokuapp.com/
Current behavior:
1. I have the below code in my component
this.androidPermissions.checkPermission(this.androidPermissions.PERMISSION.READ_SMS).then(
success => { console.log('Permission granted'); }
err => { console.log('Error'); }
);
Throwing error: "TypeError: Cannot read proerty 'READ_SMS' of undefined".
Please see the SS below.

2. I have the below code in my component
this.androidPermissions.requestPermissions("android.permission.READ_SMS");
Throwing error: "JSON error".
Please see the SS below.

Regarding the first issue, the PERMISSION object was defined incorrectly. I just fixed it and it should work well in the next release.
As for the second issue, the function requestPermissions takes an array of strings, not a single string. The typescript definition is incorrect. I fixed this as well and added requestPermission method to request a single permission.
Thanks a lot. When can I expect the next release?
May I know your file changes? So that I can update my local code and continue my development.
Thanks again :)
Have a look at https://github.com/driftyco/ionic-native/commit/ebf402864bda19fc1c937a71c3bcdd4d6c8bdff2
I will publish a release soon once I review some more issues.
this.androidPermissions.requestPermissions([this.androidPermissions.PERMISSION.CAMERA, this.androidPermissions.PERMISSION.GET_ACCOUNTS]).then(
success => {
this.presentToast("Has permission? "+ success,"toast-warning")
},
err => this.androidPermissions.requestPermissions(this.androidPermissions.PERMISSION.CAMERA)
);
Most helpful comment