WWDC 2015

What's New in Notifications

Notifications are essential part for iOS. In iOS 9, notifications are allowed to do "reply".

iOS Notification

  • Slient Notification
    • notify the app
    • dont need user's approve
    • background app refresh (beware if user turn off)
    • Best effort( not 100%!)
  • User Notification
    • notify user
    • requires user permissions
    • Can be disabled
      • Local Notification sent by
        • Time
        • Location
      • Remote Notification
  • Actions (Interactive Notifications)
    • Categories
    • Everything supported in WatchOS2
      • Custom look of notifications
      • Related Session: WatchKit In-Depth, Path 1 & WatchKit In-Depth, Path 2
  • Text input
    • New Actions
    • Everywhere
    • Work with Multiple actions
      //Registering the text input notification
      let replyAction = UIMutableUserNotificationAction()
      reply.title = "reply" 
      //config rest of actions..
      reply.behavior = .TextInput
      //Receive the text input
      protocol UIApplicationDelegate {
        func application(application: UIApplication, 
            handleActionWithIdentifier identifier: String?,
            forRemoteNotification notification: [ NSObject : AnyObject ],
            withResponseInfo responseInfo: [ NSObject : AnyObject ], 
            completionHandler completionHandler: () -> Void)
        {
        //Handle responseInfoDict with text input in notification
        if identifier == "comment-reply",
        let response = responseInfo[UIUserNotificationActionResponseTypedTextKey],
            responseText = response as? String {
            viewController.appendText(responseText)
        }
        completionHandler()
      }
      

For more in Apple Watch, Related Session: WatchKit In-Depth, Path 1 & WatchKit In-Depth, Path 2

  • Text input

iOS 8 Competibility

Register different notification actions for different ios version (iOS 8 does not have text input)

Updates in APNS

APNS Feedback Push provider pulls data periodically to validate the tokens

Large Push token from 32 bit to 64 bit

New Provider API

the connection between APNS and Providers are in HTTP/2 protocol

Instant Feedback no need to pulling from Feedback to provider APNS will tell provider if the device token is invalid and the timestamp of that start invalided.

Simple Certificate handling

  • applications push
  • VOIP push
  • Watch Complication push
  • Development and production environments
  • NOW ON ONE CERTIFICATE

Push payload from 2KB to 4KB applying all iOS version and OSX

Related Session: Creating Complication with ClockKit, Networking with NSURLSession, Introducting Watch Connectivity