docs: update docs for local-notificaitons - #594
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
OS-pedrogustavobilro
left a comment
There was a problem hiding this comment.
I'm approving the PR. Left a few remarks/questions but these ones can't really be handled in this PR hence why I'm approving.
| | **`smallIcon`** | <code>string</code> | Set the default status bar icon for notifications. Icons should be placed in your app's `res/drawable` folder. The value for this option should be the drawable resource ID, which is the filename without an extension. Only available for Android. | 1.0.0 | | ||
| | **`iconColor`** | <code>string</code> | Set the default color of status bar icons for notifications. Only available for Android. | 1.0.0 | | ||
| | **`sound`** | <code>string</code> | Set the default notification sound for notifications. It sets the default channel sound and can't be changed unless the app is uninstalled. If the audio file is not found, it will result in no sound. Only available for Android. | 1.0.0 | | ||
| | **`sound`** | <code>string</code> | Set the default notification sound for notifications. On Android 8+ it sets the default channel sound and can't be changed unless the app is uninstalled. If the audio file is not found, it will result in the default system sound being played on Android 7.x and no sound on Android 8+. Only available for Android. | 1.0.0 | |
There was a problem hiding this comment.
Minor: This Cap 9 API now reverted to Cap 8 (where it still talks about Android 7, no longer supported in Cap 9).
This will need to get re-fixed because the new plugin hasn't been migrated to Cap 9, which won't happen in this PR, just an FYI.
|
|
||
| <a href="#schedule">Schedule</a> one or more local notifications. | ||
|
|
||
| On both platforms this now requests the notification permission it needs |
There was a problem hiding this comment.
Probably would be nice to mention that it's since version 8.3.0 here, because the "now" is unclear as to since when is that done.
There was a problem hiding this comment.
yeah that's a good point! updated it now, can you check?
There was a problem hiding this comment.
Looks good! We can update it here, but we would need to update and re-release https://github.com/ionic-team/capacitor-local-notifications, otherwise this will be reversed once we re-run the docs commands.
There was a problem hiding this comment.
yeah, I updated it in the plugin already just didn't re-release it. Since this is just a documentation update, I think we can leave it as is. Once there in an actual fix or change in the plugin and that is released (e.g. 8.3.1) and the docs commands are executed, everything should be fine.
in the meatime, if we re-run the docs commands and this doc update gets reversed (because it'll fetch what comes from NPM version 8.3.0), then those changes shouldn't be pushed.
| | **`silent`** | <code>boolean</code> | If true, notification will not appear while app is in the foreground. Only available for iOS. | | 5.0.0 | | ||
| | **`badge`** | <code>number</code> | The number to display on the app icon badge when this notification is delivered. On iOS this sets the badge count on the [`UNMutableNotificationContent`](https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent). On Android this calls `setNumber()` on [`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder). | | 8.3.0 | | ||
| | **`foreground`** | <code>boolean</code> | Whether the notification should be presented while the app is in the foreground. On iOS `true` forces the notification to be shown even while the app is foregrounded, while `false` suppresses it (it is still delivered to the `localNotificationReceived` listener). This is independent of `silent`; when both are provided, `foreground` takes precedence. On Android it raises the notification priority so it can present as a heads-up notification. | | 8.3.0 | | ||
| | **`isExactNotification`** | <code>boolean</code> | Whether this notification should be scheduled with an exact alarm. Only available for Android. Defaults to `true`: on `schedule()` (API 31+), if the app isn't yet allowed to schedule exact alarms the system "Alarms & reminders" settings screen is opened so the user can grant it — regardless of `isExactMandatory`. If the user still declines, the notification falls back to an inexact alarm (unless `isExactMandatory` is also set, in which case the call is rejected instead); a fallback like this sets `ScheduleResult.warning`. `update()` never prompts and falls back silently. Set to `false` to schedule this notification as inexact outright, regardless of permission state. | <code>true</code> | 8.3.0 | |
There was a problem hiding this comment.
Correct me if I'm wrong but this is a "soft" breaking change? Because there used to be no isExactNotification, and exact alarms permission intent wasn't launched always by default before this 8.3.0.
I suppose the impact of this is small, but just wanted to surface it to check if it's intentional or not.
There was a problem hiding this comment.
Yeah this was intended, we had to make a compromise to align the two APIs (OutSystems and Capacitor), and implicit permission requests (for both POST_NOTIFICATIONS and the exact alarms) was the thing we had to change, to have the APIs as similar as possible. Similar to what we did for the Camera plugin.
Description
Change Type
Rationale / Problems Fixed
Tests or Reproductions
Screenshots / Media
Platforms Affected
Notes / Comments