Skip to main content
Parameters
Regarding file access permissions:
  1. The plugin has read, write, and delete access to its private directory by default: /data/data/com.ratta.supernote.pluginhost/files/plugins/<pluginID>.
  2. None of the read, write, or delete permissions are granted by default for the Document, EXPORT, INBOX, MyStyle, Note, and SCREENSHOT directories under shared storage (sdcard); each must be requested separately via plugin.permission.FILE:READ, plugin.permission.FILE:WRITE, and plugin.permission.FILE:DELETE. External SD cards, OTG storage, and other removable storage are likewise governed by these same permissions. Any other directory cannot be read, written, or deleted regardless of whether the corresponding permission is requested.
Returns
  • Promise<number>: returns the permission status, where 0 means the permission is not granted and cannot be used; 1 means the permission is granted and can be used
Throws
  • Throws a parameter validation error when permission is not a non-empty string
  • Throws an error when permission is not in the supported list (error code 1502)
See Plugin Permissions for an overview of the permission system and which APIs depend on each permission.

Example