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

Kristina Thai: Driving User Engagement with wat...

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

Realm

September 02, 2016
Tweet

More Decks by Realm

Other Decks in Technology

Transcript

  1. @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) } }
  2. @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) } }
  3. @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) }
  4. @KRISTINATHAI WKWatchConnectivityRefreshBackgroundTask ⌚ Get latest data from iPhone via Watch

    Connectivity ⌚ Be a good battery/data citizen by pulling data from server only once
  5. @KRISTINATHAI LOCAL NOTIFICATIONS Like push notifications, but scheduled locally Handled

    by UNUserNotificationCenter (allows management of duplicates sent to both devices)
  6. @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
  7. @KRISTINATHAI Respond to custom notification action func userNotificationCenter(_ center: UNUserNotificationCenter,

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

    any direct interaction ⌚ Background Tasks Complications Local Notifications