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

Pushing the Envelope with iOS 10 Notifications - try! Swift NYC, September 2016

Pushing the Envelope with iOS 10 Notifications - try! Swift NYC, September 2016

Video:
https://www.youtube.com/watch?v=9cdR-9-Tn8g

A summary of the big changes to Notifications in iOS 10.

Sample code:
https://github.com/designatednerd/iOS10NotificationSample

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

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

Ellen Shapiro
PRO

September 01, 2016
Tweet

More Decks by Ellen Shapiro

Other Decks in Technology

Transcript

  1. Pushing the Envelope With
    iOS 10 Notifications
    try! Swift NYC | Manhattan | September 2016
    by Ellen Shapiro
    @designatednerd | SpotHero.com | JustHum.com

    View Slide

  2. XCUI Improvements in
    Xcode 8
    try! Swift NYC | Manhattan | September 2016
    by Ellen Shapiro
    @designatednerd | SpotHero.com | JustHum.com

    View Slide

  3. View Slide

  4. Pushing the Envelope With
    iOS 10 Notifications
    try! Swift NYC | Manhattan | September 2016
    by Ellen Shapiro
    @designatednerd | SpotHero.com | JustHum.com

    View Slide

  5. 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 once received
    If you send things which change remotely, you have
    to send one kajillion* separate notifications
    *-rough estimate

    View Slide

  10. What Changed?

    View Slide

  11. View Slide

  12. 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

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

    View Slide

  14. View Slide

  15. 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

  16. 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

  17. Stupid Swift Tricks

    View Slide

  18. Sweet Swift Tricks

    View Slide

  19. Protocol Oriented
    Programming

    View Slide

  20. View Slide

  21. View Slide

  22. View Slide

  23. View Slide

  24. View Slide

  25. View Slide

  26. iOS 9

    View Slide

  27. iOS 10

    View Slide

  28. What Do You Need To Do?
    1. Use the UNNotifications framework
    2. Create a Notification Extension
    3. Create a Notification UI extension (needs the
    UserNotificationsUI framework)
    4. Start begging working on convincing your Product
    team to drop iOS 9 support.

    View Slide

  29. Teh Codez!
    (Currently works on for Xcode 8b6)
    https://github.com/designatednerd/
    iOS10NotificationSample

    View Slide

  30. 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

  31. 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

    View Slide

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

    View Slide