using grouped notifications€¦ · michele campeotto, ios user notifications • using grouped...
TRANSCRIPT
![Page 1: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/1.jpg)
#WWDC18
© 2018 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple.
Michele Campeotto, iOS User Notifications
•Using Grouped NotificationsSession 711
![Page 2: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/2.jpg)
•Notification groups •App grouping •Custom grouping •Group summaries
![Page 3: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/3.jpg)
•Notification Groups
![Page 4: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/4.jpg)
![Page 5: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/5.jpg)
![Page 6: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/6.jpg)
![Page 7: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/7.jpg)
![Page 8: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/8.jpg)
![Page 9: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/9.jpg)
![Page 10: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/10.jpg)
![Page 11: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/11.jpg)
•App Grouping
![Page 12: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/12.jpg)
![Page 13: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/13.jpg)
![Page 14: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/14.jpg)
•Custom Grouping
![Page 15: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/15.jpg)
// Creating Groups with Thread Identifiers
let content = UNMutableNotificationContent() content.title = "Notifications Team" content.body = "WWDC session after party" content.threadIdentifier = "notifications-team-chat"
![Page 16: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/16.jpg)
// Creating Groups with Thread Identifiers
let content = UNMutableNotificationContent() content.title = "Notifications Team" content.body = "WWDC session after party" content.threadIdentifier = "notifications-team-chat"
![Page 17: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/17.jpg)
// Creating Groups with Thread Identifiers
{ "aps" : { "alert" : { "title" : "Notifications Team", "body" : "WWDC session after party" } "thread-id" : "notifications-team-chat" } }
![Page 18: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/18.jpg)
// Creating Groups with Thread Identifiers
{ "aps" : { "alert" : { "title" : "Notifications Team", "body" : "WWDC session after party" } "thread-id" : "notifications-team-chat" } }
![Page 19: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/19.jpg)
Custom Grouping Examples
Calendar
Messages
![Page 20: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/20.jpg)
![Page 21: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/21.jpg)
threadIdentifier = nil
![Page 22: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/22.jpg)
threadIdentifier = nil
threadIdentifier = "alerts"
![Page 23: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/23.jpg)
threadIdentifier = nil
threadIdentifier = "alerts"
![Page 24: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/24.jpg)
![Page 25: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/25.jpg)
Separate important, actionable notifications from informative updates.
![Page 26: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/26.jpg)
![Page 27: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/27.jpg)
threadIdentifier = "gr-michele"
![Page 28: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/28.jpg)
threadIdentifier = "gr-51413"
threadIdentifier = "gr-michele"
![Page 29: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/29.jpg)
![Page 30: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/30.jpg)
Create groups for meaningful, personal communications.
![Page 31: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/31.jpg)
![Page 32: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/32.jpg)
threadIdentifier = "acct-icloud"
![Page 33: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/33.jpg)
threadIdentifier = "acct-icloud"
threadIdentifier = "vip-michele"
![Page 34: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/34.jpg)
threadIdentifier = "acct-icloud"
threadIdentifier = "vip-michele"
threadIdentifier = "th-51413"
![Page 35: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/35.jpg)
threadIdentifier = "acct-icloud"
threadIdentifier = "vip-michele"
threadIdentifier = "th-51413"
![Page 36: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/36.jpg)
Respect the user’s priorities and organization.
![Page 37: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/37.jpg)
•Notification Groups Summaries
![Page 38: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/38.jpg)
![Page 39: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/39.jpg)
![Page 40: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/40.jpg)
![Page 41: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/41.jpg)
![Page 42: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/42.jpg)
// Simple Notification Group Summary
let summaryFormat = "%u more messages"
return UNNotificationCategory(identifier: "category-identifier", actions: [], intentIdentifiers: [], hiddenPreviewsBodyPlaceholder: nil, categorySummaryFormat: summaryFormat, options: [])
![Page 43: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/43.jpg)
// Simple Notification Group Summary
let summaryFormat = "%u more messages"
return UNNotificationCategory(identifier: "category-identifier", actions: [], intentIdentifiers: [], hiddenPreviewsBodyPlaceholder: nil, categorySummaryFormat: summaryFormat, options: [])
![Page 44: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/44.jpg)
// Simple Notification Group Summary
let summaryFormat = "%u more messages"
return UNNotificationCategory(identifier: "category-identifier", actions: [], intentIdentifiers: [], hiddenPreviewsBodyPlaceholder: nil, categorySummaryFormat: summaryFormat, options: [])
![Page 45: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/45.jpg)
// Hidden Previews Summary Customization
let summaryFormat = "%u more messages" let hiddenPreviewsPlaceholder = "%u messages"
return UNNotificationCategory(identifier: "category-identifier", actions: [], intentIdentifiers: [], hiddenPreviewsBodyPlaceholder: hiddenPreviewsPlaceholder, categorySummaryFormat: summaryFormat, options: [])
![Page 46: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/46.jpg)
// Hidden Previews Summary Customization
let summaryFormat = "%u more messages" let hiddenPreviewsPlaceholder = "%u messages"
return UNNotificationCategory(identifier: "category-identifier", actions: [], intentIdentifiers: [], hiddenPreviewsBodyPlaceholder: hiddenPreviewsPlaceholder, categorySummaryFormat: summaryFormat, options: [])
![Page 47: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/47.jpg)
![Page 48: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/48.jpg)
// Notification Group Summary with Arguments
let summaryFormat = "%u more messages from %@"
return UNNotificationCategory(identifier: "group-messages", actions: [], intentIdentifiers: [], hiddenPreviewsBodyPlaceholder: nil, categorySummaryFormat: summaryFormat, options: [])
![Page 49: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/49.jpg)
// Notification Group Summary with Arguments
let summaryFormat = "%u more messages from %@"
return UNNotificationCategory(identifier: "group-messages", actions: [], intentIdentifiers: [], hiddenPreviewsBodyPlaceholder: nil, categorySummaryFormat: summaryFormat, options: [])
![Page 50: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/50.jpg)
// Notification Group Summary with Arguments
let summaryFormat = "%u more messages from %@"
return UNNotificationCategory(identifier: "group-messages", actions: [], intentIdentifiers: [], hiddenPreviewsBodyPlaceholder: nil, categorySummaryFormat: summaryFormat, options: [])
![Page 51: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/51.jpg)
// Notification Group Summary Argument
let content = UNMutableNotificationContent() content.body = "…" content.threadIdentifier = "notifications-team" content.summaryArgument = "Kritarth"
![Page 52: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/52.jpg)
// Notification Group Summary Argument
let content = UNMutableNotificationContent() content.body = "…" content.threadIdentifier = "notifications-team" content.summaryArgument = "Kritarth"
![Page 53: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/53.jpg)
// Notification Group Summary Argument
{ "aps" : { "alert" : { "body" : "…", "summary-arg" : "Kritarth" }, "thread-id" : "notifications-team" } }
![Page 54: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/54.jpg)
// Notification Group Summary Argument
{ "aps" : { "alert" : { "body" : "…", "summary-arg" : "Kritarth" }, "thread-id" : "notifications-team" } }
![Page 55: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/55.jpg)
![Page 56: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/56.jpg)
![Page 57: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/57.jpg)
![Page 58: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/58.jpg)
![Page 59: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/59.jpg)
![Page 60: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/60.jpg)
// Notification Summary with Argument Count
let content = UNMutableNotificationContent() content.body = "…" content.threadIdentifier = "…" content.summaryArgument = "Song by Song" content.summaryArgumentCount = 3
![Page 61: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/61.jpg)
// Notification Summary with Argument Count
let content = UNMutableNotificationContent() content.body = "…" content.threadIdentifier = "…" content.summaryArgument = "Song by Song" content.summaryArgumentCount = 3
![Page 62: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/62.jpg)
![Page 63: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/63.jpg)
![Page 64: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/64.jpg)
// Summary Argument Count
{ "aps" : { "alert" : { "body" : "…", "summary-arg" : "Song by Song", "summary-arg-count" : 3 }, "thread-id" : "notifications-team" } }
![Page 65: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/65.jpg)
// Summary Argument Count
{ "aps" : { "alert" : { "body" : "…", "summary-arg" : "Song by Song", "summary-arg-count" : 3 }, "thread-id" : "notifications-team" } }
![Page 66: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/66.jpg)
•Summary Plurals and Localization
![Page 67: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/67.jpg)
![Page 68: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/68.jpg)
![Page 69: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/69.jpg)
![Page 70: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/70.jpg)
// Summary Localization
let summaryFormat = "%u more messages"
return UNNotificationCategory(identifier: "category-identifier", actions: [], intentIdentifiers: [], hiddenPreviewsBodyPlaceholder: nil, categorySummaryFormat: summaryFormat, options: [])
![Page 71: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/71.jpg)
// Summary Localization
let summaryFormat = "%u more messages"
return UNNotificationCategory(identifier: "category-identifier", actions: [], intentIdentifiers: [], hiddenPreviewsBodyPlaceholder: nil, categorySummaryFormat: summaryFormat, options: [])
![Page 72: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/72.jpg)
// Summary Localization
let summaryFormat = NSString.localizedUserNotificationString(forKey: "NOTIFICATION_SUMMARY", arguments: nil)
return UNNotificationCategory(identifier: "category-identifier", actions: [], intentIdentifiers: [], hiddenPreviewsBodyPlaceholder: nil, categorySummaryFormat: summaryFormat, options: [])
![Page 73: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/73.jpg)
// Summary Localization
let summaryFormat = NSString.localizedUserNotificationString(forKey: "NOTIFICATION_SUMMARY", arguments: nil)
return UNNotificationCategory(identifier: "category-identifier", actions: [], intentIdentifiers: [], hiddenPreviewsBodyPlaceholder: nil, categorySummaryFormat: summaryFormat, options: [])
![Page 74: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/74.jpg)
<!-- Summary Localization --> <plist version="1.0"> <dict> <key>NOTIFICATION_SUMMARY</key> <dict> <key>NSStringLocalizedFormatKey</key> <string>%#@notifications@</string> <key>notifications</key> <dict> <key>NSStringFormatSpecTypeKey</key> <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>u</string> <key>one</key> <string>%u more notification</string> <key>other</key> <string>%u more notifications</string> </dict> </dict> </dict> </plist>
![Page 75: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/75.jpg)
<!-- Summary Localization --> <plist version="1.0"> <dict> <key>NOTIFICATION_SUMMARY</key> <dict> <key>NSStringLocalizedFormatKey</key> <string>%#@notifications@</string> <key>notifications</key> <dict> <key>NSStringFormatSpecTypeKey</key> <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>u</string> <key>one</key> <string>%u more notification</string> <key>other</key> <string>%u more notifications</string> </dict> </dict> </dict> </plist>
![Page 76: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/76.jpg)
<!-- Summary Localization --> <plist version="1.0"> <dict> <key>NOTIFICATION_SUMMARY</key> <dict> <key>NSStringLocalizedFormatKey</key> <string>%#@notifications@</string> <key>notifications</key> <dict> <key>NSStringFormatSpecTypeKey</key> <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>u</string> <key>one</key> <string>עוד עדכון אחד</string> <key>two</key> <string>עוד שני עדכונים</string> <key>many</key> <string>עוד %u עדכונים</string> </dict> </dict> </dict> </plist>
![Page 77: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/77.jpg)
<!-- Summary Localization --> <plist version="1.0"> <dict> <key>NOTIFICATION_SUMMARY</key> <dict> <key>NSStringLocalizedFormatKey</key> <string>%#@notifications@</string> <key>notifications</key> <dict> <key>NSStringFormatSpecTypeKey</key> <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>u</string> <key>one</key> <string>עוד עדכון אחד</string> <key>two</key> <string>עוד שני עדכונים</string> <key>many</key> <string>עוד %u עדכונים</string> </dict> </dict> </dict> </plist>
![Page 78: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/78.jpg)
<!-- Summary Localization --> <plist version="1.0"> <dict> <key>NOTIFICATION_SUMMARY</key> <dict> <key>NSStringLocalizedFormatKey</key> <string>%#@notifications@</string> <key>notifications</key> <dict> <key>NSStringFormatSpecTypeKey</key> <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>u</string> <key>one</key> <string>Еще %u уведомление</string> <key>few</key> <string>Еще %u уведомления</string> <key>many</key> <string>Еще %u уведомлений</string> </dict> </dict> </dict> </plist>
![Page 79: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/79.jpg)
<!-- Summary Localization --> <plist version="1.0"> <dict> <key>NOTIFICATION_SUMMARY</key> <dict> <key>NSStringLocalizedFormatKey</key> <string>%#@notifications@</string> <key>notifications</key> <dict> <key>NSStringFormatSpecTypeKey</key> <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>u</string> <key>one</key> <string>Еще %u уведомление</string> <key>few</key> <string>Еще %u уведомления</string> <key>many</key> <string>Еще %u уведомлений</string> </dict> </dict> </dict> </plist>
![Page 80: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/80.jpg)
<!-- Summary Localization with Arguments --> <plist version="1.0"> <dict> <key>NOTIFICATION_SUMMARY</key> <dict> <key>NSStringLocalizedFormatKey</key> <string>%#@notifications@</string> <key>notifications</key> <dict> <key>NSStringFormatSpecTypeKey</key> <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>u</string> <key>one</key> <string>%u more notification from %@</string> <key>other</key> <string>%u more notifications from %@</string> </dict> </dict> </dict> </plist>
![Page 81: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/81.jpg)
<!-- Summary Localization with Arguments --> <plist version="1.0"> <dict> <key>NOTIFICATION_SUMMARY</key> <dict> <key>NSStringLocalizedFormatKey</key> <string>%#@notifications@</string> <key>notifications</key> <dict> <key>NSStringFormatSpecTypeKey</key> <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>u</string> <key>one</key> <string>%u more notification from %@</string> <key>other</key> <string>%u more notifications from %@</string> </dict> </dict> </dict> </plist>
![Page 82: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/82.jpg)
<!-- Summary Localization with Arguments --> <plist version="1.0"> <dict> <key>NOTIFICATION_SUMMARY</key> <dict> <key>NSStringLocalizedFormatKey</key> <string>%#@notifications@</string> <key>notifications</key> <dict> <key>NSStringFormatSpecTypeKey</key> <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>u</string> <key>one</key> <string>%u more notification from %@</string> <key>other</key> <string>%u more notifications from %@</string> </dict> </dict> </dict> </plist>
![Page 83: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/83.jpg)
<!-- Summary Localization with Arguments --> <plist version="1.0"> <dict> <key>NOTIFICATION_SUMMARY</key> <dict> <key>NSStringLocalizedFormatKey</key> <string>%#@notifications@</string> <key>notifications</key> <dict> <key>NSStringFormatSpecTypeKey</key> <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>u</string> <key>one</key> <string>%u more notification from %@</string> <key>other</key> <string>%u more notifications from %@</string> </dict> </dict> </dict> </plist>
![Page 84: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/84.jpg)
<!-- Summary Localization with Arguments --> <plist version="1.0"> <dict> <key>NOTIFICATION_SUMMARY</key> <dict> <key>NSStringLocalizedFormatKey</key> <string>%#@notifications@</string> <key>notifications</key> <dict> <key>NSStringFormatSpecTypeKey</key> <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>u</string> <key>one</key> <string>%u more notification from %@</string> <key>other</key> <string>%u more notifications from %@</string> </dict> </dict> </dict> </plist>
![Page 85: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/85.jpg)
Allowed Notification Summary Formats
![Page 86: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/86.jpg)
Allowed Notification Summary Formats
Notifications count • %u more messages
![Page 87: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/87.jpg)
Allowed Notification Summary Formats
Notifications count • %u more messages
Notifications count and arguments • %u more messages from %@
![Page 88: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/88.jpg)
•Quick Tips
![Page 89: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/89.jpg)
Grouping Different Summaries
![Page 90: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/90.jpg)
Grouping Different Summaries
Simple summaries are joined • 5 more messages and 3 more photos
![Page 91: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/91.jpg)
Grouping Different Summaries
Simple summaries are joined • 5 more messages and 3 more photos
Summaries with arguments fall back to default • 8 more notifications
![Page 92: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/92.jpg)
Rich Grouped Notifications
Extension receives the leading notification
public protocol UNNotificationContentExtension : NSObjectProtocol {
public func didReceive(_ notification: UNNotification)
}
![Page 93: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/93.jpg)
Rich Grouped Notifications
Extension receives the leading notification
Extension can load other notifications
class UNUserNotificationCenter : NSObject {
func getDeliveredNotifications(completionHandler:([UNNotification]) -> Swift.Void)
}
![Page 94: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/94.jpg)
public protocol UNNotificationContentExtension : NSObjectProtocol {
public func didReceive(_ notification: UNNotification)
}
Rich Grouped Notifications
Extension receives the leading notification
Extension can load other notifications
Threading of additional notifications
![Page 95: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/95.jpg)
Rich Grouped Notifications
Extension receives the leading notification
Extension can load other notifications
Threading of additional notifications
Remove notifications when read
class UNUserNotificationCenter : NSObject {
func removeDeliveredNotifications(withIdentifiers identifiers: [String])
}
![Page 96: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/96.jpg)
Summary
Grouped notifications to help organization
Custom summaries to improve clarity
![Page 97: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/97.jpg)
More Informationhttps://developer.apple.com/wwdc2018/711
Notifications Lab Technology Lab 1 Wednesday 4:00PM
Notifications Lab Technology Lab 1 Thursday 9:00AM
Designing Notifications Hall 2 Friday 10:00AM
![Page 98: Using Grouped Notifications€¦ · Michele Campeotto, iOS User Notifications • Using Grouped Notifications Session 711](https://reader031.vdocuments.mx/reader031/viewer/2022013003/5f65b12a832506256c240fa1/html5/thumbnails/98.jpg)