enhancing voip apps with callkit - apple inc....enhancing voip apps with callkit sirisha...

150
© 2016 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple. App Frameworks #WWDC16 Session 230 Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer Nick Fraioli CallKit Engineer

Upload: others

Post on 26-Jul-2020

5 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

© 2016 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple.

App Frameworks #WWDC16

Session 230

Enhancing VoIP Apps with CallKit

Sirisha Pillalamarri CallKit EngineerStuart Montgomery CallKit EngineerNick Fraioli CallKit Engineer

Page 2: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

How do VoIP apps work today?

Page 3: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action
Page 4: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action
Page 5: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action
Page 6: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action
Page 7: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Wouldn’t it be nice if…

Page 8: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action
Page 9: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action
Page 10: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action
Page 11: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action
Page 12: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action
Page 13: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action
Page 14: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action
Page 15: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action
Page 16: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

CallKit

Page 17: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Agenda

ArchitectureIncoming CallOutgoing CallAPI Details

Page 18: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

System Services

Architecture

VoIP App

-

System

Page 19: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

System Services

Architecture

VoIP App

CallKit

-

System

Page 20: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

System Services

Architecture

VoIP App

CallKitCallKit

- -

System

Page 21: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Architecture

VoIP App

CallKit

System

Page 22: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Architecture

VoIP App

CallKit

System

Page 23: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Architecture

System

Page 24: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Architecture

System

Page 25: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Architecture

System

Speakerbox

Page 26: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Architecture

App Code App UI

System

Speakerbox

Page 27: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Architecture

CallKit

App Code App UI

System

Speakerbox

Page 28: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Architecture

CallKit

App Code App UI

CXProvider

-

System

Speakerbox

Page 29: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Architecture

CallKit

App Code App UI

CXCallController

-

CXProvider

-

System

Speakerbox

Page 30: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

CXProvider vs. CXCallController

Page 31: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

CXProvider vs. CXCallController

CXProvider

Page 32: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

CXProvider vs. CXCallController

CXProvider

Out-of-band notifications

Page 33: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

CXProvider vs. CXCallController

CXProvider

Out-of-band notificationsNot user actions

Page 34: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

CXProvider vs. CXCallController

CXProvider

Out-of-band notificationsNot user actionsExternal events• Incoming call

Page 35: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

CXProvider vs. CXCallController

CXCallControllerCXProvider

Out-of-band notificationsNot user actionsExternal events• Incoming call

Page 36: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

CXProvider vs. CXCallController

CXCallControllerCXProvider

Out-of-band notificationsNot user actionsExternal events• Incoming call

Requests from app

Page 37: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

CXProvider vs. CXCallController

CXCallControllerCXProvider

Out-of-band notificationsNot user actionsExternal events• Incoming call

Requests from app Local user actions

Page 38: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

CXProvider vs. CXCallController

CXCallControllerCXProvider

Out-of-band notificationsNot user actionsExternal events• Incoming call

Requests from app Local user actionsInternal events• Start call

Page 39: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

CXProvider vs. CXCallController

CXCallControllerCXProvider

Out-of-band notificationsNot user actionsExternal events• Incoming call

Requests from app Local user actionsInternal events• Start call

Interplay with other providers• Hold and Start Call

Page 40: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

CXProvider vs. CXCallControllerExample uses

Page 41: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

CXProvider vs. CXCallControllerExample uses

Use CXProvider to report

Incoming callOutgoing call connectedCall ended on remote side

Page 42: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

CXProvider vs. CXCallControllerExample uses

Use CXCallController to request

Start outgoing callAnswer callEnd call

Use CXProvider to report

Incoming callOutgoing call connectedCall ended on remote side

Page 43: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Speakerbox

Architecture

CallKit

App Code

System

CXProvider

Page 44: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Speakerbox

Architecture

CallKit

App Code

-

System

CXProvider

CXCallUpdate

Page 45: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Speakerbox

Architecture

CallKit

App Code

System

CXProvider

Page 46: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Speakerbox

Architecture

CallKit

App Code

System

CXProvider

CXAction

-

Page 47: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Speakerbox

Architecture

CallKit

App Code

System

CXCallController

Page 48: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Speakerbox

Architecture

CallKit

App Code

System

-

CXCallController

CXTransaction

Page 49: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Incoming Call

Page 50: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Speakerbox

Architecture

CallKit

App Code

System

Page 51: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Speakerbox

Architecture

CallKit

App Code

CXProvider

System

Page 52: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Speakerbox

Architecture

CallKit

App Code

-

CXCallUpdate

CXProvider

System

Page 53: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Speakerbox

Architecture

CallKit

App Code

-

CXCallUpdate

-

CXProvider

System

System UIIncoming Call

Page 54: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Speakerbox

Architecture

CallKit

App Code

System

CXProvider

System UI

Page 55: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Speakerbox

Architecture

CallKit

App Code

-

System

CXProvider

System UIAnswer

Page 56: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Speakerbox

Architecture

CallKit

App Code

-

CXAnswerCallActionSystem

CXProvider

- System UI

Page 57: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Speakerbox

Architecture

CallKit

App Code

-

CXAnswerCallActionSystem

CXProvider

- System UI

Answer

Page 58: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Speakerbox

Architecture

CallKit

App Code App UI

CXProvider

System

Page 59: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Speakerbox

Architecture

CallKit

App Code App UI

CXCallControllerCXProvider

System

End

Page 60: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Speakerbox

Architecture

CallKit

App Code App UI

CXTransaction(CXEndCallAction)

-

CXCallControllerCXProvider

System

Page 61: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Speakerbox

Architecture

CallKit

App Code App UI

CXTransaction(CXEndCallAction)

-

CXEndCallAction

CXCallControllerCXProvider

-

System

Page 62: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Speakerbox

Architecture

CallKit

App Code App UI

CXTransaction(CXEndCallAction)

-

CXEndCallAction

CXCallControllerCXProvider

-

System

End

Page 63: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

DemoIncoming Call

Stuart Montgomery

Page 64: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Incoming callRecap

Page 65: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Incoming callRecap

Reported incoming call to system

provider.reportNewIncomingCall(with: UUID, update: CXCallUpdate) { error in /* ... */ }

Page 66: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Incoming callRecap

Reported incoming call to system

func provider(_ provider: CXProvider, perform action: CXAnswerCallAction) { /* ... */ }

provider.reportNewIncomingCall(with: UUID, update: CXCallUpdate) { error in /* ... */ }

Performed the CXAnswerCallAction

Page 67: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Incoming callRecap

Reported incoming call to system

func provider(_ provider: CXProvider, perform action: CXAnswerCallAction) { /* ... */ }

answerCallAction.fulfill()

provider.reportNewIncomingCall(with: UUID, update: CXCallUpdate) { error in /* ... */ }

Performed the CXAnswerCallAction

Fulfilled the CXAnswerCallAction

Page 68: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Call Actions

CXAnswerCallActionCXStartCallActionCXEndCallActionCXSetHeldCallActionCXSetGroupCallActionCXPlayDTMFCallActionCXSetMutedCallAction

Page 69: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Managing Multiple Calls

Page 70: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Managing Multiple Calls

CXTransaction

Page 71: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Managing Multiple Calls

CXTransaction• List of multiple actions

Page 72: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Managing Multiple Calls

CXTransaction• List of multiple actions• CXEndCallAction and CXAnswerCallAction

Page 73: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Managing Multiple Calls

CXTransaction• List of multiple actions• CXEndCallAction and CXAnswerCallAction• Fulfill each action individually

Page 74: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Managing Multiple Calls

CXTransaction• List of multiple actions• CXEndCallAction and CXAnswerCallAction• Fulfill each action individually

Page 75: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Outgoing Call

Page 76: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Call controllerOutgoing Call

Page 77: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Call controllerOutgoing Call

Page 78: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Call controllerOutgoing Call

Handle start call intent

Speakerbox

Start Call

Page 79: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Call controllerOutgoing Call

Handle start call intent

Introducing SiriKit Presidio Wednesday 5:00PM

Speakerbox

Start Call

Page 80: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Call controllerOutgoing Call

Handle start call intentCreate start call action

Speakerbox

App Code Start Call

Page 81: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Call controllerOutgoing Call

Handle start call intentCreate start call actionRequest start call action

Speakerbox

CallKit

App Code

CXCallController

Start Call

Page 82: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Call controllerOutgoing Call

Handle start call intentCreate start call actionRequest start call actionReceive start call action

Speakerbox

CallKit

App Code

CXProvider CXCallController

System

Page 83: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Call controllerOutgoing Call

Handle start call intentCreate start call actionRequest start call actionReceive start call actionExecute start call action

Speakerbox

CallKit

App Code

CXProvider CXCallController

System

Start Call

Page 84: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

LifecycleOutgoing Call

Page 85: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

LifecycleOutgoing Call

Page 86: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

LifecycleOutgoing Call

Starting

Page 87: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

LifecycleOutgoing Call

Starting

Page 88: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

LifecycleOutgoing Call

Starting Started

Page 89: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

LifecycleOutgoing Call

Starting Started

Page 90: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

LifecycleOutgoing Call

Starting Started Connecting

Page 91: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

LifecycleOutgoing Call

Starting Started Connecting

Page 92: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

LifecycleOutgoing Call

Starting Started Connecting Connected

Page 93: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

DemoOutgoing Call

Stuart Montgomery

Page 94: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Outgoing callRecap

Page 95: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Outgoing callRecap

Request start call action with Call Controller

callController.request(startCallTransaction) { error in /* ... */ }

Page 96: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Outgoing callRecap

callController.request(startCallTransaction) { error in /* ... */ }

startCallAction.fulfill()

Request start call action with Call Controller

Fulfill start call action with Provider

Page 97: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Outgoing callRecap

callController.request(startCallTransaction) { error in /* ... */ }

Request start call action with Call Controller

startCallAction.fulfill()

Fulfill start call action with Provider

provider.reportOutgoingCall(with: call.uuid, startedConnectingAt: call.connectingDate) provider.reportOutgoingCall(with: call.uuid, connectedAt: call.connectDate)

Send call state updates

Page 98: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

API Details

Page 99: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

API Details

AuthorizationConfigurationAction ErrorsSystem RestrictionsAudio

Page 100: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Provider Authorization

Page 101: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Provider Authorization

Check authorization status

Page 102: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Provider Authorization

Check authorization statusRequest authorization

Page 103: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Provider Authorization

Check authorization statusRequest authorizationObserve authorization changes

Page 104: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Provider Configuration

Page 105: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Provider Configuration

Customized experience

Page 106: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Provider Configuration

Customized experience• Localized name for display

Page 107: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Provider Configuration

Customized experience• Localized name for display• Video support

Page 108: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Customized experience• Localized name for display• Video support• Masked image icon

Provider Configuration

Page 109: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Failing actions appropriatelyAction Errors

Page 110: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Failing actions appropriatelyAction Errors

Page 111: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Failing actions appropriately

Starting

Action Errors

Receive action

Page 112: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Failing actions appropriately

Starting

Action Errors

Receive action

Page 113: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Failing actions appropriately

Starting

Action Errors

Started

Receive action

Page 114: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Failing actions appropriatelyAction Errors

Receive action

Starting Started

Page 115: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Failing actions appropriatelyAction Errors

Receive actionFail action

Starting Started

Page 116: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Failing actions appropriatelyAction Errors

Receive actionFail action

Starting Started

Page 117: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Failing actions appropriatelyAction Errors

Receive actionFail action

Starting Started

Page 118: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

TimeoutsAction Errors

Page 119: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

TimeoutsAction Errors

Page 120: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

TimeoutsAction Errors

Enforce app responsiveness

Page 121: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

TimeoutsAction Errors

Enforce app responsivenessRespond to actions in a timely manner

Page 122: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

TimeoutsAction Errors

Enforce app responsivenessRespond to actions in a timely mannerReact to action timeouts

Page 123: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Incoming callSystem Restrictions

Page 124: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Incoming callSystem Restrictions

Not authorized

Page 125: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Incoming callSystem Restrictions

Not authorizedBlock list

Page 126: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Incoming callSystem Restrictions

Not authorizedBlock listDo not disturb

Page 127: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Incoming callSystem Restrictions

Not authorizedBlock listDo not disturb• React to completion handler

provider.reportNewIncomingCall(with: UUID(), update: CXCallUpdate()) { error in

if let incomingCallError = error,

incomingCallErrorCode = CXErrorCodeIncomingCallError(rawValue: incomingCallError.code)

where incomingCallErrorCode == .filteredByDoNotDisturb {

// handle do not disturb

}

}

Page 128: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

BenefitsAudio

Page 129: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

BenefitsAudio

High priority session

Page 130: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

BenefitsAudio

High priority sessionFewer interruptions

Page 131: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

BenefitsAudio

High priority sessionFewer interruptionsAudio routing hints

Page 132: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Incoming callAudio

Page 133: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Incoming callAudio

Page 134: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Incoming callAudio

Answer Received Answer Fulfilled

Page 135: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Incoming callAudio

Answer Received Answer Fulfilled

Page 136: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Incoming callAudio

Answer Received Answer Fulfilled

Configure AVAudioSession

Page 137: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Incoming callAudio

Answer Received Answer Fulfilled

Configure AVAudioSession

Page 138: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Incoming callAudio

Answer Received Answer Fulfilled

Configure AVAudioSession

Page 139: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Incoming callAudio

Answer Received Answer Fulfilled

Configure AVAudioSession

Page 140: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Incoming callAudio

Answer Received Answer Fulfilled

Configure AVAudioSession

Did activateAVAudioSession

Page 141: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Incoming callAudio

Answer Received Answer Fulfilled

Configure AVAudioSession

Did activateAVAudioSession

Start call media

Page 142: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

API detailsRecap

AuthorizationConfigurationAction ErrorsSystem RestrictionsAudio

Page 143: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Summary

Page 144: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Summary

Integration into the system

Page 145: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Summary

Integration into the systemFeature parity

Page 146: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Summary

Integration into the systemFeature parityBetter app visibility

Page 147: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

More Information

https://developer.apple.com/wwdc16/230

Page 148: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Related Sessions

Introducing SiriKit Presidio Wednesday 5:00PM

Extending Your Apps with SiriKit Nob Hill Thursday 1:40PM

Networking with for the Modern Internet Pacific Heights Thursday 3:00PM

Delivering an Exceptional Audio Experience Nob Hill Friday 1:40PM

Page 149: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action

Labs

CallKit Lab Frameworks Lab A Friday 9:00AM

SiriKit Lab Frameworks Lab B Friday 9:00AM

Networking Lab 2 Frameworks Lab D Friday 2:00PM

Audio Lab Graphics, Games, and Media Lab D Friday 3:00PM

Page 150: Enhancing VoIP Apps with CallKit - Apple Inc....Enhancing VoIP Apps with CallKit Sirisha Pillalamarri CallKit Engineer Stuart Montgomery CallKit Engineer ... Create start call action