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

Pushing the Envelope with iOS 10 Notifications - CocoaConf Chicago, April 2017

Pushing the Envelope with iOS 10 Notifications - CocoaConf Chicago, April 2017

An expanded summary of the big changes to Notifications in iOS 10, and some fun stupid things I've learned since I first gave this presentation in September of 2016.

Sample code (Updated for Xcode 8.3):
https://github.com/designatednerd/iOS10NotificationSample

iOS 9 Video:
https://youtu.be/jNr0U-bCfs0

iOS 10 Video:
https://youtu.be/Qubmnmh6a_g

Original Slides:
https://speakerdeck.com/designatednerd/pushing-the-envelope-with-ios-10-notifications-try-swift-nyc-september-2016

Ellen Shapiro
PRO

April 22, 2017
Tweet

More Decks by Ellen Shapiro

Other Decks in Technology

Transcript

  1. Pushing the Envelope With
    iOS 10 Notifications
    CocoaConf Chicago | April 2017
    by Ellen Shapiro
    @designatednerd | SpotHero.com | JustHum.com

    View Slide

  2. View Slide

  3. Kinds of Notifications We Use
    Push Notifications

    View Slide

  4. Kinds of Notifications We Use
    Push Notifications
    Silent Push Notifications

    View Slide

  5. Kinds of Notifications We Use
    Push Notifications
    Silent Push Notifications
    Geofenced Notifications

    View Slide

  6. Kinds of Notifications We Use
    Push Notifications
    Silent Push Notifications
    Geofenced Notifications
    Time/Date Scheduled Notifications

    View Slide

  7. Ye Olde and Busted Way
    Push notifications and local notifications are totally
    different classes, with totally different paths

    View Slide

  8. Kinds of Notifications We Use
    Push Notifications remote
    Silent Push Notifications remote
    Geofenced Notifications local
    Time/Date Scheduled Notifications local

    View Slide

  9. Ye Olde and Busted Way
    Push notifications and local notifications are totally
    different classes, with totally different paths
    Remote notifications can't be updated by the system

    View Slide

  10. Ye Olde and Busted Way
    Push notifications and local notifications are totally
    different classes, with totally different paths
    Remote notifications can't be updated once received
    If you send things which change remotely, you have
    to send one kajillion separate notifications

    View Slide

  11. Ye Olde and Busted Way
    Push notifications and local notifications are totally
    different classes, with totally different paths
    Remote notifications can't be updated once received
    If you send things which change remotely, you have
    to send one kajillion* separate notifications
    *-rough estimate

    View Slide

  12. What Changed?

    View Slide

  13. View Slide

  14. View Slide

  15. Ye Awesome Neue Way
    A Notification is a Notification is a Notification

    View Slide

  16. Ye Awesome Neue Way
    A Notification is a Notification is a Notification
    Notification extensions can grab additional content
    like images and videos from remote notifications

    View Slide

  17. Ye Awesome Neue Way
    A Notification is a Notification is a Notification
    Notification extensions can grab additional content
    like images and videos from remote notifications
    Remote notifications can have unique identifiers and
    be updated rather than having to send separate
    notifications.

    View Slide

  18. Other helpful changes
    Notifications received while the app is in the
    foreground can be shown using system UI

    View Slide

  19. View Slide

  20. Other helpful changes
    Notifications received while the app is in the
    foreground can be shown using system UI
    Local/Remote notification handling delegate
    methods are now combined

    View Slide

  21. Other helpful changes
    Notifications received while the app is in the
    foreground can be shown using system UI
    Local/Remote notification handling delegate
    methods are now combined
    (and no longer on UIApplicationDelegate)

    View Slide

  22. Other helpful changes
    Notifications received while the app is in the
    foreground can be shown using system UI
    Local/Remote notification handling delegate
    methods are now combined
    (and no longer on UIApplicationDelegate*)
    *mostly

    View Slide

  23. Other annoying changes
    I really hope you like extensions

    View Slide

  24. Other annoying changes
    I really hope you like extensions
    A couple bits are still in the UIApplicationDelegate

    View Slide

  25. Other annoying changes
    I really hope you like extensions
    A couple bits are still in the UIApplicationDelegate
    Threading? ¯\_(ϑ)_/¯

    View Slide

  26. Other annoying changes
    I really hope you like extensions
    A couple bits are still in the UIApplicationDelegate
    Threading? ¯\_(ϑ)_/¯
    Simultaneous support of old and busted with the
    new hotness is REAL obnoxious.

    View Slide

  27. Stupid Swift Tricks

    View Slide

  28. Sweet Swift Tricks

    View Slide

  29. Protocol Oriented
    Programming

    View Slide

  30. View Slide

  31. View Slide

  32. View Slide

  33. View Slide

  34. View Slide

  35. View Slide

  36. iOS 9

    View Slide

  37. iOS 10

    View Slide

  38. Even iOS 10-ier

    View Slide

  39. View Slide

  40. View Slide

  41. View Slide

  42. View Slide

  43. View Slide

  44. View Slide

  45. View Slide

  46. !

    View Slide

  47. View Slide

  48. View Slide

  49. View Slide

  50. View Slide

  51. View Slide

  52. View Slide

  53. God help me, it's a live
    DEMO

    View Slide

  54. What Do You Need To Do?
    1. Use the UNNotifications framework

    View Slide

  55. What Do You Need To Do?
    1. Use the UNNotifications framework
    2. Create A Framework For Shared Elements

    View Slide

  56. What Do You Need To Do?
    1. Use the UNNotifications framework
    2. Create A Framework For Shared Elements
    3. Create a Notification Service Extension

    View Slide

  57. What Do You Need To Do?
    1. Use the UNNotifications framework
    2. Create A Framework For Shared Elements
    3. Create a Notification Service Extension
    4. Create a Notification Content extension (needs
    the UserNotificationsUI framework)

    View Slide

  58. What Do You Need To Do?
    1. Use the UNNotifications framework
    2. Create A Framework For Shared Elements
    3. Create a Notification Service Extension
    4. Create a Notification Content extension (needs
    the UserNotificationsUI framework)
    5. Start begging working on convincing your Product
    team to drop iOS 9 support.

    View Slide

  59. Teh Codez!
    (Updated for Xcode 8.3.2!)
    https://github.com/designatednerd/
    iOS10NotificationSample

    View Slide

  60. WWDC Sessions!
    → WWDC 2016 Session 707 - Introduction to
    Notifications https://developer.apple.com/
    videos/play/wwdc2016/707/
    → WWDC 2016 Session 708 - Advanced Notifications:
    https://developer.apple.com/videos/play/
    wwdc2016/708/

    View Slide

  61. Links!
    → iOS 10 API Diff: https://developer.apple.com/
    library/prerelease/content/releasenotes/
    General/iOS10APIDiffs/
    → iOS 10 By Tutorials Preview: https://
    www.raywenderlich.com/store/ios-10-by-tutorials
    → Castro's use of Notifications: https://
    www.macstories.net/news/castro-23-brings-
    podcast-triage-through-rich-notifications/

    View Slide

  62. Parrots!
    courtesy of
    http://cultofthepartyparrot.com/

    View Slide