Permissions Overview
Learn how to manage device permissions in, including camera, location, and contacts.
Mobile app permissions play a critical role in ensuring secure interaction between users and applications. They serve as a framework that enables apps to access specific features or data on a user's device, such as the camera, microphone, location, or contact list, and allow the user to retain complete control over their privacy and data security.
By granting these permissions, users allow apps to deliver tailored functionalities and enhance their overall experience. Some Native Plugins may require certain device permissions to fulfill their use case.
Apple and Google encourage developers to request permission thoughtfully. If a user has declined, you can suggest they enable the permission through the app's settings menu and include a button that launches the app settings screen using the JavaScript Bridge.
Related Documentation
Permission Prompts
When requesting permissions from your users, they will be asked to provide their consent. Those prompts are native app components with very limited customization.
- iOS: iOS allows a customizable usage description for permission prompts, enabling developers to explain how the requested data will be used. You can follow Permission Prompt Localization to localize the usage description.
- Android: Android permission prompts are served from the system and are translated to the device language. No additional customization is supported.
JavaScript Bridge Functions
Permissions Status
Developer DemoDisplay our demo page in your app to test during development permissions demo page
Users can change the permissions granted to your app through their device settings. You can programmatically check the status of permissions using the Median JavaScript Bridge:
// get status of all permissions
const response = await median.permissions.status();
// only get status of selected permissions
const response = await median.permissions.status(["Contacts", "Camera"]);The response object includes the current state for each requested permission:
{
"Contacts": "undetermined",
"Camera": "granted"
}Each permission can have the following states:
- denied: The permission has been denied or revoked; it can be asked for again.
- granted: The permission has been granted.
- undetermined: The permission was never asked (iOS only).
Status can be fetched for the following permission types:
PhotoLibrary(iOS only)AppTrackingTransparency(iOS only)LocationAlwaysLocationWhenInUseMicrophoneContactsCameraNotifications
App Settings
Developer DemoTest launching the app settings menu: median.dev/app-settings
When users have denied permissions, you can direct them to the app's settings page to enable the required permissions:
median.open.appSettings();To open the Settings page for your app, use the URL above or the JavaScript Bridge call.
You can also review app permissions on device following the official guides:
- iOS: Control access to information in apps on iPhone
- Android: Change app permissions on your Android phone
Frequently Asked Questions
Can I request Bluetooth Access?
Can I request Bluetooth Access?
As of now Bluetooth is an experimental feature not supported by iOS WebKit or Android WebView.
You can track compatibility here: MDN - Web Bluetooth API
We support a range of Bluetooth devices such as payment terminals, printers, sensor devices, etc through vendor provided SDKs and custom native plugins that implement the iOS Core Bluetooth and Android Bluetooth functionality.
We implemented custom Bluetooth integrations in our iBeacon and Master Lock plugins.
Updated about 1 month ago