Skip to content

Commit

Permalink
Merge branch 'local-notifications/alarm-permissions' of github.com:io…
Browse files Browse the repository at this point in the history
…nic-team/capacitor-plugins into local-notifications/alarm-permissions
  • Loading branch information
theproducer committed Dec 12, 2023
2 parents ccfe36d + f5322e0 commit f6dfde7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions local-notifications/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Starting on Android 12, scheduled notifications won't be exact unless this permi
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
```

Note that even if the permission is present, users can still disable exact notifications from the app settings. Use `checkExactNotificationSetting()` to check the the value of the setting. If a user disables this setting, the app will restart and any notification scheduled with an exact alarm will be deleted. If your application depends on exact alarms, be sure to check this setting on app launch (for example, in [`App.appStateChange`](https://capacitorjs.com/docs/apis/app#addlistenerappstatechange-)) in order provide fallbacks or alternative behavior.
Note that even if the permission is present, users can still disable exact notifications from the app settings. Use `checkExactNotificationSetting()` to check the the value of the setting. If a user disables this setting, the app will restart and any notification scheduled with an exact alarm will be deleted. If your application depends on exact alarms, be sure to check this setting on app launch (for example, in [`App.appStateChange`](https://capacitorjs.com/docs/apis/app#addlistenerappstatechange-)) in order to provide fallbacks or alternative behavior.

On Android 14, there is a new permission called `USE_EXACT_ALARM`. Use this permission to use exact alarms without needing to request permission from the user. This should only be used if the use of exact alarms is central to your app's functionality. Read more about the implications of using this permission [here](https://developer.android.com/reference/android/Manifest.permission#USE_EXACT_ALARM).

Expand Down Expand Up @@ -336,7 +336,10 @@ Direct user to the application settings screen to configure exact alarms.
In the event that a user changes the settings from granted to denied, the application
will restart and any notification scheduled with an exact alarm will be deleted.

Only available on Android &gt;= 12.
On Android &lt; 12, the user will NOT be directed to the application settings screen, instead this function will
return `granted`.

Only available on Android.

**Returns:** <code>Promise&lt;<a href="#settingspermissionstatus">SettingsPermissionStatus</a>&gt;</code>

Expand Down

0 comments on commit f6dfde7

Please sign in to comment.