Hi I upgraded my Mac to test the new os and iOS 17. But I have problems with the weather kit on the app.
WeatherKit enabled as app service and capability there was no issue with the iOS 16.
What could be the problem?
import Foundation
import WeatherKit
class WeatherKitManager: ObservableObject {
@Published var weather: Weather?
@Published var isFetchingWeather = false
func getWeather(latitude: Double, longitude: Double) async {
do {
let receivedWeather = try await WeatherService.shared.weather(for: .init(latitude: latitude, longitude: longitude))
DispatchQueue.main.async {
self.weather = receivedWeather
}
} catch {
fatalError("\(error)")
}
}
var symbol: String {
weather?.currentWeather.symbolName ?? "xmark.app"
}
var temp: String {
if let temp = weather?.currentWeather.temperature.converted(to: .celsius) {
let formattedTemp = String(format: "%.1f", temp.value)
return "\(formattedTemp)°C"
} else {
return "Yükleniyor..."
}
}
}
Errors here
Ceyehat/WeatherKitManager.swift:22: Fatal error: Error Domain=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=2 "(null)"
Failed to generate jwt token for: com.apple.weatherkit.authservice with error: Error Domain=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=2 "(null)"
Encountered an error when fetching weather data subset; location=<+37.78583400,-122.40641700> +/- 0.00m (speed -1.00 mps / course -1.00) @ 06/06/2023, 5:32:55 PM GMT+03:00, error=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors 2 Error Domain=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=2 "(null)"