0.0.5 • Published 1 year ago
capacitor-plugin-device-settings-permission v0.0.5
capacitor-plugin-device-settings-permission
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.
Install
npm install capacitor-plugin-device-settings-permission
npx cap sync
API
requestNotificationPermission()
requestNotificationPermission() => Promise<{ permission: NotificationPermissions; }>
Request permission to show notifications.
Returns: Promise<{ permission: NotificationPermissions; }>
Since: 1.0.0
getNotificationPermission()
getNotificationPermission() => Promise<{ permission: NotificationPermissions; }>
Check the current notification permission status.
Returns: Promise<{ permission: NotificationPermissions; }>
Since: 1.0.0
openAppSettings(...)
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
Enums
NotificationPermissions
Members | Value |
---|---|
GRANTED | 'granted' |
DENIED | 'denied' |
AppSettingsType
Members | Value |
---|---|
NOTIFICATION | 'notification' |
LOCATION | 'location' |
TRACING | 'tracing' |
GENERAL | 'general' |