Slide 1

Slide 1 text

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

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

Kinds of Notifications We Use Push Notifications

Slide 4

Slide 4 text

Kinds of Notifications We Use Push Notifications Silent Push Notifications

Slide 5

Slide 5 text

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

Slide 6

Slide 6 text

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

Slide 7

Slide 7 text

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

Slide 8

Slide 8 text

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

Slide 9

Slide 9 text

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

Slide 10

Slide 10 text

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

Slide 11

Slide 11 text

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

Slide 12

Slide 12 text

What Changed?

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

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

Slide 16

Slide 16 text

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

Slide 17

Slide 17 text

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.

Slide 18

Slide 18 text

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

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

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

Slide 21

Slide 21 text

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)

Slide 22

Slide 22 text

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

Slide 23

Slide 23 text

Other annoying changes I really hope you like extensions

Slide 24

Slide 24 text

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

Slide 25

Slide 25 text

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

Slide 26

Slide 26 text

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.

Slide 27

Slide 27 text

Stupid Swift Tricks

Slide 28

Slide 28 text

Sweet Swift Tricks

Slide 29

Slide 29 text

Protocol Oriented Programming

Slide 30

Slide 30 text

No content

Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

iOS 9

Slide 37

Slide 37 text

iOS 10

Slide 38

Slide 38 text

Even iOS 10-ier

Slide 39

Slide 39 text

No content

Slide 40

Slide 40 text

No content

Slide 41

Slide 41 text

No content

Slide 42

Slide 42 text

No content

Slide 43

Slide 43 text

No content

Slide 44

Slide 44 text

No content

Slide 45

Slide 45 text

No content

Slide 46

Slide 46 text

!

Slide 47

Slide 47 text

No content

Slide 48

Slide 48 text

No content

Slide 49

Slide 49 text

No content

Slide 50

Slide 50 text

No content

Slide 51

Slide 51 text

No content

Slide 52

Slide 52 text

No content

Slide 53

Slide 53 text

God help me, it's a live DEMO

Slide 54

Slide 54 text

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

Slide 55

Slide 55 text

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

Slide 56

Slide 56 text

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

Slide 57

Slide 57 text

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)

Slide 58

Slide 58 text

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.

Slide 59

Slide 59 text

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

Slide 60

Slide 60 text

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/

Slide 61

Slide 61 text

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/

Slide 62

Slide 62 text

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