DeviceSettingsPermission is a Capacitor plugin designed to streamline the process of requesting permissions and accessing device settings. It provides a unified API to request and check permissions across different platforms, and offers a simple way to direct users to their device's settings page. This plugin is intended to enhance user experience by making permission management more efficient and user-friendly.
npm install capacitor-plugin-device-settings-permission
npx cap sync
requestNotificationPermission() => Promise<{ permission: NotificationPermissions; }>
Request permission to show notifications.
Returns: Promise<{ permission: NotificationPermissions; }>
Since: 1.0.0
getNotificationPermission() => Promise<{ permission: NotificationPermissions; }>
Check the current notification permission status.
Returns: Promise<{ permission: NotificationPermissions; }>
Since: 1.0.0
openAppSettings(type: AppSettingsType) => Promise<void>
Open the app settings for the app.
Param | Type | Description |
---|---|---|
type |
AppSettingsType |
The type of settings to open. |
Since: 1.0.0
Members | Value |
---|---|
GRANTED |
'granted' |
DENIED |
'denied' |
Members | Value |
---|---|
NOTIFICATION |
'notification' |
LOCATION |
'location' |
TRACING |
'tracing' |
GENERAL |
'general' |