Closed AAlex-11 closed 5 months ago
@AAlex-11 what s the relation between Utils.android.getApplicationContext().checkSelfPermission('storage')
and this plugin? :
checkSelfPermission
is a native android API and it wont accept storage
which is a value for this plugin'storage'
is to be used with this plugin APIPlease read the readme of the plugin
Hi, @farfromrefug, plugins return never-ask-again
Therefore I take a look to code @nativescript/core/utils
check(permission: string | string[]) {
const context = Utils.android.getApplicationContext();
let result = true;
const granted = android.content.pm.PackageManager.PERMISSION_GRANTED;
if (!Array.isArray(permission)) {
permission = [permission];
}
if (this.getAndroidSDK() < this.MARSHMALLOW) {
permission.forEach((p) => (result = result && context.checkPermission(p, android.os.Process.myPid(), android.os.Process.myUid()) === granted));
} else {
permission.forEach((p) => (result = result && context.checkSelfPermission(p) === granted));
}
return result;
}
and trace result. What wrong? at any case -
despite all permissions I have in Manifest of my application.
@farfromrefug and about readme. I can not see example - how to require permission to write to Android (Angular). Where is placed that readme? Link I expected https://nativescript-community.github.io/perms/ - has no example for Android, isn't it?
@AAlex-11 everything you need to know about the plugin api is in the readme. But you need to read and look at android doc to correctly setup your project as explained here https://github.com/nativescript-community/perms?tab=readme-ov-file#android-notes Android permissions are complicated. Not everything can be explained here and I purposely dont add all so that users take the time to read native docs. Never ask again means android is not OK with your project setup(related to running android version) and won't allow you to request permission
Manifest
Which platform(s) does your issue occur on?
Nativescript version
Error
and, of course, any attempt to write produced error