Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Kristina Thai: Driving User Engagement with watchOS 3

1fa9cb8c7997c8c4d3d251fb5e41f749?s=47 Realm
September 02, 2016

Kristina Thai: Driving User Engagement with watchOS 3

Bio:
Kristina Thai is an iOS Software Engineer at Intuit, where she works on the QuickBooks Self-Employed iOS application. She is an expert in Apple Watch development and regularly writes tutorials and technical commentary on the subject on her website kristina.io. As an international technical speaker, she has presented multiple times on Apple Watch development and has hosted workshops on how to build watch apps. Her past speaking events include talks at iOSDevUK, Swift Summit, Grace Hopper and many more. Kristina has a B.S. in Computer Science from the University of California, San Diego. Fun fact: she follows more animals on Instagram than people.

Abstract:
One of the most interesting aspects of the Apple Watch is the fact that it is a new opportunity to engage with and delight your users. What’s different about these interactions, compared to the phone, is that they should be as short as possible - 2 seconds! What can you do in 2 seconds?! Using complications, notifications, and quick access to apps in memory, we’ll take a look at not only how to create and use each of these features on the watch, but also the best way to delight your users with each! After attending this talk, you’ll walk away with some new strategies on how to increase your app’s indispensability through these awesome watch features.

Twitter: https://twitter.com/kristinathai

1fa9cb8c7997c8c4d3d251fb5e41f749?s=128

Realm

September 02, 2016
Tweet

Transcript

  1. WITH WATCHOS 3 DRIVING USER ENGAGEMENT KRISTINA THAI IOS SOFTWARE

    ENGINEER ⌚ @KRISTINATHAI
  2. @KRISTINATHAI USER ENGAGEMENT

  3. @KRISTINATHAI ??? USER ENGAGEMENT

  4. @KRISTINATHAI ⌚ Background Tasks Complications Local Notifications USER ENGAGEMENT

  5. COMPLICATIONS

  6. @KRISTINATHAI

  7. @KRISTINATHAI

  8. @KRISTINATHAI

  9. @KRISTINATHAI

  10. @KRISTINATHAI import ClockKit class ComplicationController: NSObject, CLKComplicationDataSource { // MARK:

    - Timeline Configuration func getSupportedTimeTravelDirections(for complication: CLKComplication, withHandler handler: @escaping (CLKComplicationTimeTravelDirections) -> Void) { handler([.forward, .backward]) } func getTimelineStartDate(for complication: CLKComplication, withHandler handler: @escaping (Date?) -> Void) { handler(nil) } func getTimelineEndDate(for complication: CLKComplication, withHandler handler: @escaping (Date?) -> Void) { handler(nil) } func getPrivacyBehavior(for complication: CLKComplication, withHandler handler: @escaping (CLKComplicationPrivacyBehavior) -> Void) { handler(.showOnLockScreen) } // MARK: - Timeline Population func getCurrentTimelineEntry(for complication: CLKComplication, withHandler handler: @escaping (CLKComplicationTimelineEntry?) -> Void) { // Call the handler with the current timeline entry handler(nil) } func getTimelineEntries(for complication: CLKComplication, before date: Date, limit: Int, withHandler handler: @escaping ([CLKComplicationTimelineEntry]?) -> Void) { // Call the handler with the timeline entries prior to the given date handler(nil) } func getTimelineEntries(for complication: CLKComplication, after date: Date, limit: Int, withHandler handler: @escaping ([CLKComplicationTimelineEntry]?) -> Void) { // Call the handler with the timeline entries after to the given date handler(nil) } // MARK: - Placeholder Templates func getLocalizableSampleTemplate(for complication: CLKComplication, withHandler handler: @escaping (CLKComplicationTemplate?) -> Void) { // This method will be called once per supported complication, and the results will be cached handler(nil) } }
  11. @KRISTINATHAI Optional @KRISTINATHAI

  12. @KRISTINATHAI import ClockKit class ComplicationController: NSObject, CLKComplicationDataSource { // MARK:

    - Timeline Population func getCurrentTimelineEntry(for complication: CLKComplication, withHandler handler: @escaping (CLKComplicationTimelineEntry?) -> Void) { // Call the handler with the current timeline entry handler(nil) } func getTimelineEntries(for complication: CLKComplication, before date: Date, limit: Int, withHandler handler: @escaping ([CLKComplicationTimelineEntry]?) -> Void) { // Call the handler with the timeline entries prior to the given date handler(nil) } func getTimelineEntries(for complication: CLKComplication, after date: Date, limit: Int, withHandler handler: @escaping ([CLKComplicationTimelineEntry]?) -> Void) { // Call the handler with the timeline entries after to the given date handler(nil) } }
  13. @KRISTINATHAI func getCurrentTimelineEntry(for complication: CLKComplication, withHandler handler: @escaping (CLKComplicationTimelineEntry?) ->

    Void) { // Call the handler with the current timeline entry handler(nil) }
  14. https://theswiftdev.com/2016/04/28/clockkit-complications-cheat-sheet/ CLKComplicationTemplate @KRISTINATHAI

  15. @KRISTINATHAI

  16. @KRISTINATHAI

  17. @KRISTINATHAI func getCurrentTimelineEntry(for complication: CLKComplication, withHandler handler: @escaping (CLKComplicationTimelineEntry?) ->

    Void) { // Call the handler with the current timeline entry let template = CLKComplicationTemplateModularLargeStandardBody() template.headerTextProvider = CLKSimpleTextProvider(text: “12:00-2:00PM”) template.body1TextProvider = CLKSimpleTextProvider(text: "Lunch with Lucas") template.body2TextProvider = CLKSimpleTextProvider(text: "Saru Sushi") let timelineEntry = CLKComplicationTimelineEntry(date: Date(), complicationTemplate: template) handler(timelineEntry) }
  18. @KRISTINATHAI

  19. BACKGROUND TASKS

  20. @KRISTINATHAI

  21. @KRISTINATHAI BACKGROUND TASKS WKApplicationRefreshBackgroundTask ⌚ WKSnapshotRefreshBackgroundTask WKWatchConnectivityRefreshBackgroundTask WKURLSessionRefreshBackgroundTask

  22. @KRISTINATHAI WKApplicationRefreshBackgroundTask ⌚ ⌚ ⌚ NSURLSession ⌚ Snapshots Update app

    from background
  23. @KRISTINATHAI WKSnapshotRefreshBackgroundTask Make updates to your app’s UI Supporting up-to-date

    snapshots keeps your users informed
  24. @KRISTINATHAI WKURLSessionRefreshBackgroundTask ⌚ Trigger NSURLSession to update app from background

  25. @KRISTINATHAI WKWatchConnectivityRefreshBackgroundTask ⌚ Get latest data from iPhone via Watch

    Connectivity ⌚ Be a good battery/data citizen by pulling data from server only once
  26. LOCAL NOTIFICATIONS

  27. @KRISTINATHAI LOCAL NOTIFICATIONS Like push notifications, but scheduled locally Handled

    by UNUserNotificationCenter (allows management of duplicates sent to both devices)
  28. @KRISTINATHAI // Create the content
 let content = UNMutableNotificationContent() content.title

    = NSString.localizedUserNotificationString(forKey: "Hello!", arguments: nil) content.body = NSString.localizedUserNotificationString(forKey: "Hello_message_body", arguments: nil) content.sound = UNNotificationSound.default() // Deliver the notification in five seconds. let trigger = UNTimeIntervalNotificationTrigger.init(timeInterval: 5, repeats: false) let request = UNNotificationRequest.init(identifier: "FiveSecond", content: content, trigger:trigger) // Schedule the notification. let center = UNUserNotificationCenter.current() center.add(request) Create scheduled local notification
  29. @KRISTINATHAI LOCAL NOTIFICATIONS UNUserNotificationCenter Create custom responses for your notifications

  30. @KRISTINATHAI Respond to custom notification action func userNotificationCenter(_ center: UNUserNotificationCenter,

    didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) { if response.actionIdentifier == "Complete" { //Handle response here } }
  31. @KRISTINATHAI BOTTOM LINE Use these to engage your user without

    any direct interaction ⌚ Background Tasks Complications Local Notifications
  32. @KRISTINATHAI RESOURCES kristina.io/watchos-3-key-takeaways-from-wwdc16
 kristina.io/watchos-3-key-takeaways-from-wwdc16-part-2

  33. kristina.io
 me@kristina.io @kristinathai THANK YOU -