SiriKit, How to display response for start Workout Intent?

后端 未结 1 1808
隐瞒了意图╮
隐瞒了意图╮ 2021-01-14 01:12

IntentHandler class:

import Intents

class IntentHandler: INExtension, INStartWorkoutIntentHandling {

    public func handle(startWorkout i         


        
相关标签:
1条回答
  • 2021-01-14 01:46

    Although Apple says here:

    You can provide an Intents UI extension if you are supporting intents in the following domains:
    Messaging
    Payments
    Ride booking
    Workouts

    I think it is quite impossible, because response responsible for open UI is not prepared for this:

    Please look at INSendMessageIntentResponseCode for INSentMessageIntentHandling:

    public enum INSendMessageIntentResponseCode : Int {
    
    
        case unspecified
    
        case ready
    
        case inProgress
    
        case success
    
        case failure
    
        case failureRequiringAppLaunch
    
        case failureMessageServiceNotAvailable
    }
    

    and INStartWorkoutIntentResponse for INStartWorkoutIntentHandling:

    public enum INStartWorkoutIntentResponseCode : Int {
    
    
        case unspecified
    
        case ready
    
        case continueInApp
    
        case failure
    
        case failureRequiringAppLaunch
    
        case failureOngoingWorkout
    
        case failureNoMatchingWorkout
    }
    

    For the second one, there is only .continueInApp, and this is exactly what happens here, opposite to the first one where exists: .success and .inProgress

    0 讨论(0)
提交回复
热议问题