SlideShare a Scribd company logo
1
Hi, I’m Donny
Improving apps with iOS 10 notifications
Because notifications can be pretty cool
2
Contents
A quick history of notifications
Introduction to the UserNotifications framework
Service Extensions
Content Extensions
The bigger picture
iOS 7
Text only notifications
Limited information and context
iOS 8
Simple actions
Apple had a Text Input action for quick replies
iOS 9
Developers could add the Text Input action
Less need to open the app
Everything < iOS 10
The difference between local and remote
func application(_ application: UIApplication,
didReceiveRemoteNotification userInfo: [AnyHashable : Any])
{
}
func application(_ application: UIApplication,
didRegisterForRemoteNotificationsWithDeviceToken
deviceToken: Data) {
}
func application(_ application: UIApplication, didReceive
notification: UILocalNotification) {
}
func application(_ application: UIApplication, didRegister
notificationSettings: UIUserNotificationSettings) {
}
Everything < iOS 10
And of course, it all goes in AppDelegate
func application(_ application: UIApplication,
didReceiveRemoteNotification userInfo: [AnyHashable : Any])
{
}
func application(_ application: UIApplication,
didRegisterForRemoteNotificationsWithDeviceToken
deviceToken: Data) {
}
func application(_ application: UIApplication, didReceive
notification: UILocalNotification) {
}
func application(_ application: UIApplication, didRegister
notificationSettings: UIUserNotificationSettings) {
}
Everything < iOS 10
Showing notifications while foregrounded
There’s one more thing…
iOS 10
Media in notifications
Custom user interface
True end-to-end encryption
Unified framework
UserNotification at a glance
Unified Local and Remote
Single registration handler
Handle notifications through a delegate
Not compatible with < iOS 10
func userNotificationCenter(_ center:
UNUserNotificationCenter, didReceive response:
UNNotificationResponse, withCompletionHandler
completionHandler: @escaping () -> Void) {
}
func userNotificationCenter(_ center:
UNUserNotificationCenter, willPresent notification:
UNNotification, withCompletionHandler completionHandler:
@escaping (UNNotificationPresentationOptions) -> Void) {
}
let notificationCenter = UNUserNotificationCenter.current()
notificationCenter.getNotificationSettings { settings in
if settings.authorizationStatus == .notDetermined {
notificationCenter.requestAuthorization(options:
[.badge, .alert]) { success, error in
// handle status
}
}
}
UserNotification at a glance
UIApplication.shared.registerForRemoteNotifications() APNS
func application(_ application: UIApplication,
didRegisterForRemoteNotificationsWithDeviceToken
deviceToken: Data) {
}
UserNotification at a glance
let content = UNMutableNotificationContent()
content.title = “Next speaker"

content.body = “Donny is up next"
content.badge = 1
let path = Bundle.main.path(forResource: "thumbs", ofType:
"png")!
let imageUrl = URL(fileURLWithPath: path)
let image = try! UNNotificationAttachment(identifier:
"thumbs-up", url: imageUrl, options: nil)
content.attachments = [image]
let trigger =
UNTimeIntervalNotificationTrigger(timeInterval: 10, repeats:
false)
let request = UNNotificationRequest(identifier:
“nextSpeaker", content: content, trigger: trigger)
notificationCenter.add(request, withCompletionHandler: nil)
Create notification contents
Schedule the notification
Update notification contents
UserNotification at a glance
Create notification contents
Schedule the notification
Update notification contents
And when you're in the
foreground...
func userNotificationCenter(_ center:
UNUserNotificationCenter, willPresent notification:
UNNotification, withCompletionHandler completionHandler:
@escaping (UNNotificationPresentationOptions) -> Void) {
completionHandler([.alert, .sound])
}
Service extensions
Hey there! What's up?
49 29b9 cfdc15cfe
3969 107fa
Service Extension
End to end encryption
Send push with mutable-content: 1
Update contents
Limited time available
Service extensions
override func didReceive(_ request: UNNotificationRequest,
withContentHandler contentHandler: @escaping
(UNNotificationContent) -> Void) {
self.contentHandler = contentHandler
decryptedContent = (request.content.mutableCopy() as?
UNMutableNotificationContent)
if let decryptedContent = decryptedContent {
decryptedContent.title = "Updated title"
contentHandler(decryptedContent)
}
}
override func serviceExtensionTimeWillExpire() {
if let contentHandler = contentHandler, let
decryptedContent = decryptedContent {
contentHandler(decryptedContent)
}
}
End to end encryption
Send push with mutable-content: 1
Update contents
Limited time available
Content extensions
View controller based extension
Extensions are tied to categories
Set content ratio in .plist
Actions are to added to notifications separately
<key>NSExtensionAttributes</key>
<dict>
<key>UNNotificationExtensionCategory</key>
<string>wheel</string>
<key>UNNotificationExtensionInitialContentSizeRatio</
key>
<real>1</real>
</dict>
let content = UNMutableNotificationContent()
content.title = "Spin the wheel?"
content.body = "Win tickets for Do iOS"
content.categoryIdentifier = "wheel"
content.badge = 1
Content extensions
Bring your own UI
Extensions don’t receive touches
Extensions do receive notification responses
Even less need for users to open your app
func didReceive(_ response: UNNotificationResponse,
completionHandler completion: @escaping
(UNNotificationContentExtensionResponseOption) -> Void) {
if response.actionIdentifier == "spin" {
wheel.spin()
}
}
Looking at the bigger
picture
Stand out with Content Extensions
Design for short, quick interactions
Increased privacy with Service Extensions
Hey there! What's up?
49 29b9 cfdc15cfe
3969 107fa
Service Extension
Looking at the bigger
picture
Cleaner code, more maintainable
Only send meaningful messages
Use identifiers to update notifications if needed
Thank you

More Related Content

What's hot (20)

The Coolest Symfony Components you’ve never heard of - DrupalCon 2017
The Coolest Symfony Components you’ve never heard of - DrupalCon 2017The Coolest Symfony Components you’ve never heard of - DrupalCon 2017
The Coolest Symfony Components you’ve never heard of - DrupalCon 2017
Ryan Weaver
 
Implementing data sync apis for mibile apps @cloudconf
Implementing data sync apis for mibile apps @cloudconfImplementing data sync apis for mibile apps @cloudconf
Implementing data sync apis for mibile apps @cloudconf
Michele Orselli
 
JavaScript Testing for Rubyists
JavaScript Testing for RubyistsJavaScript Testing for Rubyists
JavaScript Testing for Rubyists
Jamie Dyer
 
Server side data sync for mobile apps with silex
Server side data sync for mobile apps with silexServer side data sync for mobile apps with silex
Server side data sync for mobile apps with silex
Michele Orselli
 
Implementing Server Side Data Synchronization for Mobile Apps
Implementing Server Side Data Synchronization for Mobile AppsImplementing Server Side Data Synchronization for Mobile Apps
Implementing Server Side Data Synchronization for Mobile Apps
Michele Orselli
 
Python Code Camp for Professionals 3/4
Python Code Camp for Professionals 3/4Python Code Camp for Professionals 3/4
Python Code Camp for Professionals 3/4
DEVCON
 
Python Code Camp for Professionals 4/4
Python Code Camp for Professionals 4/4Python Code Camp for Professionals 4/4
Python Code Camp for Professionals 4/4
DEVCON
 
Programmers, communicate your intentions
Programmers, communicate your intentionsProgrammers, communicate your intentions
Programmers, communicate your intentions
Yael Zaritsky Perez
 
Introducing Apache Lucene with two demos
Introducing Apache Lucene with two demosIntroducing Apache Lucene with two demos
Introducing Apache Lucene with two demos
SangHee Kim
 
Tips and tricks for building api heavy ruby on rails applications
Tips and tricks for building api heavy ruby on rails applicationsTips and tricks for building api heavy ruby on rails applications
Tips and tricks for building api heavy ruby on rails applications
Tim Cull
 
Reduxing like a pro
Reduxing like a proReduxing like a pro
Reduxing like a pro
Boris Dinkevich
 
Remote controlling Parrot AR Drone with Spring Boot & Vaadin (JavaCro15)
Remote controlling Parrot AR Drone with Spring Boot & Vaadin (JavaCro15)Remote controlling Parrot AR Drone with Spring Boot & Vaadin (JavaCro15)
Remote controlling Parrot AR Drone with Spring Boot & Vaadin (JavaCro15)
Peter Lehto
 
Migrating from Ext GWT 2.x to 3.0
Migrating from Ext GWT 2.x to 3.0Migrating from Ext GWT 2.x to 3.0
Migrating from Ext GWT 2.x to 3.0
Sencha
 
Introduction to ReactJS and Redux
Introduction to ReactJS and ReduxIntroduction to ReactJS and Redux
Introduction to ReactJS and Redux
Boris Dinkevich
 
Rails 3: Dashing to the Finish
Rails 3: Dashing to the FinishRails 3: Dashing to the Finish
Rails 3: Dashing to the Finish
Yehuda Katz
 
You're Doing It Wrong
You're Doing It WrongYou're Doing It Wrong
You're Doing It Wrong
bostonrb
 
SwifTEA UI - Unidirectional data flow with SwiftUI and WeeDux
SwifTEA UI - Unidirectional data flow with SwiftUI and WeeDuxSwifTEA UI - Unidirectional data flow with SwiftUI and WeeDux
SwifTEA UI - Unidirectional data flow with SwiftUI and WeeDux
Kevin O'Neill
 
Integrating React.js with PHP projects
Integrating React.js with PHP projectsIntegrating React.js with PHP projects
Integrating React.js with PHP projects
Ignacio Martín
 
An Introduction to React -- FED Date -- IBM Design
An Introduction to React -- FED Date -- IBM DesignAn Introduction to React -- FED Date -- IBM Design
An Introduction to React -- FED Date -- IBM Design
Josh Black
 
Demystifying Hooks, Actions & Filters - WordCamp Belfast 2018
Demystifying Hooks, Actions & Filters - WordCamp Belfast 2018Demystifying Hooks, Actions & Filters - WordCamp Belfast 2018
Demystifying Hooks, Actions & Filters - WordCamp Belfast 2018
Damien Carbery
 
The Coolest Symfony Components you’ve never heard of - DrupalCon 2017
The Coolest Symfony Components you’ve never heard of - DrupalCon 2017The Coolest Symfony Components you’ve never heard of - DrupalCon 2017
The Coolest Symfony Components you’ve never heard of - DrupalCon 2017
Ryan Weaver
 
Implementing data sync apis for mibile apps @cloudconf
Implementing data sync apis for mibile apps @cloudconfImplementing data sync apis for mibile apps @cloudconf
Implementing data sync apis for mibile apps @cloudconf
Michele Orselli
 
JavaScript Testing for Rubyists
JavaScript Testing for RubyistsJavaScript Testing for Rubyists
JavaScript Testing for Rubyists
Jamie Dyer
 
Server side data sync for mobile apps with silex
Server side data sync for mobile apps with silexServer side data sync for mobile apps with silex
Server side data sync for mobile apps with silex
Michele Orselli
 
Implementing Server Side Data Synchronization for Mobile Apps
Implementing Server Side Data Synchronization for Mobile AppsImplementing Server Side Data Synchronization for Mobile Apps
Implementing Server Side Data Synchronization for Mobile Apps
Michele Orselli
 
Python Code Camp for Professionals 3/4
Python Code Camp for Professionals 3/4Python Code Camp for Professionals 3/4
Python Code Camp for Professionals 3/4
DEVCON
 
Python Code Camp for Professionals 4/4
Python Code Camp for Professionals 4/4Python Code Camp for Professionals 4/4
Python Code Camp for Professionals 4/4
DEVCON
 
Programmers, communicate your intentions
Programmers, communicate your intentionsProgrammers, communicate your intentions
Programmers, communicate your intentions
Yael Zaritsky Perez
 
Introducing Apache Lucene with two demos
Introducing Apache Lucene with two demosIntroducing Apache Lucene with two demos
Introducing Apache Lucene with two demos
SangHee Kim
 
Tips and tricks for building api heavy ruby on rails applications
Tips and tricks for building api heavy ruby on rails applicationsTips and tricks for building api heavy ruby on rails applications
Tips and tricks for building api heavy ruby on rails applications
Tim Cull
 
Remote controlling Parrot AR Drone with Spring Boot & Vaadin (JavaCro15)
Remote controlling Parrot AR Drone with Spring Boot & Vaadin (JavaCro15)Remote controlling Parrot AR Drone with Spring Boot & Vaadin (JavaCro15)
Remote controlling Parrot AR Drone with Spring Boot & Vaadin (JavaCro15)
Peter Lehto
 
Migrating from Ext GWT 2.x to 3.0
Migrating from Ext GWT 2.x to 3.0Migrating from Ext GWT 2.x to 3.0
Migrating from Ext GWT 2.x to 3.0
Sencha
 
Introduction to ReactJS and Redux
Introduction to ReactJS and ReduxIntroduction to ReactJS and Redux
Introduction to ReactJS and Redux
Boris Dinkevich
 
Rails 3: Dashing to the Finish
Rails 3: Dashing to the FinishRails 3: Dashing to the Finish
Rails 3: Dashing to the Finish
Yehuda Katz
 
You're Doing It Wrong
You're Doing It WrongYou're Doing It Wrong
You're Doing It Wrong
bostonrb
 
SwifTEA UI - Unidirectional data flow with SwiftUI and WeeDux
SwifTEA UI - Unidirectional data flow with SwiftUI and WeeDuxSwifTEA UI - Unidirectional data flow with SwiftUI and WeeDux
SwifTEA UI - Unidirectional data flow with SwiftUI and WeeDux
Kevin O'Neill
 
Integrating React.js with PHP projects
Integrating React.js with PHP projectsIntegrating React.js with PHP projects
Integrating React.js with PHP projects
Ignacio Martín
 
An Introduction to React -- FED Date -- IBM Design
An Introduction to React -- FED Date -- IBM DesignAn Introduction to React -- FED Date -- IBM Design
An Introduction to React -- FED Date -- IBM Design
Josh Black
 
Demystifying Hooks, Actions & Filters - WordCamp Belfast 2018
Demystifying Hooks, Actions & Filters - WordCamp Belfast 2018Demystifying Hooks, Actions & Filters - WordCamp Belfast 2018
Demystifying Hooks, Actions & Filters - WordCamp Belfast 2018
Damien Carbery
 

Viewers also liked (20)

Getting Oriented with MapKit: Everything you need to get started with the new...
Getting Oriented with MapKit: Everything you need to get started with the new...Getting Oriented with MapKit: Everything you need to get started with the new...
Getting Oriented with MapKit: Everything you need to get started with the new...
John Wilker
 
MapKit and SwissTrains
MapKit and SwissTrainsMapKit and SwissTrains
MapKit and SwissTrains
Vasile Cotovanu
 
Swift Bengaluru Meetup slides
Swift Bengaluru Meetup slidesSwift Bengaluru Meetup slides
Swift Bengaluru Meetup slides
Pushkar Kulkarni
 
SWIFT 3
SWIFT 3SWIFT 3
SWIFT 3
Chuong Huynh
 
Useful Tools for Making Video Games - XNA (2008)
Useful Tools for Making Video Games - XNA (2008)Useful Tools for Making Video Games - XNA (2008)
Useful Tools for Making Video Games - XNA (2008)
Korhan Bircan
 
Korhan bircan
Korhan bircanKorhan bircan
Korhan bircan
Korhan Bircan
 
ios_summit_2016_korhan
ios_summit_2016_korhanios_summit_2016_korhan
ios_summit_2016_korhan
Korhan Bircan
 
What's new in Swift 3
What's new in Swift 3What's new in Swift 3
What's new in Swift 3
Marcio Klepacz
 
WWDC 2016
WWDC 2016WWDC 2016
WWDC 2016
PiXeL16
 
iOS 9: qué hay de nuevo en la plataforma - Marcos Crispino
iOS 9: qué hay de nuevo en la plataforma - Marcos CrispinoiOS 9: qué hay de nuevo en la plataforma - Marcos Crispino
iOS 9: qué hay de nuevo en la plataforma - Marcos Crispino
GeneXus
 
Swift 3
Swift   3Swift   3
Swift 3
Michael Shrove
 
Core Data with Swift 3.0
Core Data with Swift 3.0Core Data with Swift 3.0
Core Data with Swift 3.0
Korhan Bircan
 
iOS 10
iOS 10iOS 10
iOS 10
Phil Bradley
 
WWDC 2016 Personal Recollection
WWDC 2016 Personal RecollectionWWDC 2016 Personal Recollection
WWDC 2016 Personal Recollection
Masayuki Iwai
 
I os swift 3.0 初體驗 &amp; 玩 facebook sdk
I os swift 3.0 初體驗 &amp; 玩 facebook sdkI os swift 3.0 初體驗 &amp; 玩 facebook sdk
I os swift 3.0 初體驗 &amp; 玩 facebook sdk
政斌 楊
 
iOS Parallel Automation: run faster than fast — Viktar Karanevich — SeleniumC...
iOS Parallel Automation: run faster than fast — Viktar Karanevich — SeleniumC...iOS Parallel Automation: run faster than fast — Viktar Karanevich — SeleniumC...
iOS Parallel Automation: run faster than fast — Viktar Karanevich — SeleniumC...
Badoo
 
iOS 10 - What you need to know
iOS 10 - What you need to knowiOS 10 - What you need to know
iOS 10 - What you need to know
The App Business
 
Android vs ios System Architecture in OS perspective
Android vs ios System Architecture in OS perspectiveAndroid vs ios System Architecture in OS perspective
Android vs ios System Architecture in OS perspective
Raj Pratim Bhattacharya
 
Deep Learning in iOS Tutorial
Deep Learning in iOS TutorialDeep Learning in iOS Tutorial
Deep Learning in iOS Tutorial
Anyline
 
iOS App Development Predictions 2017
iOS App Development Predictions 2017iOS App Development Predictions 2017
iOS App Development Predictions 2017
Nestweaver
 
Getting Oriented with MapKit: Everything you need to get started with the new...
Getting Oriented with MapKit: Everything you need to get started with the new...Getting Oriented with MapKit: Everything you need to get started with the new...
Getting Oriented with MapKit: Everything you need to get started with the new...
John Wilker
 
Swift Bengaluru Meetup slides
Swift Bengaluru Meetup slidesSwift Bengaluru Meetup slides
Swift Bengaluru Meetup slides
Pushkar Kulkarni
 
Useful Tools for Making Video Games - XNA (2008)
Useful Tools for Making Video Games - XNA (2008)Useful Tools for Making Video Games - XNA (2008)
Useful Tools for Making Video Games - XNA (2008)
Korhan Bircan
 
ios_summit_2016_korhan
ios_summit_2016_korhanios_summit_2016_korhan
ios_summit_2016_korhan
Korhan Bircan
 
WWDC 2016
WWDC 2016WWDC 2016
WWDC 2016
PiXeL16
 
iOS 9: qué hay de nuevo en la plataforma - Marcos Crispino
iOS 9: qué hay de nuevo en la plataforma - Marcos CrispinoiOS 9: qué hay de nuevo en la plataforma - Marcos Crispino
iOS 9: qué hay de nuevo en la plataforma - Marcos Crispino
GeneXus
 
Core Data with Swift 3.0
Core Data with Swift 3.0Core Data with Swift 3.0
Core Data with Swift 3.0
Korhan Bircan
 
WWDC 2016 Personal Recollection
WWDC 2016 Personal RecollectionWWDC 2016 Personal Recollection
WWDC 2016 Personal Recollection
Masayuki Iwai
 
I os swift 3.0 初體驗 &amp; 玩 facebook sdk
I os swift 3.0 初體驗 &amp; 玩 facebook sdkI os swift 3.0 初體驗 &amp; 玩 facebook sdk
I os swift 3.0 初體驗 &amp; 玩 facebook sdk
政斌 楊
 
iOS Parallel Automation: run faster than fast — Viktar Karanevich — SeleniumC...
iOS Parallel Automation: run faster than fast — Viktar Karanevich — SeleniumC...iOS Parallel Automation: run faster than fast — Viktar Karanevich — SeleniumC...
iOS Parallel Automation: run faster than fast — Viktar Karanevich — SeleniumC...
Badoo
 
iOS 10 - What you need to know
iOS 10 - What you need to knowiOS 10 - What you need to know
iOS 10 - What you need to know
The App Business
 
Android vs ios System Architecture in OS perspective
Android vs ios System Architecture in OS perspectiveAndroid vs ios System Architecture in OS perspective
Android vs ios System Architecture in OS perspective
Raj Pratim Bhattacharya
 
Deep Learning in iOS Tutorial
Deep Learning in iOS TutorialDeep Learning in iOS Tutorial
Deep Learning in iOS Tutorial
Anyline
 
iOS App Development Predictions 2017
iOS App Development Predictions 2017iOS App Development Predictions 2017
iOS App Development Predictions 2017
Nestweaver
 

Similar to Improving apps with iOS 10 notifications (do iOS 2016) (20)

What's New in User Notifications Framework - WWDC16. Meetup @Wantedly with 日本...
What's New in User Notifications Framework - WWDC16. Meetup @Wantedly with 日本...What's New in User Notifications Framework - WWDC16. Meetup @Wantedly with 日本...
What's New in User Notifications Framework - WWDC16. Meetup @Wantedly with 日本...
将之 小野
 
Push Notification
Push NotificationPush Notification
Push Notification
Software Infrastructure
 
Learning Android Part 2/6
Learning Android Part 2/6Learning Android Part 2/6
Learning Android Part 2/6
Girish Bellalcheru
 
Adopting 3D Touch in your apps
Adopting 3D Touch in your appsAdopting 3D Touch in your apps
Adopting 3D Touch in your apps
Juan C Catalan
 
Hello world ios v1
Hello world ios v1Hello world ios v1
Hello world ios v1
Teodoro Alonso
 
Cómo tener analíticas en tu app y no volverte loco
Cómo tener analíticas en tu app y no volverte locoCómo tener analíticas en tu app y no volverte loco
Cómo tener analíticas en tu app y no volverte loco
Gemma Del Olmo
 
How to Build & Develop Responsive Open Learning Environments with the ROLE SDK
How to Build & Develop Responsive Open Learning Environments with the ROLE SDKHow to Build & Develop Responsive Open Learning Environments with the ROLE SDK
How to Build & Develop Responsive Open Learning Environments with the ROLE SDK
Dominik Renzel
 
Getting Started with Tizen TV Web Apps
Getting Started with Tizen TV Web AppsGetting Started with Tizen TV Web Apps
Getting Started with Tizen TV Web Apps
Ryo Jin
 
Titanium Appcelerator - Beginners
Titanium Appcelerator - BeginnersTitanium Appcelerator - Beginners
Titanium Appcelerator - Beginners
Ambarish Hazarnis
 
Quick Start to iOS Development
Quick Start to iOS DevelopmentQuick Start to iOS Development
Quick Start to iOS Development
Jussi Pohjolainen
 
How to build twitter bot using golang from scratch
How to build twitter bot using golang from scratchHow to build twitter bot using golang from scratch
How to build twitter bot using golang from scratch
Katy Slemon
 
Mobile Application Development with JUCE and Native API’s
Mobile Application Development with JUCE and Native API’sMobile Application Development with JUCE and Native API’s
Mobile Application Development with JUCE and Native API’s
Adam Wilson
 
Android Wearables ii
Android Wearables iiAndroid Wearables ii
Android Wearables ii
Ketan Raval
 
Push Notifications: How to add them to a Flutter App
Push Notifications: How to add them to a Flutter AppPush Notifications: How to add them to a Flutter App
Push Notifications: How to add them to a Flutter App
Fibonalabs
 
Developing for android wear
Developing for android wearDeveloping for android wear
Developing for android wear
Thomas Oldervoll
 
Firefox OS workshop, Colombia
Firefox OS workshop, ColombiaFirefox OS workshop, Colombia
Firefox OS workshop, Colombia
Robert Nyman
 
Ruby motion勉強会 2012年7月
Ruby motion勉強会 2012年7月Ruby motion勉強会 2012年7月
Ruby motion勉強会 2012年7月
Eihiro Saishu
 
How to Use Twilio Video Plugin for Android with Flutter.pptx
How to Use Twilio Video Plugin for Android with Flutter.pptxHow to Use Twilio Video Plugin for Android with Flutter.pptx
How to Use Twilio Video Plugin for Android with Flutter.pptx
RubenGray1
 
Firebase & SwiftUI Workshop
Firebase & SwiftUI WorkshopFirebase & SwiftUI Workshop
Firebase & SwiftUI Workshop
Peter Friese
 
From object oriented to functional domain modeling
From object oriented to functional domain modelingFrom object oriented to functional domain modeling
From object oriented to functional domain modeling
Mario Fusco
 
What's New in User Notifications Framework - WWDC16. Meetup @Wantedly with 日本...
What's New in User Notifications Framework - WWDC16. Meetup @Wantedly with 日本...What's New in User Notifications Framework - WWDC16. Meetup @Wantedly with 日本...
What's New in User Notifications Framework - WWDC16. Meetup @Wantedly with 日本...
将之 小野
 
Adopting 3D Touch in your apps
Adopting 3D Touch in your appsAdopting 3D Touch in your apps
Adopting 3D Touch in your apps
Juan C Catalan
 
Cómo tener analíticas en tu app y no volverte loco
Cómo tener analíticas en tu app y no volverte locoCómo tener analíticas en tu app y no volverte loco
Cómo tener analíticas en tu app y no volverte loco
Gemma Del Olmo
 
How to Build & Develop Responsive Open Learning Environments with the ROLE SDK
How to Build & Develop Responsive Open Learning Environments with the ROLE SDKHow to Build & Develop Responsive Open Learning Environments with the ROLE SDK
How to Build & Develop Responsive Open Learning Environments with the ROLE SDK
Dominik Renzel
 
Getting Started with Tizen TV Web Apps
Getting Started with Tizen TV Web AppsGetting Started with Tizen TV Web Apps
Getting Started with Tizen TV Web Apps
Ryo Jin
 
Titanium Appcelerator - Beginners
Titanium Appcelerator - BeginnersTitanium Appcelerator - Beginners
Titanium Appcelerator - Beginners
Ambarish Hazarnis
 
Quick Start to iOS Development
Quick Start to iOS DevelopmentQuick Start to iOS Development
Quick Start to iOS Development
Jussi Pohjolainen
 
How to build twitter bot using golang from scratch
How to build twitter bot using golang from scratchHow to build twitter bot using golang from scratch
How to build twitter bot using golang from scratch
Katy Slemon
 
Mobile Application Development with JUCE and Native API’s
Mobile Application Development with JUCE and Native API’sMobile Application Development with JUCE and Native API’s
Mobile Application Development with JUCE and Native API’s
Adam Wilson
 
Android Wearables ii
Android Wearables iiAndroid Wearables ii
Android Wearables ii
Ketan Raval
 
Push Notifications: How to add them to a Flutter App
Push Notifications: How to add them to a Flutter AppPush Notifications: How to add them to a Flutter App
Push Notifications: How to add them to a Flutter App
Fibonalabs
 
Developing for android wear
Developing for android wearDeveloping for android wear
Developing for android wear
Thomas Oldervoll
 
Firefox OS workshop, Colombia
Firefox OS workshop, ColombiaFirefox OS workshop, Colombia
Firefox OS workshop, Colombia
Robert Nyman
 
Ruby motion勉強会 2012年7月
Ruby motion勉強会 2012年7月Ruby motion勉強会 2012年7月
Ruby motion勉強会 2012年7月
Eihiro Saishu
 
How to Use Twilio Video Plugin for Android with Flutter.pptx
How to Use Twilio Video Plugin for Android with Flutter.pptxHow to Use Twilio Video Plugin for Android with Flutter.pptx
How to Use Twilio Video Plugin for Android with Flutter.pptx
RubenGray1
 
Firebase & SwiftUI Workshop
Firebase & SwiftUI WorkshopFirebase & SwiftUI Workshop
Firebase & SwiftUI Workshop
Peter Friese
 
From object oriented to functional domain modeling
From object oriented to functional domain modelingFrom object oriented to functional domain modeling
From object oriented to functional domain modeling
Mario Fusco
 

More from Donny Wals (13)

Your 🧠 on Swift Concurrency
Your 🧠 on Swift ConcurrencyYour 🧠 on Swift Concurrency
Your 🧠 on Swift Concurrency
Donny Wals
 
Using Combine, SwiftUI and callAsFunction to build an experimental localizati...
Using Combine, SwiftUI and callAsFunction to build an experimental localizati...Using Combine, SwiftUI and callAsFunction to build an experimental localizati...
Using Combine, SwiftUI and callAsFunction to build an experimental localizati...
Donny Wals
 
The combine triad
The combine triadThe combine triad
The combine triad
Donny Wals
 
Building reusable components with generics and protocols
Building reusable components with generics and protocolsBuilding reusable components with generics and protocols
Building reusable components with generics and protocols
Donny Wals
 
Adopting tdd in the workplace
Adopting tdd in the workplaceAdopting tdd in the workplace
Adopting tdd in the workplace
Donny Wals
 
The Testing Games: Mocking, yay!
The Testing Games: Mocking, yay!The Testing Games: Mocking, yay!
The Testing Games: Mocking, yay!
Donny Wals
 
JSON and Swift, Still A Better Love Story Than Twilight
JSON and Swift, Still A Better Love Story Than TwilightJSON and Swift, Still A Better Love Story Than Twilight
JSON and Swift, Still A Better Love Story Than Twilight
Donny Wals
 
Adopting tdd in the workplace
Adopting tdd in the workplaceAdopting tdd in the workplace
Adopting tdd in the workplace
Donny Wals
 
In Defense Of Core Data
In Defense Of Core DataIn Defense Of Core Data
In Defense Of Core Data
Donny Wals
 
Talk - git task managers and ci
Talk - git task managers and ciTalk - git task managers and ci
Talk - git task managers and ci
Donny Wals
 
Developing in the Fastlane -> How LookLive uses Fastlane to automate and spee...
Developing in the Fastlane -> How LookLive uses Fastlane to automate and spee...Developing in the Fastlane -> How LookLive uses Fastlane to automate and spee...
Developing in the Fastlane -> How LookLive uses Fastlane to automate and spee...
Donny Wals
 
Marketing strategie Arto
Marketing strategie ArtoMarketing strategie Arto
Marketing strategie Arto
Donny Wals
 
Hoorcollege Flash 9-2-2012
Hoorcollege Flash 9-2-2012Hoorcollege Flash 9-2-2012
Hoorcollege Flash 9-2-2012
Donny Wals
 
Your 🧠 on Swift Concurrency
Your 🧠 on Swift ConcurrencyYour 🧠 on Swift Concurrency
Your 🧠 on Swift Concurrency
Donny Wals
 
Using Combine, SwiftUI and callAsFunction to build an experimental localizati...
Using Combine, SwiftUI and callAsFunction to build an experimental localizati...Using Combine, SwiftUI and callAsFunction to build an experimental localizati...
Using Combine, SwiftUI and callAsFunction to build an experimental localizati...
Donny Wals
 
The combine triad
The combine triadThe combine triad
The combine triad
Donny Wals
 
Building reusable components with generics and protocols
Building reusable components with generics and protocolsBuilding reusable components with generics and protocols
Building reusable components with generics and protocols
Donny Wals
 
Adopting tdd in the workplace
Adopting tdd in the workplaceAdopting tdd in the workplace
Adopting tdd in the workplace
Donny Wals
 
The Testing Games: Mocking, yay!
The Testing Games: Mocking, yay!The Testing Games: Mocking, yay!
The Testing Games: Mocking, yay!
Donny Wals
 
JSON and Swift, Still A Better Love Story Than Twilight
JSON and Swift, Still A Better Love Story Than TwilightJSON and Swift, Still A Better Love Story Than Twilight
JSON and Swift, Still A Better Love Story Than Twilight
Donny Wals
 
Adopting tdd in the workplace
Adopting tdd in the workplaceAdopting tdd in the workplace
Adopting tdd in the workplace
Donny Wals
 
In Defense Of Core Data
In Defense Of Core DataIn Defense Of Core Data
In Defense Of Core Data
Donny Wals
 
Talk - git task managers and ci
Talk - git task managers and ciTalk - git task managers and ci
Talk - git task managers and ci
Donny Wals
 
Developing in the Fastlane -> How LookLive uses Fastlane to automate and spee...
Developing in the Fastlane -> How LookLive uses Fastlane to automate and spee...Developing in the Fastlane -> How LookLive uses Fastlane to automate and spee...
Developing in the Fastlane -> How LookLive uses Fastlane to automate and spee...
Donny Wals
 
Marketing strategie Arto
Marketing strategie ArtoMarketing strategie Arto
Marketing strategie Arto
Donny Wals
 
Hoorcollege Flash 9-2-2012
Hoorcollege Flash 9-2-2012Hoorcollege Flash 9-2-2012
Hoorcollege Flash 9-2-2012
Donny Wals
 

Recently uploaded (20)

Securiport - A Border Security Company
Securiport  -  A Border Security CompanySecuriport  -  A Border Security Company
Securiport - A Border Security Company
Securiport
 
AI Emotional Actors: “When Machines Learn to Feel and Perform"
AI Emotional Actors:  “When Machines Learn to Feel and Perform"AI Emotional Actors:  “When Machines Learn to Feel and Perform"
AI Emotional Actors: “When Machines Learn to Feel and Perform"
AkashKumar809858
 
Dev Dives: System-to-system integration with UiPath API Workflows
Dev Dives: System-to-system integration with UiPath API WorkflowsDev Dives: System-to-system integration with UiPath API Workflows
Dev Dives: System-to-system integration with UiPath API Workflows
UiPathCommunity
 
Introducing FME Realize: A New Era of Spatial Computing and AR
Introducing FME Realize: A New Era of Spatial Computing and ARIntroducing FME Realize: A New Era of Spatial Computing and AR
Introducing FME Realize: A New Era of Spatial Computing and AR
Safe Software
 
Data Virtualization: Bringing the Power of FME to Any Application
Data Virtualization: Bringing the Power of FME to Any ApplicationData Virtualization: Bringing the Power of FME to Any Application
Data Virtualization: Bringing the Power of FME to Any Application
Safe Software
 
Improving Developer Productivity With DORA, SPACE, and DevEx
Improving Developer Productivity With DORA, SPACE, and DevExImproving Developer Productivity With DORA, SPACE, and DevEx
Improving Developer Productivity With DORA, SPACE, and DevEx
Justin Reock
 
Maxx nft market place new generation nft marketing place
Maxx nft market place new generation nft marketing placeMaxx nft market place new generation nft marketing place
Maxx nft market place new generation nft marketing place
usersalmanrazdelhi
 
Supercharge Your AI Development with Local LLMs
Supercharge Your AI Development with Local LLMsSupercharge Your AI Development with Local LLMs
Supercharge Your AI Development with Local LLMs
Francesco Corti
 
Let’s Get Slack Certified! 🚀- Slack Community
Let’s Get Slack Certified! 🚀- Slack CommunityLet’s Get Slack Certified! 🚀- Slack Community
Let’s Get Slack Certified! 🚀- Slack Community
SanjeetMishra29
 
Microsoft Build 2025 takeaways in one presentation
Microsoft Build 2025 takeaways in one presentationMicrosoft Build 2025 takeaways in one presentation
Microsoft Build 2025 takeaways in one presentation
Digitalmara
 
Jeremy Millul - A Talented Software Developer
Jeremy Millul - A Talented Software DeveloperJeremy Millul - A Talented Software Developer
Jeremy Millul - A Talented Software Developer
Jeremy Millul
 
Cognitive Chasms - A Typology of GenAI Failure Failure Modes
Cognitive Chasms - A Typology of GenAI Failure Failure ModesCognitive Chasms - A Typology of GenAI Failure Failure Modes
Cognitive Chasms - A Typology of GenAI Failure Failure Modes
Dr. Tathagat Varma
 
Dr Jimmy Schwarzkopf presentation on the SUMMIT 2025 A
Dr Jimmy Schwarzkopf presentation on the SUMMIT 2025 ADr Jimmy Schwarzkopf presentation on the SUMMIT 2025 A
Dr Jimmy Schwarzkopf presentation on the SUMMIT 2025 A
Dr. Jimmy Schwarzkopf
 
GDG Cloud Southlake #43: Tommy Todd: The Quantum Apocalypse: A Looming Threat...
GDG Cloud Southlake #43: Tommy Todd: The Quantum Apocalypse: A Looming Threat...GDG Cloud Southlake #43: Tommy Todd: The Quantum Apocalypse: A Looming Threat...
GDG Cloud Southlake #43: Tommy Todd: The Quantum Apocalypse: A Looming Threat...
James Anderson
 
Protecting Your Sensitive Data with Microsoft Purview - IRMS 2025
Protecting Your Sensitive Data with Microsoft Purview - IRMS 2025Protecting Your Sensitive Data with Microsoft Purview - IRMS 2025
Protecting Your Sensitive Data with Microsoft Purview - IRMS 2025
Nikki Chapple
 
ECS25 - The adventures of a Microsoft 365 Platform Owner - Website.pptx
ECS25 - The adventures of a Microsoft 365 Platform Owner - Website.pptxECS25 - The adventures of a Microsoft 365 Platform Owner - Website.pptx
ECS25 - The adventures of a Microsoft 365 Platform Owner - Website.pptx
Jasper Oosterveld
 
TrustArc Webinar: Mastering Privacy Contracting
TrustArc Webinar: Mastering Privacy ContractingTrustArc Webinar: Mastering Privacy Contracting
TrustArc Webinar: Mastering Privacy Contracting
TrustArc
 
Offshore IT Support: Balancing In-House and Offshore Help Desk Technicians
Offshore IT Support: Balancing In-House and Offshore Help Desk TechniciansOffshore IT Support: Balancing In-House and Offshore Help Desk Technicians
Offshore IT Support: Balancing In-House and Offshore Help Desk Technicians
john823664
 
Cyber security cyber security cyber security cyber security cyber security cy...
Cyber security cyber security cyber security cyber security cyber security cy...Cyber security cyber security cyber security cyber security cyber security cy...
Cyber security cyber security cyber security cyber security cyber security cy...
pranavbodhak
 
Agentic AI - The New Era of Intelligence
Agentic AI - The New Era of IntelligenceAgentic AI - The New Era of Intelligence
Agentic AI - The New Era of Intelligence
Muzammil Shah
 
Securiport - A Border Security Company
Securiport  -  A Border Security CompanySecuriport  -  A Border Security Company
Securiport - A Border Security Company
Securiport
 
AI Emotional Actors: “When Machines Learn to Feel and Perform"
AI Emotional Actors:  “When Machines Learn to Feel and Perform"AI Emotional Actors:  “When Machines Learn to Feel and Perform"
AI Emotional Actors: “When Machines Learn to Feel and Perform"
AkashKumar809858
 
Dev Dives: System-to-system integration with UiPath API Workflows
Dev Dives: System-to-system integration with UiPath API WorkflowsDev Dives: System-to-system integration with UiPath API Workflows
Dev Dives: System-to-system integration with UiPath API Workflows
UiPathCommunity
 
Introducing FME Realize: A New Era of Spatial Computing and AR
Introducing FME Realize: A New Era of Spatial Computing and ARIntroducing FME Realize: A New Era of Spatial Computing and AR
Introducing FME Realize: A New Era of Spatial Computing and AR
Safe Software
 
Data Virtualization: Bringing the Power of FME to Any Application
Data Virtualization: Bringing the Power of FME to Any ApplicationData Virtualization: Bringing the Power of FME to Any Application
Data Virtualization: Bringing the Power of FME to Any Application
Safe Software
 
Improving Developer Productivity With DORA, SPACE, and DevEx
Improving Developer Productivity With DORA, SPACE, and DevExImproving Developer Productivity With DORA, SPACE, and DevEx
Improving Developer Productivity With DORA, SPACE, and DevEx
Justin Reock
 
Maxx nft market place new generation nft marketing place
Maxx nft market place new generation nft marketing placeMaxx nft market place new generation nft marketing place
Maxx nft market place new generation nft marketing place
usersalmanrazdelhi
 
Supercharge Your AI Development with Local LLMs
Supercharge Your AI Development with Local LLMsSupercharge Your AI Development with Local LLMs
Supercharge Your AI Development with Local LLMs
Francesco Corti
 
Let’s Get Slack Certified! 🚀- Slack Community
Let’s Get Slack Certified! 🚀- Slack CommunityLet’s Get Slack Certified! 🚀- Slack Community
Let’s Get Slack Certified! 🚀- Slack Community
SanjeetMishra29
 
Microsoft Build 2025 takeaways in one presentation
Microsoft Build 2025 takeaways in one presentationMicrosoft Build 2025 takeaways in one presentation
Microsoft Build 2025 takeaways in one presentation
Digitalmara
 
Jeremy Millul - A Talented Software Developer
Jeremy Millul - A Talented Software DeveloperJeremy Millul - A Talented Software Developer
Jeremy Millul - A Talented Software Developer
Jeremy Millul
 
Cognitive Chasms - A Typology of GenAI Failure Failure Modes
Cognitive Chasms - A Typology of GenAI Failure Failure ModesCognitive Chasms - A Typology of GenAI Failure Failure Modes
Cognitive Chasms - A Typology of GenAI Failure Failure Modes
Dr. Tathagat Varma
 
Dr Jimmy Schwarzkopf presentation on the SUMMIT 2025 A
Dr Jimmy Schwarzkopf presentation on the SUMMIT 2025 ADr Jimmy Schwarzkopf presentation on the SUMMIT 2025 A
Dr Jimmy Schwarzkopf presentation on the SUMMIT 2025 A
Dr. Jimmy Schwarzkopf
 
GDG Cloud Southlake #43: Tommy Todd: The Quantum Apocalypse: A Looming Threat...
GDG Cloud Southlake #43: Tommy Todd: The Quantum Apocalypse: A Looming Threat...GDG Cloud Southlake #43: Tommy Todd: The Quantum Apocalypse: A Looming Threat...
GDG Cloud Southlake #43: Tommy Todd: The Quantum Apocalypse: A Looming Threat...
James Anderson
 
Protecting Your Sensitive Data with Microsoft Purview - IRMS 2025
Protecting Your Sensitive Data with Microsoft Purview - IRMS 2025Protecting Your Sensitive Data with Microsoft Purview - IRMS 2025
Protecting Your Sensitive Data with Microsoft Purview - IRMS 2025
Nikki Chapple
 
ECS25 - The adventures of a Microsoft 365 Platform Owner - Website.pptx
ECS25 - The adventures of a Microsoft 365 Platform Owner - Website.pptxECS25 - The adventures of a Microsoft 365 Platform Owner - Website.pptx
ECS25 - The adventures of a Microsoft 365 Platform Owner - Website.pptx
Jasper Oosterveld
 
TrustArc Webinar: Mastering Privacy Contracting
TrustArc Webinar: Mastering Privacy ContractingTrustArc Webinar: Mastering Privacy Contracting
TrustArc Webinar: Mastering Privacy Contracting
TrustArc
 
Offshore IT Support: Balancing In-House and Offshore Help Desk Technicians
Offshore IT Support: Balancing In-House and Offshore Help Desk TechniciansOffshore IT Support: Balancing In-House and Offshore Help Desk Technicians
Offshore IT Support: Balancing In-House and Offshore Help Desk Technicians
john823664
 
Cyber security cyber security cyber security cyber security cyber security cy...
Cyber security cyber security cyber security cyber security cyber security cy...Cyber security cyber security cyber security cyber security cyber security cy...
Cyber security cyber security cyber security cyber security cyber security cy...
pranavbodhak
 
Agentic AI - The New Era of Intelligence
Agentic AI - The New Era of IntelligenceAgentic AI - The New Era of Intelligence
Agentic AI - The New Era of Intelligence
Muzammil Shah
 

Improving apps with iOS 10 notifications (do iOS 2016)

  • 1. 1 Hi, I’m Donny Improving apps with iOS 10 notifications Because notifications can be pretty cool
  • 2. 2 Contents A quick history of notifications Introduction to the UserNotifications framework Service Extensions Content Extensions The bigger picture
  • 3. iOS 7 Text only notifications Limited information and context
  • 4. iOS 8 Simple actions Apple had a Text Input action for quick replies
  • 5. iOS 9 Developers could add the Text Input action Less need to open the app
  • 6. Everything < iOS 10 The difference between local and remote func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) { } func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) { } func application(_ application: UIApplication, didReceive notification: UILocalNotification) { } func application(_ application: UIApplication, didRegister notificationSettings: UIUserNotificationSettings) { }
  • 7. Everything < iOS 10 And of course, it all goes in AppDelegate func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) { } func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) { } func application(_ application: UIApplication, didReceive notification: UILocalNotification) { } func application(_ application: UIApplication, didRegister notificationSettings: UIUserNotificationSettings) { }
  • 8. Everything < iOS 10 Showing notifications while foregrounded There’s one more thing…
  • 9. iOS 10 Media in notifications Custom user interface True end-to-end encryption Unified framework
  • 10. UserNotification at a glance Unified Local and Remote Single registration handler Handle notifications through a delegate Not compatible with < iOS 10 func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) { } func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) { } let notificationCenter = UNUserNotificationCenter.current() notificationCenter.getNotificationSettings { settings in if settings.authorizationStatus == .notDetermined { notificationCenter.requestAuthorization(options: [.badge, .alert]) { success, error in // handle status } } }
  • 11. UserNotification at a glance UIApplication.shared.registerForRemoteNotifications() APNS func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) { }
  • 12. UserNotification at a glance let content = UNMutableNotificationContent() content.title = “Next speaker"
 content.body = “Donny is up next" content.badge = 1 let path = Bundle.main.path(forResource: "thumbs", ofType: "png")! let imageUrl = URL(fileURLWithPath: path) let image = try! UNNotificationAttachment(identifier: "thumbs-up", url: imageUrl, options: nil) content.attachments = [image] let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 10, repeats: false) let request = UNNotificationRequest(identifier: “nextSpeaker", content: content, trigger: trigger) notificationCenter.add(request, withCompletionHandler: nil) Create notification contents Schedule the notification Update notification contents
  • 13. UserNotification at a glance Create notification contents Schedule the notification Update notification contents
  • 14. And when you're in the foreground... func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) { completionHandler([.alert, .sound]) }
  • 15. Service extensions Hey there! What's up? 49 29b9 cfdc15cfe 3969 107fa Service Extension End to end encryption Send push with mutable-content: 1 Update contents Limited time available
  • 16. Service extensions override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) { self.contentHandler = contentHandler decryptedContent = (request.content.mutableCopy() as? UNMutableNotificationContent) if let decryptedContent = decryptedContent { decryptedContent.title = "Updated title" contentHandler(decryptedContent) } } override func serviceExtensionTimeWillExpire() { if let contentHandler = contentHandler, let decryptedContent = decryptedContent { contentHandler(decryptedContent) } } End to end encryption Send push with mutable-content: 1 Update contents Limited time available
  • 17. Content extensions View controller based extension Extensions are tied to categories Set content ratio in .plist Actions are to added to notifications separately <key>NSExtensionAttributes</key> <dict> <key>UNNotificationExtensionCategory</key> <string>wheel</string> <key>UNNotificationExtensionInitialContentSizeRatio</ key> <real>1</real> </dict> let content = UNMutableNotificationContent() content.title = "Spin the wheel?" content.body = "Win tickets for Do iOS" content.categoryIdentifier = "wheel" content.badge = 1
  • 18. Content extensions Bring your own UI Extensions don’t receive touches Extensions do receive notification responses Even less need for users to open your app func didReceive(_ response: UNNotificationResponse, completionHandler completion: @escaping (UNNotificationContentExtensionResponseOption) -> Void) { if response.actionIdentifier == "spin" { wheel.spin() } }
  • 19. Looking at the bigger picture Stand out with Content Extensions Design for short, quick interactions Increased privacy with Service Extensions Hey there! What's up? 49 29b9 cfdc15cfe 3969 107fa Service Extension
  • 20. Looking at the bigger picture Cleaner code, more maintainable Only send meaningful messages Use identifiers to update notifications if needed