iosswiftsirikitsirishortcuts

Create custom "read" Intent like GetCurrentLocation


I'm creating shortcuts for a communication app. In this app there is a presence state (available, dnd, ...). I implemented an intent to set said presence state which worked fine. I created a "read" intent which just returns the currently set state, which works, but i can't pass the result to the next action.

For simplification and testing i created another intent just return a string, trying to process it, but i'm still unable to do that. My intent has no input parameters.

What am i missing? My Goal would be an interaction like Get Current Location offers.

class Return5IntentHandler: NSObject, Return5IntentHandling {
    func handle(intent: Return5Intent, completion: @escaping (Return5IntentResponse) -> Void) {
        completion(.success(result: "5"))
    }
}

Solution

  • Classic case of searching for hours, writing a question only to find the answer 30min later yourself...

    One has to explicitly set the output, which is the passed on value for following actions.

    enter image description here