Call WeatherService within SiriKit Intent Definition File

Hi all,

WeatherKit is working fine within my contentView.

I am trying to use the WeatherKit within SiriKit Intent Definition files. I am trying to call

let weather = try! await weatherService.weather(for: location)

How can I handle my SiriKit intent with the async/await function?

Latitude and longitude (location) will be provided as input values from Shortcuts App.

Thanks

Got it to work with task, thank you.

Structure Task A unit of asynchronous work. https://developer.apple.com/documentation/swift/task

Thanks.

Call WeatherService within SiriKit Intent Definition File
 
 
Q