Upgrade to Pro — share decks privately, control downloads, hide ads and more …

What's New in Push Notifications?

Sam Jarman
August 25, 2017

What's New in Push Notifications?

Delivered at Mobile Refresh Wellington, Friday 25th of August, Massey University.
mwr.gdg.nz

Sam Jarman

August 25, 2017
Tweet

More Decks by Sam Jarman

Other Decks in Technology

Transcript

  1. @samjarman • #MobileRefresh Today 1. What’s new in notifications in

    iOS 10 and iOS 11 2. What’s new in notifications in Android O 3. Best practices for push notifications 4. AMA
  2. @samjarman • #MobileRefresh Tweeting is OK! • Encouraged, even! •

    Take photos, ask questions! • I’ll get back to you after the talk :)
  3. @samjarman • #MobileRefresh Big iOS 10 Changes • Revamped, enhanced

    API • Notification Service Extensions • Notification Content Extensions
  4. @samjarman • #MobileRefresh Notable Improvements • Manage remote notifications •

    Control foreground appearance • Inspect responses - dismissed? • Collapsible and threaded notifications
  5. @samjarman • #MobileRefresh Manage Remote Notifications • getDeliveredNotificationsWithCompletionHandler:
 - Provides

    you with a list of the app’s notifications that are still 
 displayed in Notification Center.
 • removeDeliveredNotificationsWithIdentifiers:
 - Removes the specified notifications from Notification Center.
 • removeAllDeliveredNotifications - Removes all of the app’s notifications from Notification Center.
  6. @samjarman • #MobileRefresh Foreground Notifications • userNotificationCenter:willPresentNotification
 :withCompletionHandler: - Called

    when a notification is delivered to a foreground app.
 • Options: Alert, Badge and Sound. 
 - Alert looks similar to regular alert boxes.
 • Good place to override system UI for your own… 
 (and update your app accordingly)
  7. @samjarman • #MobileRefresh User Action Handling • userNotificationCenter:didReceiveNotificationResponse:
 withCompletionHandler: -

    Called to let your app know which action was selected by 
 the user for a given notification.
 • UNNotificationResponse - DismissedAction and DefaultAction constants
 • UNTextInputNotificationResponse - Text typed in as property
  8. @samjarman • #MobileRefresh Collapsible Notifications • Done from your push

    provider. • Two/N consecutive notifications with the same collapse-id header. • Download additional content.
  9. @samjarman • #MobileRefresh Threaded Notifications • More power than collapsible

    notifications • Set a thread-id in the header • Read that thread-id in a notification service extension • Implementing threading yourself
  10. @samjarman • #MobileRefresh Notification Service Extensions • Called before the

    user is shown an alert. • Chance to modify content. • Download additional content.
  11. @samjarman • #MobileRefresh Notification Content Extension • Create your own

    UI for an extension. • Full storyboard access. • Non-interactive. • Format data in a readable, valuable way.
  12. @samjarman • #MobileRefresh Hidden Notification Content • Now available for

    all apps in iOS 11 • Important for privacy of the user - often notification content is sensitive • Users tweak per application, because some could 
 be more sensitive than others • Default hidden text is “Notification”
  13. @samjarman • #MobileRefresh Hidden Notification Content • You can define

    the hidden “default” text as a developer. • Respects thread-id if you’re using those and notification service extensions • Respects collapsible notifications • Supports notifications with images
  14. @samjarman • #MobileRefresh StringsDict in use let chatsCategory = UNNotificationCategory(identifier:"chats",

    actions: [], intentIdentifiers:[], hiddenPreviewsBodyPlaceholder:NSLocalizedStrin g("COMMENTS_KEY", "comment placeholder")
  15. @samjarman • #MobileRefresh Title and Subtitle control let chatsCategory =

    UNNotificationCategory(identifier:"chats", actions: [], intentIdentifiers:[], hiddenPreviewsBodyPlaceholder:”%u chats”, options: [.hiddenPreviewsShowTitle, .hiddenPreviewsShow Subtitle])
  16. @samjarman • #MobileRefresh Channels • Notifications now arrive in a

    given channel, in an optional group • End users can tweak notification settings per channel/group • Developers are encouraged to split notifications into logical channels/groups
  17. @samjarman • #MobileRefresh Channels • Settings for each channel are

    exposed - Sound/Vibration
 - Importance
 - Light/LED colour
 - Bypass do not disturb mode
 - Lockscreen
  18. @samjarman • #MobileRefresh Tips for Channels • Effort on all

    of us to educate consumers about these settings • Deep link to settings screen • Consider not exposing these settings in your own app to avoid confusion • Group into logical groups and channels • If targeting O, must use Channels
 - If not, you can use it without worrying
  19. @samjarman • #MobileRefresh Channels on… iOS? • iOS has Categories.

    • You can register Categories on launch, with buttons, text input, notification services and extensions. • Users not offered fine grain control over category alerts though. • Worth looking into, all new in iOS 8!
  20. @samjarman • #MobileRefresh Conclusion • iOS 10 and 11 expose

    great new API • Android exposes awesome power, but users needs to be educated about it • Respect your users with notifications