WeatherKit - iPad Swift Playgrounds Script

Insights & assistance would be greatly appreciated.

Have a paid/current developers account which shows WeatherKit as being available/having 500,000 calls available, but I have not sorted out settings for ‘certificates, identifiers, and profiles’.

Am attempting to use an iPad Pro with iOS 16 to run the following script using Swift Playgrounds Xcode Playground

import WeatherKit
import CoreLocation

let weatherService = WeatherService()
let Anchorage = CLLocation(latitude: 61, longitude: -149)
let weather = try! await weatherService.weather(for: Anchorage)
let temperature = weather.currentWeather.temperature
print(temperature) 

The error that I am seeing is:

There was a problem running this playground. Please check your code and try again.

There is no ‘red dot’ and technical guidance associated with resolving this error as one normally sees/experiences when working on scripts. Have exited/restarted Swift Playgrounds multiple times and still see this error.

This error is unexpected, as I am usually able to create and run swift scripts on my iPad.

I believe that WeatherKit requires an entitlement that is not available to request on the iPad using Swift Playgrounds.

You’ll likely need to use Xcode on a Mac to be able to use WeatherKit using the native SwiftUI calls.

WeatherKit - iPad Swift Playgrounds Script
 
 
Q