iOhYes Retired


A podcast by iOS developers for iOS developers, delivering news, tips, and rants for professional iOS/Mac developers, with something for enterprise and indie developers alike.

Hosted by Darryl Thomas and John Sextro.

← Previous Episode   |   Next Episode →

114: It's All Unified

July 13, 2016 at 1:15PM • 47 minutes • Wiki Entry

Discussion - Notifications in iOS 10

  • Brief breakdown of WWDC sessions related to notifications
  • New stuff
    • APNS Token-based authentication
    • UserNotifications (and UserNotificationsUI) Framework (Unifies Remote and Local Notifications)
    • Access to user-defined notification settings
    • Expanded content
      • Titles
      • Subtitles
      • Media attachments
    • Scheduling and handling within Extensions
    • In-app presentation
    • Removal/update of pending notifications
    • Dismissal actions
    • Service Extensions
  • APNS Token-based authentication
    • Uses JSON Web Tokens (libraries widely available to assist with token generation)
    • For server-side solutions where using a certificate isn’t practical/feasible
    • Addresses issue of certificate expiration (though tokens also expire, new ones can be generated on the fly)
  • UserNotifications Framework

    • Provides a single notifications API across iOS, watchOS and tvOS
      • iOS: Full support for scheduling and management of notifications
      • watchOS: Support for forwarded notifications and local notifications on the watch
      • tvOS: Support for badging app icons
    • Key components/concepts:
      • UNUserNotificationCenter
        • Authorization requests
        • Scheduling via requests (by providing content and triggers)
      • UNNotificationRequest
        • Identifier
        • Content
        • Trigger
      • UNMutableNotificationContent
      • UNNotificationAttachment
        • Audio
        • Images
        • Video
      • Triggers
        • Push (UNPushNotificationTrigger is not instantiated by apps)
        • UNTimeIntervalNotificationTrigger
        • UNCalendarNotificationTrigger
        • UNLocationNotificationTrigger
      • UNUserNotificationCenterDelegate Protocol
        • userNotificationCenter:willPresentNotification:withCompletionHandler:
        • userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler
      • UNNotificationCategory - defines a type of notification, allows actionable notifications and content extensions
      • UNNotificationAction - represents a task you can perform in response to a notification
      • UNNotificationServiceExtension - Entry point for service extensions. Allows you to process the payload of a push notification before it is presented (eg: end-to-end encryption or notification attachments). Use in conjunction with “mutable-content: 1” in the aps portion of an APNS payload.
  • UserNotificationsUI Framework

    • Provides the UNNotificationContentExtension protocol
    • View controllers adopt this protocol, using the VC’s view to display the notification contents
    • Custom content is sandwiched between a header with the application icon and title and the default notification payload (default payload can be hidden using an attribute in the Info.plist)
    • No user interaction
    • Actions are displayed and extensions can respond to them by intercepting action responses
    • Protocol provides a didRecieveNotification: method you can use to set up UI in response to the notification




This episode sponsored by Braintree

Show Notes & Links Presented by CacheFly

Tweet Shoutouts

Alternative Show Titles

  • Oh crap moment
  • It just stinks
  • Video, Whoa
  • I like animated gifs
  • That makes one of us
  • If you’re evil
  • I sorta, kinda am
  • Then they harden it