fail()
Reports the failed execution of the action.
Declaration
func fail()Discussion
Calling this method sets the isComplete property value to true. Calling this method more than once or calling it after calling the fulfill() method has no effect.
It’s safe to call fail() asynchronously. For example, call it in CXProviderDelegate callback method implementations as shown in the following code snippet from the Making and receiving VoIP calls sample code project:
func provider(_ provider: CXProvider, perform action: CXStartCallAction) {
//
// ...
//
// Trigger the call to be started via the underlying network service.
call.startSpeakerboxCall { success in
if success {
// Signal to the system that the action was successfully performed.
action.fulfill()
// ...
} else {
// Signal to the system that the action was unable to be performed.
action.fail()
}
}
}