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

C4861b1dfdf3bbb21faec4a1acdf183d?s=128

Ellen Shapiro

April 22, 2017
Tweet

Transcript

  1. 1.

    Pushing the Envelope With iOS 10 Notifications CocoaConf Chicago |

    April 2017 by Ellen Shapiro @designatednerd | SpotHero.com | JustHum.com
  2. 2.
  3. 6.

    Kinds of Notifications We Use Push Notifications Silent Push Notifications

    Geofenced Notifications Time/Date Scheduled Notifications
  4. 7.

    Ye Olde and Busted Way Push notifications and local notifications

    are totally different classes, with totally different paths
  5. 8.

    Kinds of Notifications We Use Push Notifications remote Silent Push

    Notifications remote Geofenced Notifications local Time/Date Scheduled Notifications local
  6. 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
  7. 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
  8. 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
  9. 13.
  10. 14.
  11. 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
  12. 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.
  13. 18.

    Other helpful changes Notifications received while the app is in

    the foreground can be shown using system UI
  14. 19.
  15. 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
  16. 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)
  17. 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
  18. 24.

    Other annoying changes I really hope you like extensions A

    couple bits are still in the UIApplicationDelegate
  19. 25.

    Other annoying changes I really hope you like extensions A

    couple bits are still in the UIApplicationDelegate Threading? ¯\_(ϑ)_/¯
  20. 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.
  21. 30.
  22. 31.
  23. 32.
  24. 33.
  25. 34.
  26. 35.
  27. 36.
  28. 37.
  29. 39.
  30. 40.
  31. 41.
  32. 42.
  33. 43.
  34. 44.
  35. 45.
  36. 46.

    !

  37. 47.
  38. 48.
  39. 49.
  40. 50.
  41. 51.
  42. 52.
  43. 55.

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

    framework 2. Create A Framework For Shared Elements
  44. 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
  45. 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)
  46. 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.
  47. 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/
  48. 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/