150
These are confidential sessions—please refrain from streaming, blogging, or taking pictures Session 310 Filip Krsmanovic Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps

Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

These are confidential sessions—please refrain from streaming, blogging, or taking pictures

Session 310Filip KrsmanovicEngineering Manager, Mobile Apps

Harnessing iOS toCreate Magic in Your Apps

Page 2: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Apple Store App

Page 3: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events
Page 4: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Agenda

We are here

An event is coming up... Spending time at location...Event

Page 5: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

iOS Technologies We Will Use

Page 6: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

iOS Technologies We Will Use

• Calendar Events

Page 7: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

iOS Technologies We Will Use

• Calendar Events• Push Notification

Page 8: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

iOS Technologies We Will Use

• Calendar Events• Push Notification• Core Location• Region Monitoring

Page 9: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

iOS Technologies We Will Use

• Calendar Events• Push Notification• Core Location• Region Monitoring• iBeacons

Page 10: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Tell your users about itAn Event is Coming Up

Page 11: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

We are here

Remind the user of an event

Agenda

An event is coming up... Spending time at location...Event

Page 12: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

We are here

Remind the user of an event

Agenda

An event is coming up... Spending time at location...Event

Page 13: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events
Page 14: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

iPhone UpgradeNotifications

Page 15: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events
Page 16: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events
Page 17: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events
Page 18: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events
Page 19: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events
Page 20: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events
Page 21: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events
Page 22: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events
Page 23: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Calendar Events

Page 24: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Calendar Events

Page 25: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Calendar Events

• Simple, yet effective

[eventStore requestAccessToEntityType:EKEntityTypeEvent! ! ! completion:^(BOOL granted, NSError *error) {!

if (granted) {if(eventStore.defaultCalendarForNewEvents.allowsContentModifications) {

! ! ! ! ! ! EKEvent *event = [EKEvent ! ! ! ! ! ! eventWithEventStore:eventStore];! ! ! ! !! ! ! ! ! ! event.title = @"Check iPhone Eligibility";! ! ! ! !! ! ! ! ! ! [eventStore saveEvent:event ! ! ! ! ! ! span:EKSpanThisEvent commit:YES error:...];! ! ! !

} else { //Handle rejection }}];

Page 26: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Push Notifications

Page 27: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Push Notifications

Page 28: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Push Notifications

• Rich, dynamic event notification

Page 29: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Push Notifications

• Rich, dynamic event notification• Register push with -[UIApplication registerForRemoteNotificationTypes:]

Page 30: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Push Notifications

• Rich, dynamic event notification• Register push with -[UIApplication registerForRemoteNotificationTypes:]

• Receive token from-application: didRegisterForRemoteNotificationsWithDeviceToken:

Page 31: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Push Notifications

• Rich, dynamic event notification• Register push with -[UIApplication registerForRemoteNotificationTypes:]

• Receive token from-application: didRegisterForRemoteNotificationsWithDeviceToken:

• Store token on your server. When it’s time, send the push to APNS with token

Page 32: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Push Notifications

• Rich, dynamic event notification• Register push with -[UIApplication registerForRemoteNotificationTypes:]

• Receive token from-application: didRegisterForRemoteNotificationsWithDeviceToken:

• Store token on your server. When it’s time, send the push to APNS with token

• Your app may be launched via callback-application:didReceiveRemoteNotification:

Page 33: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Tips, TricksAnd Best Practices

Page 34: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Thou Shalt Not Spam

Page 35: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Thou Shalt Not Spam

Page 36: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Thou Shalt Not Spam

• Notify users of events they care about

Page 37: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Thou Shalt Not Spam

• Notify users of events they care about

• Provide an opt-in method■ At correct moment in a flow■ In in-app settings

Page 38: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Granular In-App Notification Settings

Page 39: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Granular In-App Notification Settings

Page 40: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Granular In-App Notification Settings

Page 41: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Granular In-App Notification Settings

• For multiple push notification types

Page 42: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Granular In-App Notification Settings

• For multiple push notification types• Reduce chance of user completely turning off app pushes

Page 43: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Consider the Time of Day

Page 44: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Consider the Time of Day

Page 45: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Consider the Time of Day

• Be polite■ Find best time range to send push■ Consider time zones

Page 46: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Consider the Time of Day

• Be polite■ Find best time range to send push■ Consider time zones

• Create a “Do Not Disturb” time window for safety■ Do not depend on user’s DND settings

■ Set your own DND window in your push engine and use queuing

Page 47: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Clean Up “Dead” Tokens

Page 48: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Clean Up “Dead” Tokens

Page 49: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Clean Up “Dead” Tokens

• Query the Apple Push Notification feedback service■ feedback.push.apple.com:2196

Page 50: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Clean Up “Dead” Tokens

• Query the Apple Push Notification feedback service■ feedback.push.apple.com:2196

• Read the list of invalid push tokens■ The list is cleared when you read it

Page 51: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Clean Up “Dead” Tokens

• Query the Apple Push Notification feedback service■ feedback.push.apple.com:2196

• Read the list of invalid push tokens■ The list is cleared when you read it

• Stop using these tokens

Page 52: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Welcome your usersArriving at Your Event

Page 53: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Agenda

We are here

Spending time at location...

Welcome theuser

Remind the user of an event

An event is coming up... Event

Page 54: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Agenda

We are here

Spending time at location...

Welcome theuser

Remind the user of an event

An event is coming up... Event

Page 55: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events
Page 56: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events
Page 57: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Storefront Pickup

Page 58: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Upper West SideJohn

Page 59: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

John has an order ready for pickup at Upper West Side

Upper West Side

Page 60: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events
Page 61: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events
Page 62: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events
Page 63: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events
Page 64: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events
Page 65: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events
Page 66: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events
Page 67: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events
Page 68: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events
Page 69: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events
Page 70: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events
Page 71: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events
Page 72: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events
Page 73: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events
Page 74: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Region Monitoring

Page 75: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Region Monitoring

Page 76: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Region Monitoring

• Register with Core Location to monitor regions of interest-[CLLocationManager startMonitoringForRegion:]

Page 77: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Region Monitoring

• Register with Core Location to monitor regions of interest-[CLLocationManager startMonitoringForRegion:]

• Core Location wakes your app and notifies delegates- locationManager:didEnterRegion:- locationManager:didDetermineState:forRegion:

Page 78: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Region Monitoring

• Register with Core Location to monitor regions of interest-[CLLocationManager startMonitoringForRegion:]

• Core Location wakes your app and notifies delegates- locationManager:didEnterRegion:- locationManager:didDetermineState:forRegion:

• Post local notification if appropriate-[UIApplication scheduleLocalNotification:]-[UIApplication presentLocalNotificationNow:]

Page 79: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Tips, TricksAnd Best Practices

Page 80: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Minimize Battery Drain

Page 81: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Minimize Battery Drain

Page 82: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Minimize Battery Drain

• Background code and server calls use up power

Page 83: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Minimize Battery Drain

• Background code and server calls use up power

• Minimize background code on wake■ Employ safety checks—cache server data, use time stamps, etc.

Page 84: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Minimize Battery Drain

• Background code and server calls use up power

• Minimize background code on wake■ Employ safety checks—cache server data, use time stamps, etc.

• Significant testing required■ Both in Instruments and real life

Page 85: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Consider Privacy

Page 86: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Consider Privacy

Page 87: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Consider Privacy

• User perception of location arrow■ “You know where I am”■ “You are draining my battery”

Page 88: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Consider Privacy

• User perception of location arrow■ “You know where I am”■ “You are draining my battery”

• Be upfront with your users

Page 89: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Consider Privacy

• User perception of location arrow■ “You know where I am”■ “You are draining my battery”

• Be upfront with your users• Monitor location only as needed

■ Minimize the arrow

Page 90: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Handle Multiple Regions

Page 91: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Handle Multiple Regions

Page 92: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Handle Multiple Regions

• iOS allows you 20 regions to monitor

Page 93: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Handle Multiple Regions

• iOS allows you 20 regions to monitor• To start monitoring

■ Use user’s current location and register nearby locations

■ Allow ZIP code option in case of user traveling

Page 94: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Handle Multiple Regions

• iOS allows you 20 regions to monitor• To start monitoring

■ Use user’s current location and register nearby locations

■ Allow ZIP code option in case of user traveling

• To update regions■ Perform when app is awake■ Use Significant Location Change when app is in background

Page 95: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Enrich the user experienceSpending Time at Your Location

Page 96: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Enrich the user’s experience

Agenda

We are here

Spending time at location...

Welcome theuser

Remind the user of an event

An event is coming up... Event

Page 97: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Enrich the user’s experience

Agenda

We are here

Spending time at location...

Welcome theuser

Remind the user of an event

An event is coming up... Event

Page 98: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events
Page 99: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

In-Store Mode

Page 100: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events
Page 101: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events
Page 102: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events
Page 103: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events
Page 104: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

In-Location Mode

Page 105: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

In-Location Mode

Page 106: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

In-Location Mode

• Use Core Location APIs to obtain current user location-[CLLocationManager startUpdatingLocation]-locationManager:didUpdateLocations:

Page 107: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

In-Location Mode

• Use Core Location APIs to obtain current user location-[CLLocationManager startUpdatingLocation]-locationManager:didUpdateLocations:

• Check distance between the user and the location of interest

Page 108: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

In-Location Mode

• Use Core Location APIs to obtain current user location-[CLLocationManager startUpdatingLocation]-locationManager:didUpdateLocations:

• Check distance between the user and the location of interest

• If within threshold, consider the user in the location and expose in-location UI

Page 109: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

In-Location Mode

• Use Core Location APIs to obtain current user location-[CLLocationManager startUpdatingLocation]-locationManager:didUpdateLocations:

• Check distance between the user and the location of interest

• If within threshold, consider the user in the location and expose in-location UI

• Adjust your desired accuracy according to distance-[CLLocationManager setDesiredAccuracy:]

Page 110: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Tips, TricksAnd best practices

Page 111: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

UI Guidelines

Page 112: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

UI Guidelines

Page 113: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

UI Guidelines

• Be distinctive and discernible

Page 114: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

UI Guidelines

• Be distinctive and discernible• Focus the user

Page 115: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

UI Guidelines

• Be distinctive and discernible• Focus the user• Be easily dismissed

Page 116: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

UI Guidelines

• Be distinctive and discernible• Focus the user• Be easily dismissed

Page 117: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

UI Guidelines

• Be distinctive and discernible• Focus the user• Be easily dismissed

Page 118: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

In-Location UI Relevant Only In Location

Page 119: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

In-Location UI Relevant Only In Location

Page 120: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

In-Location UI Relevant Only In Location

• Detect if user has left location■ Use CL to listen for exit events■ Check user location on startup

Page 121: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

In-Location UI Relevant Only In Location

• Detect if user has left location■ Use CL to listen for exit events■ Check user location on startup

• Handle location boundary conditions■ Increase in-location thresholds

Page 122: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Use iBeacons to unlock new potentialRicher Experiences with iOS 7

Page 123: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

iBeaconsRegion monitoring

Page 124: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events
Page 125: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events
Page 126: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events
Page 127: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events
Page 128: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events
Page 129: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events
Page 130: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events
Page 131: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events
Page 132: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

iBeaconsRanging and micro-locations

Page 133: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events
Page 134: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events
Page 135: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events
Page 136: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events
Page 137: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events
Page 138: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events
Page 139: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

iBeacons

Page 140: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

iBeacons

Page 141: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

iBeacons

• Core Location monitors Bluetooth LE beacon signals

Page 142: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

iBeacons

• Core Location monitors Bluetooth LE beacon signals

• Various hardware can be a beacon■ Third-party Bluetooth LE emitters■ iOS devices

Page 143: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

iBeacons

• Core Location monitors Bluetooth LE beacon signals

• Various hardware can be a beacon■ Third-party Bluetooth LE emitters■ iOS devices

• Advantages■ Accuracy and range awareness■ One beacon ID can cover multiple locations

Page 144: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

DemoiBeacons region monitoring and ranging in practice

Yingfeng SuEngineering Manager

Mathieu RoigEngineer

Page 145: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

• Key iOS technologies form the basis of great experiences in your apps

Summary

Page 146: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

• Key iOS technologies form the basis of great experiences in your apps

Summary

• Use these technologies wisely and appropriately

Page 147: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

• Key iOS technologies form the basis of great experiences in your apps

Summary

• Use these technologies wisely and appropriately• Download the Apple Store App and follow along

Page 148: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

More Information

Paul MarcosApp Services [email protected]

Reference iOS AppApple Store Apphttp://itunes.apple.com/app/apple-store/id375380948

Apple Developer Forumshttp://devforums.apple.com

Page 149: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events

Integrating Passbook into your Ecosystem Pacific HeightsWednesday 3:15PM

Related Sessions

What’s New with Multitasking PresidioTuesday 2:00PM

What’s New in Core Location PresidioThursday 11:30AM

Page 150: Harnessing iOS to Create Magic in Your Apps...Engineering Manager, Mobile Apps Harnessing iOS to Create Magic in Your Apps. Apple Store App. Agenda We are here ... •Calendar Events