handle(_:completionHandler:) is not called to handle SiriKit intent in WatchOS

Originator:v.stratus
Number:rdar://45124997 Date Originated:09.10.2018
Status:Open Resolved:
Product:watchOS + SDK | Siri Product Version:Watch OS 5.0.1
Classification: Reproducible:always
 
Area:
Siri

In my project, I have a WatchKit extension which is assumed to handle SiriKit intents issues by WatchKit intention extension. Both WatchKit and WatchKit intention extension have deployment target version set to WatchOS 5.0.

The relevant code looks following:

IntentHandler.swift
------------------------------------------------------------------
class MyIntentHandler: NSObject, INStartWorkoutIntentHandling {
        func handle(intent: INStartWorkoutIntent, completion: @escaping (INStartWorkoutIntentResponse) -> Void) {
            let result = INStartWorkoutIntentResponse(code: .continueInApp, userActivity: nil)

            completion(result)
        }
    }
------------------------------------------------------------------

ExtensionDelegate.swift
------------------------------------------------------------------
func handle(_ intent: INIntent, completionHandler: @escaping (INStartWorkoutIntentResponse) -> Void) {
        let result = INStartWorkoutIntentResponse(code: .failure, userActivity: .none)

        completionHandler(result)
    }
------------------------------------------------------------------

The problem is that handle(_:completionHandler:) function in ExtensionDelegate.swift is not called to handle intent issued in IntentHandler.swift. The Watch app will just be started without calling this function. Needless to say, other handling functions in ExtensionDelegate.swift (e.g. handle(_:)) are called as expected at this moment.

PS: the equivalent application(_:handle:completionHandler:) function in AppDelegate.swift does get called when handling intents in the iOS target.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!