Using Grouped Notifications
Show Apple's description.
Grouping the notifications your app sends helps people get more information at a glance and manage multiple notifications at once. Learn how to implement Grouped Notifications in your app.
- iOS 12 introduces grouping of notifications. The aim is to help organize content for users.
- Part of these changes include summaries displayed on the Lead Notification (top of the group stack). These can be customized to provide clarity for the user about the notifications grouped.
- Grouping can be customized through the ‘thread-identifier’ key in the push payload.
- Basically this session is just a list of suggestions on how to use grouping in your app
- Apps can adopt different grouping strategies. Ex. Calendar groups informative updates from actionable events. Ex. mail allows user preferences to alter the grouping of content. Ex. Messages groups based on conversations.
- Separate important, actionable notifications from informative updates.
- Create groups for meaningful personal communications
- Respect the users priorities and organization.
Notification Group Summary
- Group summaries can be customized (more content to read / number in the group/ the people in the conversation).
- The basic version, is done by providing a summary format in the push notification category:
- Alternatively, we also have a
hiddenPreviewPlaceholder: This is used when the phone is locked and the notifications are private
- If we want something more than just the number of notifications such as: We need to pass the placeholders in the summary format:
- Then we will pass the other parameters in the notification content: Note that iOS will collect multiple values of the summaryArgument and format them for us
- In the previous examples the %u was matching the number of notifications that we had in that group, but sometimes a notification is like “you have two new messages”, so how can I summarize this? Easy, new property in the notification content:
- Localization for summaries can be handled locally from the app via plist bundled with the app