Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions flutter_local_notifications/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -498,13 +498,7 @@ For iOS 10+, use the presentation options to control the behaviour for when a no

### iOS 27 changes

iOS 27 appears to have changed the behaviour of what happens when an attempt to show a notification happens when permissions have not been granted. A `PlatformException` ends up being thrown like follows

```
PlatformException(Error 2003, Repository could not save notification. Source is not authorized., UNErrorDomain, null)
```

This has been reported on this repository [here](https://github.com/MaikuB/flutter_local_notifications/issues/2838). If you have applications running into this issue, the recommendation is permissions are checked before attempting to show notifications. This is a more intuitive approach that can then be used provide guidance to users on how to grant permissions. Worst case, the `PlatformException` can be caught and dealt with it appropriately but is not the recommended solution. A future release may swallow these at a native level to restore the old behaviour.
iOS 27 returns errors when a notification can't be saved, for example when permissions haven't been granted, where earlier versions did nothing. The plugin ignores errors in `UNErrorDomain` so showing a notification behaves the same as it did before. Checking permissions before showing notifications is still recommended so users can be guided on how to grant them. This was reported [here](https://github.com/MaikuB/flutter_local_notifications/issues/2838).

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vlaushkin can you update the readme?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the readme in 747a495 to also mention badge-only and scheduled notifications.


## Web Setup

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,10 @@ - (void)addNotificationRequest:(NSString *)identifier
[UNUserNotificationCenter currentNotificationCenter];
[center addNotificationRequest:notificationRequest
withCompletionHandler:^(NSError *_Nullable error) {
if (error == nil) {
// iOS 27 returns errors where earlier versions failed silently,
// such as when notifications aren't authorized, so errors in this
// domain are ignored
if (error == nil || [error.domain isEqualToString:UNErrorDomain]) {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be ignored as the PR description is out of date. @vlaushkin could you update the PR title and description so it matches the change in direction?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the title and description.

result(nil);
return;
}
Expand Down
Loading