---
title: "Handling runtime permissions in Cordova"
canonical_url: "https://www.nutrient.io/guides/android/knowledge-base/runtime-permissions-cordova/"
md_url: "https://www.nutrient.io/guides/android/knowledge-base/runtime-permissions-cordova.md"
last_updated: "2026-06-08T16:49:11.452Z"
description: "To read and write files on the external storage, your app must acquire READEXTERNALSTORAGE and WRITEEXTERNALSTORAGE permissions."
---

To read and write files on the external storage, your app must acquire `READ_EXTERNAL_STORAGE` and `WRITE_EXTERNAL_STORAGE` permissions. To acquire these permissions, add them to your manifest:

```xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="your.app.package">

    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />...
</manifest>

```

If your app targets Android 6.0+, these permissions aren’t granted to your app automatically after installation. Instead, you need to explicitly ask for them before opening files via `PSPDFKit.present`.

You can use the [Android Permission Cordova Plugin](https://www.npmjs.com/package/cordova-plugin-android-permissions) to request these permissions in your JavaScript files.

Install the plugin first:

```shell

cordova plugin add cordova-plugin-android-permissions

```

Then handle the permissions request before presenting the document:

```js

function presentDocument() {
	PSPDFKit.present(documentUri);
}

var permissions = cordova.plugins.permissions;

permissions.hasPermission(
	permissions.READ_EXTERNAL_STORAGE,
	function (status) {
		if (status.hasPermission) {
			// Permission has been granted previously, so there is no need to request it again.
			presentDocument();
		} else {
			var error = function () {
				// Permission has been denied. This example just logs a warning, so
				// make sure to handle this state in your application UI — e.g.
				// inform your user that you can't open the PDF without their permission, or similar.
				console.warn('External storage permission has been denied');
			};

			var success = function (status) {
				if (!status.hasPermission) {
					// Permission has been denied.
					error();
				} else {
					// Permission has been granted. Present the document.
					presentDocument();
				}
			};

			// Request the permission to read files from external storage.
			permissions.requestPermission(
				permissions.READ_EXTERNAL_STORAGE,
				success,
				error,
			);
		}
	},
);

```

Your users will now be presented with the following dialog asking them to grant the required permissions.![Runtime permissions dialog](@/assets/guides/android/knowledge-base/runtime-permissions-cordova/permission-request.png)

Once the external storage permission has been granted, the document will open correctly.
---

## Related pages

- [Allow Clear Text Traffic](/guides/android/knowledge-base/allow-clear-text-traffic.md)
- [Compose Qna](/guides/android/knowledge-base/compose-qna.md)
- [Custom Print Functionality](/guides/android/knowledge-base/custom-print-functionality.md)
- [Deleting Pages From A Pdf](/guides/android/knowledge-base/deleting-pages-from-a-pdf.md)
- [Easily disable share and print options in Android](/guides/android/knowledge-base/disable-share-documentinfo-print.md)
- [Disabling Annotation Rotation](/guides/android/knowledge-base/disabling-annotation-rotation.md)
- [Change page layout dynamically based on orientation](/guides/android/knowledge-base/dynamic-page-layout-when-changing-orientation.md)
- [Managing touch scrolling in Compose containers](/guides/android/knowledge-base/document-view-inside-pager-scroll-handling.md)
- [Getting Signature Location](/guides/android/knowledge-base/getting-signature-location.md)
- [Getting All Digital Signatures](/guides/android/knowledge-base/getting-all-digital-signatures.md)
- [Install Failed Insufficient Storage](/guides/android/knowledge-base/install-failed-insufficient-storage.md)
- [Intercepting Touch Events](/guides/android/knowledge-base/intercepting-touch-events.md)
- [Creating invisible digital signatures in Android](/guides/android/knowledge-base/invisible-signature.md)
- [Invoke Search Programmatically](/guides/android/knowledge-base/invoke-search-programmatically.md)
- [Making Form Elements Read Only](/guides/android/knowledge-base/making-form-elements-read-only.md)
- [Override Hyperlink Behavior](/guides/android/knowledge-base/override-hyperlink-behavior.md)
- [Invoking Share Action Programmatically](/guides/android/knowledge-base/invoking-share-action-programmatically.md)
- [Remove Tool Variant From Toolbar](/guides/android/knowledge-base/remove-tool-variant-from-toolbar.md)
- [Save signed PDFs directly to a remote server on Android](/guides/android/knowledge-base/save-signed-pdfs-to-remote-server.md)
- [Customize the overflow button color in Android](/guides/android/knowledge-base/styling-overflow-button.md)
- [Using Pspdfkit With Dynamic Feature Modules](/guides/android/knowledge-base/using-pspdfkit-with-dynamic-feature-modules.md)

