What s New in ios Notifications



Similar documents
User Privacy on ios and OS X

ITP 342 Mobile App Development. Notifications

What s New in Security

Embedding ios SDK to build a business chat app

Game Center Programming Guide

Secure Mail Message Retrieval Instructions

Continuous Integration with Xcode 6

What s New in Managing Apple Devices

1. Introduction Activation of Mobile Device Management How Endpoint Protector MDM Works... 5

Please note that this SDK will only work with Xcode or above. If you need an SDK for an older Xcode version please support.

End User Devices Security Guidance: Apple ios 8

Managing Apple Devices

Lotus Notes Traveler User and Troubleshooting Guide for ios Devices. Manage the Settings for your Mail, Calendar, and Contacts Apps

Can the app be installed on the device? Does the app behave as designed/desired if there is an incoming call?

Quick Start Guide: NotifyLink for Symbian Series 60, 3 rd Edition

User Manual for Version Mobile Device Management (MDM) User Manual

RemoSync Business Features - Android

Feature Matrix MOZO CLOUDBASED MOBILE DEVICE MANAGEMENT

Salesforce Mobile Push Notifications Implementation Guide

ADVANCED OUTLOOK 2003

Swisscom Mobile Device Services Quick Start Guide: Set-up Remote Management basic. Mobile Device Services Februar 2014

Going Social with ReplayKit and Game Center

ipad Set Up Guide: Staff! 1 of! 20

Salesforce Mobile Push Notifications Implementation Guide

Mobile Iron User Guide

Instant Messaging Nokia N76-1

Work with Centricity2 Mobile Communications App (MCA) Site Manager. Schoolwires Centricity2

Harry Fike Frostburg State University Office of Information Technology Technical Services

Account & Login. Log In to Mobile Conference Connect (MCC) as a Meeting Leader

1 Overview Configuration on MACH Web Portal 1

Evaluation of Xamarin Forms for MultiPlatform Mobile Application Development

Premium Design Phone with Smartphone Connect

Sophos Mobile Control User guide for Apple ios

Cloud Services MDM. Control Panel Provisioning Guide

Server Release Notes ZENworks Mobile Management 2.6.x January 2013

Introduction to iphone Development

Mobile Connect for USA Mobility Pagers for iphone

Mobile App Containers: Product Or Feature?

GO!Enterprise MDM Device Application User Guide Installation and Configuration for ios with TouchDown

Simplifying Device Enrollment and Content Distribution Using the Device Enrollment Program, the Volume Purchase Program, and the Casper Suite

Continuous Integration and Code Coverage in Xcode

Using Safari to Deliver and Debug a Responsive Web Design

Advanced Testing and Continuous Integration

Guide for Generating. Apple Push Notification Service Certificate

Information Technology Services. Your mailbox is moving to the cloud. Here is what to expect.

GO!NotifyLink ActiveSync Solution for ios Devices

AVG Business SSO Partner Getting Started Guide

Administering Jive Mobile Apps

Building a BYOD Program Using the Casper Suite. Technical Paper Casper Suite v9.4 or Later 17 September 2014

MOBILE APP TRAINING MANUAL

Windows Azure Push Notifications

Sophos Mobile Control Startup guide. Product version: 3

Security Guide. BlackBerry Enterprise Service 12. for ios, Android, and Windows Phone. Version 12.0

Sophos Mobile Control User guide for Apple ios. Product version: 2 Document date: December 2011

QMX ios MDM Pre-Requisites and Installation Guide

Managing ios Devices. Andrew Wellington Division of Information The Australian National University XW11

Manage Mobile Devices

How to configure your mobile devices post migrating to Microsoft Office 365

Poking a Hole in the Sandbox: Using URLs on ios

How to generate an APNs Certificate to use the Apple MDM protocol via the portal

Your App and Next Generation Networks

Architecture and Data Flow Overview. BlackBerry Enterprise Service Version: Quick Reference

Device Enrollment Guide

APPLE & BUSINESS. ios ENTERPRISE SECURITY ENTERPRISE NEEDS CONFIGURATION PROFILES

QGDocs Documentation. Release 1.0. QuantumGraph Engineers

Generating an Apple Push Notification Service Certificate for use with GO!Enterprise MDM. This guide provides information on...

AnceroAir Mobile Device Management (MDM) Service Guide

EM L05 Managing ios and Android Mobile Devices with Symantec Mobile Management Hands-On Lab

ipad in Business Mobile Device Management

Sophos Mobile Control Technical guide

ADMINISTRATOR GUIDE FOR USA MOBILITY AMC SELECT

Building Apps for iphone and ipad. Presented by Ryan Hope, Sumeet Singh

iphone in Business Mobile Device Management

Sophos Mobile Control Administrator guide. Product version: 3

Apple Configurator MDM Site - Review

Stellar Phoenix Exchange Server Backup

Configuring H.323 over Port Network Address Translation (PNAT) for Avaya IP Endpoints using the Avaya SG200 Security Gateway - Issue 1.

About. IP Centrex App for ios Tablet. User Guide

Telstra Mobile Device Management (T MDM) Getting Started Guide

Optimize Your Earning Power with iad

Zenprise Device Manager 6.1

Wharf T&T. iwatch 2012 Mobile Apps User Guide (ios / Android)

GO!Enterprise MDM Device Application User Guide Installation and Configuration for ios Devices

GO!Enterprise MDM Device Application User Guide Installation and Configuration for Android with TouchDown

MobileIron Cloud Pricing Packaging

FileMaker. Installation and New Features Guide. for FileMaker Pro 15 and FileMaker Pro 15 Advanced

UP L18 Enhanced MDM and Updated Protection Hands-On Lab

Lync Mobile Client Features

Bell Mobile Device Management (MDM)

Infrastructure Deployment for Mobile Device Management with Microsoft System Center Configuration Manager and Windows Intune

Sophos Mobile Control Startup guide. Product version: 3.5

Advanced Graphics and Animations for ios Apps

Contents. About AirPlay 5. Preparing Your Media and Server for AirPlay 8. Opting Into or Out of AirPlay 11

1. Set a longer (and stronger) six-digit passcode. 2. Prevent apps from uploading your data

EASTPOINTE SECURE E MAIL SYSTEM SETUP INSTRUCTIONS

Deploying Management and Security Agents to Mobile Devices. Deploying Mgmt and Security Agents

1. Application Overview System Requirements Installation Splash Screen Registration Screen...

Mobile Secure Cloud Edition Document Version: ios Application Signing

Transcription:

Core OS #WWDC14 What s New in ios Notifications Session 713 Rhett Dickson Software Engineer Dan Kurtz Software Engineer 2014 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple.

Previously in ios Notifications User notifications Silent notifications

User Notifications What Daniel Kurtz now Hello world

User Notifications What Daniel Kurtz now Hello world

User Notifications What Daniel Kurtz now Hello world

User Notifications What Daniel Kurtz now Hello world

User Notifications Where

User Notifications Where

User Notifications Where

User Notifications Where

Where Notifications Come From App APNs

Where Notifications Come From My App Hello world App APNs

Where Notifications Come From App APNs

Where Notifications Come From My App Hello world App APNs aps { } alert: {...}

Where Notifications Come From App APNs

Where Notifications Come From App APNs

Where Notifications Come From App APNs aps { } content-available: 1

Where Notifications Come From Content Server App APNs aps { } content-available: 1

Where Notifications Come From

Today User Notifications Notification Actions Remote Notifications Location Notifications

User Notifications

User Notifications What s new Must register to use Require user approval

User Notifications Registering UIUserNotificationType types = UIUserNotificationTypeBadge UIUserNotificationTypeSound UIUserNotificationTypeAlert; UIUserNotificationSettings *mysettings = [UIUserNotificationSettings settingsfortypes:types categories:nil]; [[UIApplication sharedapplication] registerusernotificationsettings:mysettings];

User Notifications Registering UIUserNotificationType types = UIUserNotificationTypeBadge UIUserNotificationTypeSound UIUserNotificationTypeAlert; UIUserNotificationSettings *mysettings = [UIUserNotificationSettings settingsfortypes:types categories:nil]; [[UIApplication sharedapplication] registerusernotificationsettings:mysettings];

User Notifications Registering UIUserNotificationType types = UIUserNotificationTypeBadge UIUserNotificationTypeSound UIUserNotificationTypeAlert; UIUserNotificationSettings *mysettings = [UIUserNotificationSettings settingsfortypes:types categories:nil]; [[UIApplication sharedapplication] registerusernotificationsettings:mysettings];

User Notifications Registering UIUserNotificationType types = UIUserNotificationTypeBadge UIUserNotificationTypeSound UIUserNotificationTypeAlert; UIUserNotificationSettings *mysettings = [UIUserNotificationSettings settingsfortypes:types categories:nil]; [[UIApplication sharedapplication] registerusernotificationsettings:mysettings];

User Notifications Registering UIUserNotificationType types = UIUserNotificationTypeBadge UIUserNotificationTypeSound UIUserNotificationTypeAlert; UIUserNotificationSettings *mysettings = [UIUserNotificationSettings settingsfortypes:types categories:nil]; [[UIApplication sharedapplication] registerusernotificationsettings:mysettings];

User Notifications Registering UIUserNotificationType types = UIUserNotificationTypeBadge UIUserNotificationTypeSound UIUserNotificationTypeAlert; UIUserNotificationSettings *mysettings = [UIUserNotificationSettings settingsfortypes:types categories:nil]; [[UIApplication sharedapplication] registerusernotificationsettings:mysettings]; My App Would Like to Send You Notifications

User Notifications UIApplicationDelegate Callback } - (void)application:(uiapplication *)application didregisterusernotificationsettings: (UIUserNotificationSettings *)notificationsettings { // user has allowed receiving user notifications of the following types UIUserNotificationType allowedtypes = [notificationsettings types];

User Notifications UIApplicationDelegate Callback } - (void)application:(uiapplication *)application didregisterusernotificationsettings: (UIUserNotificationSettings *)notificationsettings { // user has allowed receiving user notifications of the following types UIUserNotificationType allowedtypes = [notificationsettings types];

User Notifications UIApplicationDelegate Callback } - (void)application:(uiapplication *)application didregisterusernotificationsettings: (UIUserNotificationSettings *)notificationsettings { // user has allowed receiving user notifications of the following types UIUserNotificationType allowedtypes = [notificationsettings types];

User Notifications Getting Settings - (void)getreadyfornotification { //... // check to make sure we still need to show notification UIUserNotificationSettings *currentsettings = [[UIApplication sharedapplication] currentusernotificationsettings]; } [self checksettings:currentsettings];

User Notifications Getting Settings - (void)getreadyfornotification { //... // check to make sure we still need to show notification UIUserNotificationSettings *currentsettings = [[UIApplication sharedapplication] currentusernotificationsettings]; } [self checksettings:currentsettings];

User Notifications -[UIApplication registerusernotificationsettings:] -[UIApplication currentnotificationsettings] +[UIUserNotificationSettings settingsfortypes:categories:]

Notification Actions

Notification Actions In ios 7 Notification Center Banner

Notification Actions In ios 7 Notification Center Banner

Notification Actions In ios 7 Notification Center Banner

Notification Actions In ios 7 Notification Center Banner

Notification Actions In ios 7 Notification Center Banner

Notification Actions In ios 7 Notification Center Banner

Notification Actions In ios 8

Notification Actions In ios 8

Notification Actions In ios 8

Notification Actions In ios 8

Notification Actions In ios 8

Notification Actions In ios 8

Notification Actions In ios 8

Notification Actions In ios 8

Using Notification Actions Register Actions Push/Schedule Notification Handle Action

Using Notification Actions

Using Notification Actions Register Actions Push/Schedule Notification Handle Action

Using Notification Actions Register Actions Push/Schedule Notification Handle Action

Notification Actions Registration Actions 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;

Notification Actions Registration Actions 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;

Notification Actions Registration Actions 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;

Notification Actions Registration Actions 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;

Notification Actions Registration Actions 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;

Notification Actions Registration Actions 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;

Notification Actions Registration Actions 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;

Notification Actions Registration Accept invite Accept Action Property Value title @ Accept activationmode UIUserNotificationActivationModeBackground destructive NO authenticationrequired NO

Notification Actions Registration Trash mail Trash Action Property Value title @ Trash activationmode UIUserNotificationActivationModeBackground destructive YES authenticationrequired YES

Notification Actions Registration Reply to message Reply Action Property Value title @ Reply activationmode UIUserNotificationActivationModeForeground destructive NO authenticationrequired YES*

Notification Actions Registration Categories Category Actions Invite Accept, Maybe, Decline New mail Mark as Read, Trash Tagged Like, Comment, Untag

Notification Actions Registration Categories UIMutableUserNotificationCategory *invitecategory = [[UIMutableUserNotificationCategory alloc] init]; invitecategory.identifier = @"INVITE_CATEGORY"; [invitecategory setactions:@[acceptaction, maybeaction, declineaction] forcontext:uiusernotificationactioncontextdefault];

Notification Actions Registration Categories UIMutableUserNotificationCategory *invitecategory = [[UIMutableUserNotificationCategory alloc] init]; invitecategory.identifier = @"INVITE_CATEGORY"; [invitecategory setactions:@[acceptaction, maybeaction, declineaction] forcontext:uiusernotificationactioncontextdefault];

Notification Actions Registration Categories UIMutableUserNotificationCategory *invitecategory = [[UIMutableUserNotificationCategory alloc] init]; invitecategory.identifier = @"INVITE_CATEGORY"; [invitecategory setactions:@[acceptaction, maybeaction, declineaction] forcontext:uiusernotificationactioncontextdefault];

Notification Actions Registration Categories UIMutableUserNotificationCategory *invitecategory = [[UIMutableUserNotificationCategory alloc] init]; invitecategory.identifier = @"INVITE_CATEGORY"; [invitecategory setactions:@[acceptaction, maybeaction, declineaction] forcontext:uiusernotificationactioncontextdefault];

Notification Actions Registration

Notification Actions Registration Categories UIMutableUserNotificationCategory *invitecategory = [[UIMutableUserNotificationCategory alloc] init]; invitecategory.identifier = @"INVITE_CATEGORY"; [invitecategory setactions:@[acceptaction, maybeaction, declineaction] forcontext:uiusernotificationactioncontextdefault]; [invitecategory setactions:@[acceptaction, declineaction] forcontext:uiusernotificationactioncontextminimal];

Notification Actions Registration Categories UIMutableUserNotificationCategory *invitecategory = [[UIMutableUserNotificationCategory alloc] init]; invitecategory.identifier = @"INVITE_CATEGORY"; [invitecategory setactions:@[acceptaction, maybeaction, declineaction] forcontext:uiusernotificationactioncontextdefault]; [invitecategory setactions:@[acceptaction, declineaction] forcontext:uiusernotificationactioncontextminimal];

Notification Actions Registration

Notification Actions Registration

Notification Actions Registration Settings NSSet *categories = [NSSet setwithobjects:invitecategory, alarmcategory, UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsfortypes:types categories:categories]; [[UIApplication sharedapplication] registerusernotificationsettings:settings];

Notification Actions Registration Settings NSSet *categories = [NSSet setwithobjects:invitecategory, alarmcategory, UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsfortypes:types categories:categories]; [[UIApplication sharedapplication] registerusernotificationsettings:settings];

Notification Actions Registration Settings NSSet *categories = [NSSet setwithobjects:invitecategory, alarmcategory, UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsfortypes:types categories:categories]; [[UIApplication sharedapplication] registerusernotificationsettings:settings];

Notification Actions Registration Settings NSSet *categories = [NSSet setwithobjects:invitecategory, alarmcategory, UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsfortypes:types categories:categories]; [[UIApplication sharedapplication] registerusernotificationsettings:settings];

Using Notification Actions Register Actions Push/Schedule Notification Handle Action

Using Notification Actions Register Actions Push/Schedule Notification Handle Action

Remote Notifications { "aps" : { "alert" : "You re invited", "category" : "INVITE_CATEGORY", } }

Remote Notifications { "aps" : { "alert" : "You re invited", "category" : "INVITE_CATEGORY", } }

Remote Notifications { "aps" : { "alert" : "You re invited", "category" : "INVITE_CATEGORY", } } 2KB Max Size

Local Notifications UILocalNotification *notification = [[UILocalNotification alloc] init];... notification.category = @"INVITE_CATEGORY"; [[UIApplication sharedapplication] schedulelocalnotification:notification];

Local Notifications UILocalNotification *notification = [[UILocalNotification alloc] init];... notification.category = @"INVITE_CATEGORY"; [[UIApplication sharedapplication] schedulelocalnotification:notification];

Local Notifications UILocalNotification *notification = [[UILocalNotification alloc] init];... notification.category = @"INVITE_CATEGORY"; [[UIApplication sharedapplication] schedulelocalnotification:notification];

Local Notifications UILocalNotification *notification = [[UILocalNotification alloc] init];... notification.category = @"INVITE_CATEGORY"; [[UIApplication sharedapplication] schedulelocalnotification:notification];

Using Notification Actions Register Actions Push/Schedule Notification Handle Action

Using Notification Actions Register Actions Push/Schedule Notification Handle Action

Handling Notification Actions App

Handling Notification Actions App UIApplicationDelegate application:didfinishlaunchingwithoptions: application:didreceiveremotenotification: fetchcompletionhandler:

Handling Notification Actions App

Handling Notification Actions App UIApplicationDelegate application:didreceivelocalnotification: application:didreceiveremotenotification: application:didreceiveremotenotification: fetchcompletionhandler:

Handling Notification Actions App

Handling Notification Actions App UIApplicationDelegate application:handleactionwithidentifier: forremotenotification:completionhandler: application:didfinishlaunchingwithoptions: application:handleactionwithidentifier: application:didreceiveremotenotification: forlocalnotification:completionhandler: fetchcompletionhandler:

Handling Notification Actions UIApplicationDelegate - (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();

Handling Notification Actions UIApplicationDelegate - (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();

Handling Notification Actions UIApplicationDelegate - (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();

Handling Notification Actions UIApplicationDelegate - (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();

Handling Notification Actions UIApplicationDelegate - (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();

Handling Notification Actions UIApplicationDelegate - (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();

Handling Notification Actions UIApplicationDelegate - (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();

Handling Notification Actions UIApplicationDelegate - (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();

Using Notification Actions Register Actions Push/Schedule Notification Handle Action

Using Notification Actions Register Actions UIUserNotificationAction UIUserNotificationCategory UIUserNotificationSettings Push/Schedule Notification Handle Action

Using Notification Actions Register Actions Push/Schedule Notification aps { alert: { } category: "INVITE" } notification.category = @"INVITE"; Handle Action

Using Notification Actions Register Actions Push/Schedule Notification Handle Action UIApplicationDelegate application:handleactionwithidentifier: forremotenotification:completionhandler: application:handleactionwithidentifier: forlocalnotification:completionhandler:

Remote Notifications

Remote Notifications APNs

Remote Notifications My App Hello world APNs aps { } alert: {...}

Remote Notifications APNs

Remote Notifications App APNs

Remote Notifications App APNs aps { } content-available: 1

Remote Notifications Content Server App APNs aps { } content-available: 1

Remote Notifications

Remote Notifications User Requires call to registerusernotificationsettings: Silent Info.plist UIBackgroundModes array contains remote-notification Can use both

Remote Notifications Must register before receiving pushes Enabled by default Can be disabled via Settings

Remote Notifications Registering UIApplication *myapp = [UIApplication sharedapplication]; [myapp registerforremotenotificationtypes:sometypes];

Remote Notifications Registering UIApplication *myapp = [UIApplication sharedapplication]; [myapp registerforremotenotificationtypes:sometypes];

Remote Notifications Registering UIApplication *myapp = [UIApplication sharedapplication]; [myapp registerforremotenotificationtypes:sometypes];

Remote Notifications Registering UIApplication *myapp = [UIApplication sharedapplication]; [myapp registerforremotenotificationtypes:sometypes]; [myapp registerforremotenotifications];

Remote Notifications Registering UIApplication *myapp = [UIApplication sharedapplication]; [myapp registerforremotenotificationtypes:sometypes]; [myapp registerforremotenotifications];

Remote Notifications Registering UIApplication *myapp = [UIApplication sharedapplication]; [myapp registerforremotenotifications]; [myapp registerusernotificationsettings:mysettings];

Remote Notifications UIApplicationDelegate success callback - (void)application:(uiapplication *)application didregisterforremotenotificationswithdevicetoken:(nsdata *)devicetoken { } MyAPNSServer *myserver = //... [myserver registerpushtoken:devicetoken];

Remote Notifications UIApplicationDelegate success callback - (void)application:(uiapplication *)application didregisterforremotenotificationswithdevicetoken:(nsdata *)devicetoken { } MyAPNSServer *myserver = //... [myserver registerpushtoken:devicetoken];

Remote Notifications UIApplicationDelegate success callback - (void)application:(uiapplication *)application didregisterforremotenotificationswithdevicetoken:(nsdata *)devicetoken { } MyAPNSServer *myserver = //... [myserver registerpushtoken:devicetoken];

Remote Notifications UIApplicationDelegate failure callback - (void)application:(uiapplication *)application didfailtoregisterforremotenotificationswitherror:(nserror *)error { } [self handleregistrationerror:error];

Remote Notifications UIApplicationDelegate failure callback - (void)application:(uiapplication *)application didfailtoregisterforremotenotificationswitherror:(nserror *)error { } [self handleregistrationerror:error];

Remote Notifications UIApplicationDelegate failure callback - (void)application:(uiapplication *)application didfailtoregisterforremotenotificationswitherror:(nserror *)error { } [self handleregistrationerror:error];

Remote Notifications Wrap up Must register before using Enabled by default Register API change (registerforremotenotifications)

Location Notifications

Subtitle

Location Notifications Uses UILocalNotification Fire when user enters or exits a region Fire-Once or Fire-Always Requires Core Location registration

Location Notifications Core Location registration CLLocationManager *locman = [[CLLocationManager alloc] init]; locman.delegate = self; // request authorization to track the user s location [locman requestwheninuseauthorization];

Location Notifications Core Location registration CLLocationManager *locman = [[CLLocationManager alloc] init]; locman.delegate = self; // request authorization to track the user s location [locman requestwheninuseauthorization];

Location Notifications Core Location registration CLLocationManager *locman = [[CLLocationManager alloc] init]; locman.delegate = self; // request authorization to track the user s location [locman requestwheninuseauthorization];

Location Notifications Core Location registration CLLocationManager *locman = [[CLLocationManager alloc] init]; locman.delegate = self; // request authorization to track the user s location [locman requestwheninuseauthorization];

Location Notifications Core Location registration CLLocationManager *locman = [[CLLocationManager alloc] init]; locman.delegate = self; // request authorization to track the user s location [locman requestwheninuseauthorization];

Location Notifications Core Location registration Key Type Type Information Property List NSLocationWhenInUseUsageDescription Localization native development region Bundle display name Executable file Dictionary String String String String (17 items) Enabling location tracking allows friends to see where you are. en ${PRODUCT_NAME} ${EXECUTABLE_NAME}

Location Notifications Core Location registration Key Type Type Information Property List NSLocationWhenInUseUsageDescription Localization native development region Bundle display name Executable file Dictionary String String String String (17 items) Enabling location tracking allows friends to see where you are. en ${PRODUCT_NAME} ${EXECUTABLE_NAME}

Location Notifications Core 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]; }

Location Notifications Core 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]; }

Location Notifications Core 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]; }

Location Notifications Core 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]; }

Location Notifications Notification 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];

Location Notifications Notification 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];

Location Notifications Notification 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];

Location Notifications Notification 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];

Location Notifications Notification 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];

Location Notifications Notification handling - (void)application:(uiapplication *)application didreceivelocalnotification: (UILocalNotification *)notification { CLRegion *region = notification.region; } if (region) { } [self tellfriendsuserarrivedatregion:region];

Location Notifications Notification handling - (void)application:(uiapplication *)application didreceivelocalnotification: (UILocalNotification *)notification { CLRegion *region = notification.region; } if (region) { } [self tellfriendsuserarrivedatregion:region];

Location Notifications Notification handling - (void)application:(uiapplication *)application didreceivelocalnotification: (UILocalNotification *)notification { CLRegion *region = notification.region; } if (region) { } [self tellfriendsuserarrivedatregion:region];

Location Notifications Notification handling - (void)application:(uiapplication *)application didreceivelocalnotification: (UILocalNotification *)notification { CLRegion *region = notification.region; } if (region) { } [self tellfriendsuserarrivedatregion:region];

Location Notifications Wrap up UILocalNotification API addition Requires Core Location registration application:didreceivelocalnotification: not called if CoreLocation disabled

Recap Notification actions User and Remote Notification registration Location Notifications

More Information Paul Danbold Core OS Technologies Evangelist danbold@apple.com Documentation http://developer.apple.com Apple Developer Forums http://devforums.apple.com

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

Labs Notifications Lab Services Lab B Wednesday 3:15PM Security and Privacy Lab Core OS Lab B Thursday 3:15PM