what’s new in ios notifications - apple inc.€¦ · what’s new in ios notifications core os...
TRANSCRIPT
![Page 1: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/1.jpg)
© 2014 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple.
#WWDC14
What’s New in iOS Notifications
Core OS
Session 713 Rhett Dickson Software Engineer
!
Dan Kurtz Software Engineer
![Page 2: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/2.jpg)
Previously in iOS Notifications
User notifications
Silent notifications
![Page 3: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/3.jpg)
User NotificationsWhat
Daniel Kurtz nowHello world!
![Page 4: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/4.jpg)
User NotificationsWhat
Daniel Kurtz nowHello world!
![Page 5: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/5.jpg)
User NotificationsWhat
Daniel Kurtz nowHello world!
![Page 6: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/6.jpg)
User NotificationsWhat
Daniel Kurtz nowHello world!
![Page 7: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/7.jpg)
User NotificationsWhere
![Page 8: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/8.jpg)
User NotificationsWhere
![Page 9: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/9.jpg)
User NotificationsWhere
![Page 10: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/10.jpg)
User NotificationsWhere
![Page 11: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/11.jpg)
Where Notifications Come From
APNsApp
![Page 12: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/12.jpg)
Where Notifications Come From
APNs
My App Hello world!
App
![Page 13: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/13.jpg)
Where Notifications Come From
APNsApp
![Page 14: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/14.jpg)
Where Notifications Come From
APNs
My App Hello world!
App
aps { alert: {...}
}
![Page 15: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/15.jpg)
Where Notifications Come From
APNsApp
![Page 16: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/16.jpg)
Where Notifications Come From
APNsApp
![Page 17: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/17.jpg)
Where Notifications Come From
APNsApp
aps { content-available: 1
}
![Page 18: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/18.jpg)
Where Notifications Come From
APNsApp
aps { content-available: 1
}
Content Server
![Page 19: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/19.jpg)
Where Notifications Come From
![Page 20: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/20.jpg)
Today
User Notifications
Notification Actions
Remote Notifications
Location Notifications
![Page 21: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/21.jpg)
User Notifications
![Page 22: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/22.jpg)
User NotificationsWhat’s new
Must register to use
Require user approval
![Page 23: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/23.jpg)
User NotificationsRegistering
UIUserNotificationType types = UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert; !
UIUserNotificationSettings *mySettings = [UIUserNotificationSettings settingsForTypes:types categories:nil]; !
[[UIApplication sharedApplication] registerUserNotificationSettings:mySettings];
![Page 24: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/24.jpg)
User NotificationsRegistering
UIUserNotificationType types = UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert; !
UIUserNotificationSettings *mySettings = [UIUserNotificationSettings settingsForTypes:types categories:nil]; !
[[UIApplication sharedApplication] registerUserNotificationSettings:mySettings];
![Page 25: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/25.jpg)
User NotificationsRegistering
UIUserNotificationType types = UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert; !
UIUserNotificationSettings *mySettings = [UIUserNotificationSettings settingsForTypes:types categories:nil]; !
[[UIApplication sharedApplication] registerUserNotificationSettings:mySettings];
![Page 26: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/26.jpg)
User NotificationsRegistering
UIUserNotificationType types = UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert; !
UIUserNotificationSettings *mySettings = [UIUserNotificationSettings settingsForTypes:types categories:nil]; !
[[UIApplication sharedApplication] registerUserNotificationSettings:mySettings];
![Page 27: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/27.jpg)
User NotificationsRegistering
UIUserNotificationType types = UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert; !
UIUserNotificationSettings *mySettings = [UIUserNotificationSettings settingsForTypes:types categories:nil]; !
[[UIApplication sharedApplication] registerUserNotificationSettings:mySettings];
![Page 28: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/28.jpg)
User NotificationsRegistering
UIUserNotificationType types = UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert; !
UIUserNotificationSettings *mySettings = [UIUserNotificationSettings settingsForTypes:types categories:nil]; !
[[UIApplication sharedApplication] registerUserNotificationSettings:mySettings]; “My App” Would Like to Send
You Notifications
![Page 29: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/29.jpg)
User NotificationsUIApplicationDelegate Callback
- (void)application:(UIApplication *)application didRegisterUserNotificationSettings: (UIUserNotificationSettings *)notificationSettings { !
// user has allowed receiving user notifications of the following types UIUserNotificationType allowedTypes = [notificationSettings types]; !
}
![Page 30: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/30.jpg)
User NotificationsUIApplicationDelegate Callback
- (void)application:(UIApplication *)application didRegisterUserNotificationSettings: (UIUserNotificationSettings *)notificationSettings { !
// user has allowed receiving user notifications of the following types UIUserNotificationType allowedTypes = [notificationSettings types]; !
}
![Page 31: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/31.jpg)
User NotificationsUIApplicationDelegate Callback
- (void)application:(UIApplication *)application didRegisterUserNotificationSettings: (UIUserNotificationSettings *)notificationSettings { !
// user has allowed receiving user notifications of the following types UIUserNotificationType allowedTypes = [notificationSettings types]; !
}
![Page 32: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/32.jpg)
User NotificationsGetting Settings
- (void)getReadyForNotification { // ... !
// check to make sure we still need to show notification UIUserNotificationSettings *currentSettings = [[UIApplication sharedApplication] currentUserNotificationSettings]; !
[self checkSettings:currentSettings]; }
![Page 33: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/33.jpg)
User NotificationsGetting Settings
- (void)getReadyForNotification { // ... !
// check to make sure we still need to show notification UIUserNotificationSettings *currentSettings = [[UIApplication sharedApplication] currentUserNotificationSettings]; !
[self checkSettings:currentSettings]; }
![Page 34: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/34.jpg)
User Notifications
-[UIApplication registerUserNotificationSettings:] -[UIApplication currentNotificationSettings] +[UIUserNotificationSettings settingsForTypes:categories:]
![Page 35: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/35.jpg)
Notification Actions
![Page 36: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/36.jpg)
Notification ActionsIn iOS 7
Notification Center Banner
![Page 37: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/37.jpg)
Notification ActionsIn iOS 7
Notification Center Banner
![Page 38: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/38.jpg)
Notification ActionsIn iOS 7
Notification Center Banner
![Page 39: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/39.jpg)
Notification ActionsIn iOS 7
Notification Center Banner
![Page 40: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/40.jpg)
Notification ActionsIn iOS 7
Notification Center Banner
![Page 41: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/41.jpg)
Notification ActionsIn iOS 7
Notification Center Banner
![Page 42: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/42.jpg)
Notification ActionsIn iOS 8
![Page 43: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/43.jpg)
Notification ActionsIn iOS 8
![Page 44: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/44.jpg)
Notification ActionsIn iOS 8
![Page 45: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/45.jpg)
Notification ActionsIn iOS 8
![Page 46: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/46.jpg)
Notification ActionsIn iOS 8
![Page 47: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/47.jpg)
Notification ActionsIn iOS 8
![Page 48: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/48.jpg)
Notification ActionsIn iOS 8
![Page 49: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/49.jpg)
Notification ActionsIn iOS 8
![Page 50: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/50.jpg)
Using Notification Actions
Register Actions
Push/Schedule Notification
Handle Action
![Page 51: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/51.jpg)
Using Notification Actions
![Page 52: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/52.jpg)
Using Notification Actions
Register Actions
Push/Schedule Notification
Handle Action
![Page 53: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/53.jpg)
Using Notification Actions
Register Actions
Push/Schedule Notification
Handle Action
![Page 54: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/54.jpg)
Notification Actions RegistrationActions
UIMutableUserNotificationAction *acceptAction = [[UIMutableUserNotificationAction alloc] init]; !
acceptAction.identifier = @"ACCEPT_IDENTIFIER"; !
acceptAction.title = @"Accept"; !
// Given seconds, not minutes, to run in the background acceptAction.activationMode = UIUserNotificationActivationModeBackground; !
acceptAction.destructive = NO; !
// If YES requires passcode, but does not unlock the device acceptAction.authenticationRequired = NO;
![Page 55: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/55.jpg)
Notification Actions RegistrationActions
UIMutableUserNotificationAction *acceptAction = [[UIMutableUserNotificationAction alloc] init]; !
acceptAction.identifier = @"ACCEPT_IDENTIFIER"; !
acceptAction.title = @"Accept"; !
// Given seconds, not minutes, to run in the background acceptAction.activationMode = UIUserNotificationActivationModeBackground; !
acceptAction.destructive = NO; !
// If YES requires passcode, but does not unlock the device acceptAction.authenticationRequired = NO;
![Page 56: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/56.jpg)
Notification Actions RegistrationActions
UIMutableUserNotificationAction *acceptAction = [[UIMutableUserNotificationAction alloc] init]; !
acceptAction.identifier = @"ACCEPT_IDENTIFIER"; !
acceptAction.title = @"Accept"; !
// Given seconds, not minutes, to run in the background acceptAction.activationMode = UIUserNotificationActivationModeBackground; !
acceptAction.destructive = NO; !
// If YES requires passcode, but does not unlock the device acceptAction.authenticationRequired = NO;
![Page 57: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/57.jpg)
Notification Actions RegistrationActions
UIMutableUserNotificationAction *acceptAction = [[UIMutableUserNotificationAction alloc] init]; !
acceptAction.identifier = @"ACCEPT_IDENTIFIER"; !
acceptAction.title = @"Accept"; !
// Given seconds, not minutes, to run in the background acceptAction.activationMode = UIUserNotificationActivationModeBackground; !
acceptAction.destructive = NO; !
// If YES requires passcode, but does not unlock the device acceptAction.authenticationRequired = NO;
![Page 58: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/58.jpg)
Notification Actions RegistrationActions
UIMutableUserNotificationAction *acceptAction = [[UIMutableUserNotificationAction alloc] init]; !
acceptAction.identifier = @"ACCEPT_IDENTIFIER"; !
acceptAction.title = @"Accept"; !
// Given seconds, not minutes, to run in the background acceptAction.activationMode = UIUserNotificationActivationModeBackground; !
acceptAction.destructive = NO; !
// If YES requires passcode, but does not unlock the device acceptAction.authenticationRequired = NO;
![Page 59: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/59.jpg)
Notification Actions RegistrationActions
UIMutableUserNotificationAction *acceptAction = [[UIMutableUserNotificationAction alloc] init]; !
acceptAction.identifier = @"ACCEPT_IDENTIFIER"; !
acceptAction.title = @"Accept"; !
// Given seconds, not minutes, to run in the background acceptAction.activationMode = UIUserNotificationActivationModeBackground; !
acceptAction.destructive = NO; !
// If YES requires passcode, but does not unlock the device acceptAction.authenticationRequired = NO;
![Page 60: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/60.jpg)
Notification Actions RegistrationActions
UIMutableUserNotificationAction *acceptAction = [[UIMutableUserNotificationAction alloc] init]; !
acceptAction.identifier = @"ACCEPT_IDENTIFIER"; !
acceptAction.title = @"Accept"; !
// Given seconds, not minutes, to run in the background acceptAction.activationMode = UIUserNotificationActivationModeBackground; !
acceptAction.destructive = NO; !
// If YES requires passcode, but does not unlock the device acceptAction.authenticationRequired = NO;
![Page 61: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/61.jpg)
Notification Actions RegistrationAccept invite
Action Property Value
title @“Accept”
activationMode UIUserNotificationActivationModeBackground
destructive NO
authenticationRequired NO
Accept
![Page 62: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/62.jpg)
Notification Actions RegistrationTrash mail
Action Property Value
title @“Trash”
activationMode UIUserNotificationActivationModeBackground
destructive YES
authenticationRequired YES
Trash
![Page 63: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/63.jpg)
Notification Actions RegistrationReply to message
Action Property Value
title @“Reply”
activationMode UIUserNotificationActivationModeForeground
destructive NO
authenticationRequired YES*
Reply
![Page 64: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/64.jpg)
Notification Actions RegistrationCategories
Category Actions
Invite Accept, Maybe, Decline
New mail Mark as Read, Trash
Tagged Like, Comment, Untag
![Page 65: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/65.jpg)
Notification Actions RegistrationCategories
UIMutableUserNotificationCategory *inviteCategory = [[UIMutableUserNotificationCategory alloc] init]; !
inviteCategory.identifier = @"INVITE_CATEGORY"; !
[inviteCategory setActions:@[acceptAction, maybeAction, declineAction] forContext:UIUserNotificationActionContextDefault]; !
![Page 66: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/66.jpg)
Notification Actions RegistrationCategories
UIMutableUserNotificationCategory *inviteCategory = [[UIMutableUserNotificationCategory alloc] init]; !
inviteCategory.identifier = @"INVITE_CATEGORY"; !
[inviteCategory setActions:@[acceptAction, maybeAction, declineAction] forContext:UIUserNotificationActionContextDefault]; !
![Page 67: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/67.jpg)
Notification Actions RegistrationCategories
UIMutableUserNotificationCategory *inviteCategory = [[UIMutableUserNotificationCategory alloc] init]; !
inviteCategory.identifier = @"INVITE_CATEGORY"; !
[inviteCategory setActions:@[acceptAction, maybeAction, declineAction] forContext:UIUserNotificationActionContextDefault]; !
![Page 68: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/68.jpg)
Notification Actions RegistrationCategories
UIMutableUserNotificationCategory *inviteCategory = [[UIMutableUserNotificationCategory alloc] init]; !
inviteCategory.identifier = @"INVITE_CATEGORY"; !
[inviteCategory setActions:@[acceptAction, maybeAction, declineAction] forContext:UIUserNotificationActionContextDefault]; !
![Page 69: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/69.jpg)
Notification Actions Registration
![Page 70: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/70.jpg)
Notification Actions RegistrationCategories
UIMutableUserNotificationCategory *inviteCategory = [[UIMutableUserNotificationCategory alloc] init]; !
inviteCategory.identifier = @"INVITE_CATEGORY"; !
[inviteCategory setActions:@[acceptAction, maybeAction, declineAction] forContext:UIUserNotificationActionContextDefault]; !
[inviteCategory setActions:@[acceptAction, declineAction] forContext:UIUserNotificationActionContextMinimal];
![Page 71: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/71.jpg)
Notification Actions RegistrationCategories
UIMutableUserNotificationCategory *inviteCategory = [[UIMutableUserNotificationCategory alloc] init]; !
inviteCategory.identifier = @"INVITE_CATEGORY"; !
[inviteCategory setActions:@[acceptAction, maybeAction, declineAction] forContext:UIUserNotificationActionContextDefault]; !
[inviteCategory setActions:@[acceptAction, declineAction] forContext:UIUserNotificationActionContextMinimal];
![Page 72: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/72.jpg)
Notification Actions Registration
![Page 73: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/73.jpg)
Notification Actions Registration
![Page 74: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/74.jpg)
Notification Actions RegistrationSettings
NSSet *categories = [NSSet setWithObjects:inviteCategory, alarmCategory, … !
UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:types categories:categories]; !
[[UIApplication sharedApplication] registerUserNotificationSettings:settings]; !
![Page 75: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/75.jpg)
Notification Actions RegistrationSettings
NSSet *categories = [NSSet setWithObjects:inviteCategory, alarmCategory, … !
UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:types categories:categories]; !
[[UIApplication sharedApplication] registerUserNotificationSettings:settings]; !
![Page 76: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/76.jpg)
Notification Actions RegistrationSettings
NSSet *categories = [NSSet setWithObjects:inviteCategory, alarmCategory, … !
UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:types categories:categories]; !
[[UIApplication sharedApplication] registerUserNotificationSettings:settings]; !
![Page 77: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/77.jpg)
Notification Actions RegistrationSettings
NSSet *categories = [NSSet setWithObjects:inviteCategory, alarmCategory, … !
UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:types categories:categories]; !
[[UIApplication sharedApplication] registerUserNotificationSettings:settings]; !
![Page 78: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/78.jpg)
Using Notification Actions
Register Actions
Push/Schedule Notification
Handle Action
![Page 79: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/79.jpg)
Using Notification Actions
Register Actions
Push/Schedule Notification
Handle Action
![Page 80: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/80.jpg)
Remote Notifications
{ "aps" : { "alert" : "You’re invited!", !
"category" : "INVITE_CATEGORY", !
} }
![Page 81: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/81.jpg)
Remote Notifications
{ "aps" : { "alert" : "You’re invited!", !
"category" : "INVITE_CATEGORY", !
} }
![Page 82: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/82.jpg)
Remote Notifications
{ "aps" : { "alert" : "You’re invited!", !
"category" : "INVITE_CATEGORY", !
} }
2KB Max Size
![Page 83: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/83.jpg)
Local Notifications
UILocalNotification *notification = [[UILocalNotification alloc] init]; ... !
notification.category = @"INVITE_CATEGORY"; !
[[UIApplication sharedApplication] scheduleLocalNotification:notification];
![Page 84: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/84.jpg)
Local Notifications
UILocalNotification *notification = [[UILocalNotification alloc] init]; ... !
notification.category = @"INVITE_CATEGORY"; !
[[UIApplication sharedApplication] scheduleLocalNotification:notification];
![Page 85: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/85.jpg)
Local Notifications
UILocalNotification *notification = [[UILocalNotification alloc] init]; ... !
notification.category = @"INVITE_CATEGORY"; !
[[UIApplication sharedApplication] scheduleLocalNotification:notification];
![Page 86: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/86.jpg)
Local Notifications
UILocalNotification *notification = [[UILocalNotification alloc] init]; ... !
notification.category = @"INVITE_CATEGORY"; !
[[UIApplication sharedApplication] scheduleLocalNotification:notification];
![Page 87: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/87.jpg)
Using Notification Actions
Register Actions
Push/Schedule Notification
Handle Action
![Page 88: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/88.jpg)
Using Notification Actions
Register Actions
Push/Schedule Notification
Handle Action
![Page 89: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/89.jpg)
Handling Notification Actions
App
![Page 90: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/90.jpg)
Handling Notification Actions
App
UIApplicationDelegate
application:didFinishLaunchingWithOptions:
application:didReceiveRemoteNotification: fetchCompletionHandler:
![Page 91: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/91.jpg)
Handling Notification Actions
App
![Page 92: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/92.jpg)
Handling Notification Actions
App
UIApplicationDelegate
application:didReceiveLocalNotification:
application:didReceiveRemoteNotification: fetchCompletionHandler:
application:didReceiveRemoteNotification:
![Page 93: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/93.jpg)
Handling Notification Actions
App
![Page 94: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/94.jpg)
Handling Notification Actions
App
application:didFinishLaunchingWithOptions:
application:didReceiveRemoteNotification: fetchCompletionHandler:
UIApplicationDelegate
application:handleActionWithIdentifier: forRemoteNotification:completionHandler:
application:handleActionWithIdentifier: forLocalNotification:completionHandler:
![Page 95: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/95.jpg)
Handling Notification ActionsUIApplicationDelegate
- (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)notification completionHandler:(void (^)())completionHandler { if ([identifier isEqualToString:@"ACCEPT_IDENTIFIER"]) { [self handleAcceptActionWithNotification:notification]; } // Must be called when finished completionHandler(); }
![Page 96: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/96.jpg)
Handling Notification ActionsUIApplicationDelegate
- (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)notification completionHandler:(void (^)())completionHandler { if ([identifier isEqualToString:@"ACCEPT_IDENTIFIER"]) { [self handleAcceptActionWithNotification:notification]; } // Must be called when finished completionHandler(); }
![Page 97: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/97.jpg)
Handling Notification ActionsUIApplicationDelegate
- (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)notification completionHandler:(void (^)())completionHandler { if ([identifier isEqualToString:@"ACCEPT_IDENTIFIER"]) { [self handleAcceptActionWithNotification:notification]; } // Must be called when finished completionHandler(); }
![Page 98: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/98.jpg)
Handling Notification ActionsUIApplicationDelegate
- (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)notification completionHandler:(void (^)())completionHandler { if ([identifier isEqualToString:@"ACCEPT_IDENTIFIER"]) { [self handleAcceptActionWithNotification:notification]; } // Must be called when finished completionHandler(); }
![Page 99: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/99.jpg)
Handling Notification ActionsUIApplicationDelegate
- (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forLocalNotification:(UILocalNotification *)notification completionHandler:(void (^)())completionHandler { if ([identifier isEqualToString:@"ACCEPT_IDENTIFIER"]) { [self handleAcceptActionWithNotification:notification]; } // Must be called when finished completionHandler(); }
![Page 100: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/100.jpg)
Handling Notification ActionsUIApplicationDelegate
- (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forLocalNotification:(UILocalNotification *)notification completionHandler:(void (^)())completionHandler { if ([identifier isEqualToString:@"ACCEPT_IDENTIFIER"]) { [self handleAcceptActionWithNotification:notification]; } // Must be called when finished completionHandler(); }
![Page 101: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/101.jpg)
Handling Notification ActionsUIApplicationDelegate
- (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forLocalNotification:(UILocalNotification *)notification completionHandler:(void (^)())completionHandler { if ([identifier isEqualToString:@"ACCEPT_IDENTIFIER"]) { [self handleAcceptActionWithNotification:notification]; } // Must be called when finished completionHandler(); }
![Page 102: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/102.jpg)
Handling Notification ActionsUIApplicationDelegate
- (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forLocalNotification:(UILocalNotification *)notification completionHandler:(void (^)())completionHandler { if ([identifier isEqualToString:@"ACCEPT_IDENTIFIER"]) { [self handleAcceptActionWithNotification:notification]; } // Must be called when finished completionHandler(); }
![Page 103: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/103.jpg)
Using Notification Actions
Register Actions
Push/Schedule Notification
Handle Action
![Page 104: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/104.jpg)
Using Notification Actions
Register Actions
Push/Schedule Notification
Handle Action
UIUserNotificationAction
UIUserNotificationCategory
UIUserNotificationSettings
![Page 105: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/105.jpg)
Using Notification Actions
Push/Schedule Notification
Handle Action
Register Actions
aps { alert: {…} category: "INVITE"
}
notification.category = @"INVITE";
![Page 106: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/106.jpg)
UIApplicationDelegate
Using Notification Actions
Push/Schedule Notification
Handle Action
Register Actions
application:handleActionWithIdentifier: forRemoteNotification:completionHandler:
application:handleActionWithIdentifier: forLocalNotification:completionHandler:
![Page 107: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/107.jpg)
Remote Notifications
![Page 108: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/108.jpg)
Remote Notifications
APNs
![Page 109: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/109.jpg)
Remote Notifications
APNs
My App Hello world!
aps { alert: {...}
}
![Page 110: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/110.jpg)
Remote Notifications
APNs
![Page 111: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/111.jpg)
Remote Notifications
APNsApp
![Page 112: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/112.jpg)
Remote Notifications
APNsApp
aps { content-available: 1
}
![Page 113: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/113.jpg)
Remote Notifications
APNsApp
aps { content-available: 1
}
Content Server
![Page 114: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/114.jpg)
Remote Notifications
![Page 115: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/115.jpg)
Remote Notifications
User • Requires call to registerUserNotificationSettings:
Silent • Info.plist UIBackgroundModes array contains remote-notification
Can use both
![Page 116: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/116.jpg)
Remote Notifications
Must register before receiving pushes
Enabled by default
Can be disabled via Settings
![Page 117: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/117.jpg)
Remote NotificationsRegistering
UIApplication *myApp = [UIApplication sharedApplication]; !
!
[myApp registerForRemoteNotificationTypes:someTypes];
![Page 118: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/118.jpg)
Remote NotificationsRegistering
UIApplication *myApp = [UIApplication sharedApplication]; !
!
[myApp registerForRemoteNotificationTypes:someTypes]; !
!
![Page 119: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/119.jpg)
Remote NotificationsRegistering
UIApplication *myApp = [UIApplication sharedApplication]; !
!
[myApp registerForRemoteNotificationTypes:someTypes]; !
!
![Page 120: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/120.jpg)
Remote NotificationsRegistering
UIApplication *myApp = [UIApplication sharedApplication]; !
!
[myApp registerForRemoteNotificationTypes:someTypes]; !
!
[myApp registerForRemoteNotifications];
![Page 121: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/121.jpg)
Remote NotificationsRegistering
UIApplication *myApp = [UIApplication sharedApplication]; !
!
[myApp registerForRemoteNotificationTypes:someTypes]; !
!
[myApp registerForRemoteNotifications];
![Page 122: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/122.jpg)
Remote NotificationsRegistering
UIApplication *myApp = [UIApplication sharedApplication]; !
!
!
!
!
[myApp registerForRemoteNotifications]; !
[myApp registerUserNotificationSettings:mySettings];
![Page 123: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/123.jpg)
Remote NotificationsUIApplicationDelegate success callback
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { !
MyAPNSServer *myServer = // ... [myServer registerPushToken:deviceToken]; !
}
![Page 124: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/124.jpg)
Remote NotificationsUIApplicationDelegate success callback
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { !
MyAPNSServer *myServer = // ... [myServer registerPushToken:deviceToken]; !
}
![Page 125: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/125.jpg)
Remote NotificationsUIApplicationDelegate success callback
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { !
MyAPNSServer *myServer = // ... [myServer registerPushToken:deviceToken]; !
}
![Page 126: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/126.jpg)
Remote NotificationsUIApplicationDelegate failure callback
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error { !
[self handleRegistrationError:error]; !
}
![Page 127: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/127.jpg)
Remote NotificationsUIApplicationDelegate failure callback
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error { !
[self handleRegistrationError:error]; !
}
![Page 128: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/128.jpg)
Remote NotificationsUIApplicationDelegate failure callback
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error { !
[self handleRegistrationError:error]; !
}
![Page 129: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/129.jpg)
Remote NotificationsWrap up
Must register before using
Enabled by default
Register API change (registerForRemoteNotifications)
![Page 130: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/130.jpg)
Location Notifications
![Page 131: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/131.jpg)
Subtitle
![Page 132: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/132.jpg)
![Page 133: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/133.jpg)
![Page 134: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/134.jpg)
![Page 135: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/135.jpg)
![Page 136: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/136.jpg)
Uses UILocalNotification
Fire when user enters or exits a region
Fire-Once or Fire-Always
Requires Core Location registration
Location Notifications
![Page 137: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/137.jpg)
Location NotificationsCore Location registration
CLLocationManager *locMan = [[CLLocationManager alloc] init]; !
locMan.delegate = self; !
// request authorization to track the user’s location [locMan requestWhenInUseAuthorization];
![Page 138: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/138.jpg)
Location NotificationsCore Location registration
CLLocationManager *locMan = [[CLLocationManager alloc] init]; !
locMan.delegate = self; !
// request authorization to track the user’s location [locMan requestWhenInUseAuthorization];
![Page 139: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/139.jpg)
Location NotificationsCore Location registration
CLLocationManager *locMan = [[CLLocationManager alloc] init]; !
locMan.delegate = self; !
// request authorization to track the user’s location [locMan requestWhenInUseAuthorization];
![Page 140: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/140.jpg)
Location NotificationsCore Location registration
CLLocationManager *locMan = [[CLLocationManager alloc] init]; !
locMan.delegate = self; !
// request authorization to track the user’s location [locMan requestWhenInUseAuthorization];
![Page 141: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/141.jpg)
Location NotificationsCore Location registration
CLLocationManager *locMan = [[CLLocationManager alloc] init]; !
locMan.delegate = self; !
// request authorization to track the user’s location [locMan requestWhenInUseAuthorization];
![Page 142: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/142.jpg)
Location NotificationsCore Location registration
Key Type TypeInformation Property List
NSLocationWhenInUseUsageDescriptionLocalization native development regionBundle display nameExecutable file
DictionaryStringStringStringString
(17 items)
Enabling location tracking allows friends to see where you are.en${PRODUCT_NAME}${EXECUTABLE_NAME}
![Page 143: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/143.jpg)
Location NotificationsCore Location registration
Key Type TypeInformation Property List
NSLocationWhenInUseUsageDescriptionLocalization native development regionBundle display nameExecutable file
DictionaryStringStringStringString
(17 items)
Enabling location tracking allows friends to see where you are.en${PRODUCT_NAME}${EXECUTABLE_NAME}
![Page 144: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/144.jpg)
Location NotificationsCore Location registration callbacks
- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status { !
// check status to see if we’re authorized BOOL canUseLocationNotifications = (status == kCLAuthorizationStatusAuthorizedWhenInUse); !
if (canUseLocationNotifications) { [self startShowingLocationNotifications]; } !
}
![Page 145: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/145.jpg)
Location NotificationsCore Location registration callbacks
- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status { !
// check status to see if we’re authorized BOOL canUseLocationNotifications = (status == kCLAuthorizationStatusAuthorizedWhenInUse); !
if (canUseLocationNotifications) { [self startShowingLocationNotifications]; } !
}
![Page 146: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/146.jpg)
Location NotificationsCore Location registration callbacks
- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status { !
// check status to see if we’re authorized BOOL canUseLocationNotifications = (status == kCLAuthorizationStatusAuthorizedWhenInUse); !
if (canUseLocationNotifications) { [self startShowingLocationNotifications]; } !
}
![Page 147: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/147.jpg)
Location NotificationsCore Location registration callbacks
- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status { !
// check status to see if we’re authorized BOOL canUseLocationNotifications = (status == kCLAuthorizationStatusAuthorizedWhenInUse); !
if (canUseLocationNotifications) { [self startShowingLocationNotifications]; } !
}
![Page 148: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/148.jpg)
Location NotificationsNotification scheduling
- (void)startShowingNotifications { UILocalNotification *locNotification = [[UILocalNotification alloc] init]; locNotification.alertBody = @“You have arrived!”; locNotification.regionTriggersOnce = YES; !
locNotification.region = [[CLCircularRegion alloc] initWithCenter:LOC_COORDINATE radius:LOC_RADIUS identifier:LOC_IDENTIFIER]; !
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];
![Page 149: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/149.jpg)
Location NotificationsNotification scheduling
- (void)startShowingNotifications { UILocalNotification *locNotification = [[UILocalNotification alloc] init]; locNotification.alertBody = @“You have arrived!”; locNotification.regionTriggersOnce = YES; !
locNotification.region = [[CLCircularRegion alloc] initWithCenter:LOC_COORDINATE radius:LOC_RADIUS identifier:LOC_IDENTIFIER]; !
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];
![Page 150: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/150.jpg)
Location NotificationsNotification scheduling
- (void)startShowingNotifications { UILocalNotification *locNotification = [[UILocalNotification alloc] init]; locNotification.alertBody = @“You have arrived!”; locNotification.regionTriggersOnce = YES; !
locNotification.region = [[CLCircularRegion alloc] initWithCenter:LOC_COORDINATE radius:LOC_RADIUS identifier:LOC_IDENTIFIER]; !
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];
![Page 151: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/151.jpg)
Location NotificationsNotification scheduling
- (void)startShowingNotifications { UILocalNotification *locNotification = [[UILocalNotification alloc] init]; locNotification.alertBody = @“You have arrived!”; locNotification.regionTriggersOnce = YES; !
locNotification.region = [[CLCircularRegion alloc] initWithCenter:LOC_COORDINATE radius:LOC_RADIUS identifier:LOC_IDENTIFIER]; !
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];
![Page 152: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/152.jpg)
Location NotificationsNotification scheduling
- (void)startShowingNotifications { UILocalNotification *locNotification = [[UILocalNotification alloc] init]; locNotification.alertBody = @“You have arrived!”; locNotification.regionTriggersOnce = YES; !
locNotification.region = [[CLCircularRegion alloc] initWithCenter:LOC_COORDINATE radius:LOC_RADIUS identifier:LOC_IDENTIFIER]; !
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];
![Page 153: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/153.jpg)
Location NotificationsNotification handling
- (void)application:(UIApplication *)application didReceiveLocalNotification: (UILocalNotification *)notification { CLRegion *region = notification.region; !
if (region) { [self tellFriendsUserArrivedAtRegion:region]; } }
![Page 154: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/154.jpg)
Location NotificationsNotification handling
- (void)application:(UIApplication *)application didReceiveLocalNotification: (UILocalNotification *)notification { CLRegion *region = notification.region; !
if (region) { [self tellFriendsUserArrivedAtRegion:region]; } }
![Page 155: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/155.jpg)
Location NotificationsNotification handling
- (void)application:(UIApplication *)application didReceiveLocalNotification: (UILocalNotification *)notification { CLRegion *region = notification.region; !
if (region) { [self tellFriendsUserArrivedAtRegion:region]; } }
![Page 156: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/156.jpg)
Location NotificationsNotification handling
- (void)application:(UIApplication *)application didReceiveLocalNotification: (UILocalNotification *)notification { CLRegion *region = notification.region; !
if (region) { [self tellFriendsUserArrivedAtRegion:region]; } }
![Page 157: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/157.jpg)
Location NotificationsWrap up
UILocalNotification API addition
Requires Core Location registration
application:didReceiveLocalNotification: not called if CoreLocation disabled
![Page 158: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/158.jpg)
Recap
Notification actions
User and Remote Notification registration
Location Notifications
![Page 159: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/159.jpg)
More Information
Paul Danbold Core OS Technologies Evangelist [email protected]
Documentation http://developer.apple.com
Apple Developer Forums http://devforums.apple.com
![Page 160: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/160.jpg)
Related Sessions
• What’s New in Core Location Marina Tuesday 2:00PM
• Taking Core Location Indoors Marina Tuesday 3:15PM
• Protecting the User’s Data WWDC 2012
![Page 161: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/161.jpg)
Labs
• Notifications Lab Services Lab B Wednesday 3:15PM
• Security and Privacy Lab Core OS Lab B Thursday 3:15PM
![Page 162: What’s New in iOS Notifications - Apple Inc.€¦ · What’s New in iOS Notifications Core OS Session 713 Rhett Dickson Software Engineer! Dan Kurtz Software Engineer. Previously](https://reader034.vdocuments.net/reader034/viewer/2022050120/5f50b36f4288c517824c6835/html5/thumbnails/162.jpg)