Hi all,
I have WeatherKit working on iOS and watchOS, but am having problems getting it to work on macOS. I have all entitlements enabled and everything seems to checkout, but I get the following error:
"WARNING: error = 3→(76) INVALID_PERSONA; It is undefined behavior to look up a container with a persona other than personal or data separated. Please adopt a persona first. Assuming personal. given persona = (<MCMUserIdentity: 0xb3d0288c0; posixUser = (501|20|danuff|/Users/danuff), identifier = 501, personaType = unspecific, personaUniqueString = E90578C5-AAE4-44DD-9E41-CC3F97B34F0C, kernelPersonaID = 1001>)
Message from debugger: killed
Any ideas?
WeatherKit
RSS for tagBring weather information to your apps and services through a wide range of data that can help people stay up to date, safe, and prepared.
Posts under WeatherKit tag
63 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
Hi, my server in Melbourne Australia is getting weather forecasts from a few places around Australia. When I look at the daily timesteps that I get back, they might be something like this:
"days": [
{
"forecastStart": "2025-06-25T00:00:00Z",
"forecastEnd": "2025-06-26T00:00:00Z",
"daytimeForecast": {
"forecastStart": "2025-06-25T07:00:00Z",
"forecastEnd": "2025-06-25T19:00:00Z",
"overnightForecast": {
"forecastStart": "2025-06-25T19:00:00Z",
"forecastEnd": "2025-06-26T07:00:00Z",}
It doesn't matter where I ask for - Melbourne, Darwin, Perth, it always comes back the same.
The documentation says that daytimeForecast is 7 am to 7 pm local and overnightForecast is 7pm to 7 am local.
However, in a place like Perth 7-19Z is 3 pm to 3 am, not 7 pm to 7 am like advertised.
I can see that for any given date, there are 3 maximum temperature forecasts, a 24 hour max, a daytime max and an overnight max and they differ from each other.
Can anyone help me understand what's happening here?
And furthermore in the example above, the 24 hour forecasts that have, for example this:
"forecastStart": "2025-06-25T00:00:00Z" ... Can the 00:00:00Z be trusted literally? Or is it more the case that it's "2025-06-25" but the HMS got tacked on in a conversion?
One of my apps includes a free weather forecast using WeatherKit. Recently, it started to get more downloads and almost reached the limits of the free tier.
I've removed the forecast in newer versions but there's still a substantial amount of users who do not update their apps.
Is it possible to somehow remove the capability from existing apps?
Thank you!
My app AirCompare has been in the app store and successfully using WeatherKit to fetch weather since it became available. Now some (not all) users are encountering the following errors:
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=<+42.40865786,-88.96911526> +/- 0.00m (speed -1.00 mps / course -1.00) @ 6/23/25, 2:56:47 PM Central Daylight Time, error=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors 2 Error Domain=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=2 "(null)"
Others are reporting this same problem here in the forums. We need a solution!
I have an app using weatherkit and its currently live and up on the app store, recently I had some users report to me that they had been receiving errors loading weather data, I had error handling built in and it reported an issue with apples authentication server
Failed to generate jwt token for: com.apple.weatherkit.authservice with error: Error Domain=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=2 "(null)"
I have not come across this during the development lifecycle of my project, there where no codebase changes, it just stopped functioning.
The app entitlements are valid and correct, Weatherkit is enabled in both xcode and across my Certs, identifiers and profiles.
I was not experiencing this issue until I reinstalled the app from the app store completly by first removing it and then re-installing fresh.
Hard reboots do not help and I do not want to start suggesting to my users to factory reset their devices.
We are using WeatherKit in both our main app and widget, relying entirely on Apple’s framework for authentication and token management.
We do not generate or inject our own JWT tokens; all token handling is managed by WeatherKit.
We have implemented a debug menu with the following actions:
Clear WeatherKit JWT tokens from the keychain
Clear all related UserDefaults key
Clear all app group data and all UserDefaults.
Perform a “nuclear” cache clear (removes all app data, keychain, and cached files).
We log all WeatherKit fetch attempts and failures, including authentication errors, both in the app and widget and get nothing but code 2.
We have attempted all of the above steps, but continue to experience issues with WeatherKit JWT authentication
We would appreciate any guidance or insight into what else could be causing persistent WeatherKit JWT/authentication issues, or if there are any additional steps we should try.
P.S. - Tested and experiencing the same issues on an iPhone 15 Pro Max and iPhone 15
The Pro Max is on the iOS 26 Beta // and the 15 is on the latest iOS 18
We have a subscription WeatherKit app which has been on the App Store since December 2023.
I am getting intermittent JWT auth failures on customer devices. In the great majority of cases, the request succeeds, but sometimes it fails, and sometimes it fails and never recovers. I’m working with a customer right now who is unable to get any weather data at all, and the logs he sends me show
WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors error 2
The app uses the WeatherKit SDK (we are not using the REST API directly). We know we have the project setup as it has been working since launch, and I can verify weatherkit using
security cms -D -i embedded.mobileprovision
It it not a problem with the specific query, since I can get data for the dates and locations they are requesting. I can’t replicate the problem on my test devices.
In case there is a rate limit issue: this app is a bit unusual and downloads an unusual amount of data at once using multiple queries in parallel using a TaskGroup. When the user creates a location, the app downloads a 10 day block of weather (7 days in the past + 3 day forecast) using
WeatherService.shared.weather(
for: location,
including: WeatherQuery.daily(
startDate: startDate,
endDate: endDate
),
WeatherQuery.hourly(
startDate: startDate,
endDate: endDate
)
)
It also downloads about 2 months of daily precipitation data using multiple parallel calls to dailySummary in 10 day blocks:
WeatherService.shared.dailySummary(
for: location,
forDaysIn: DateInterval(start: startDate, end: endDate),
including: .precipitation
)
In almost every case, including on my test devices, this works. But some users get WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors error 2 on every request.
The two users yesterday that had this problem were both on iOS 18.5 for what that's worth, though the app supports 17.2+
Is anyone else seeing this? And can anyone suggest anything else to explore? It's obviously a terrible experience for customers who pay for the service and are unable to get any data.
I did submit this info to Apple as FB18276275
Is there a list of countries that are currently supported by WeatherKit's WeatherAlerts?
Hi,
My app is going to consist of 2-3 pages of weather data. Do I have to add the Apple Weather logo to each page, or just the main one?
Thanks,
Dan Uff
All of my apps stopped working with WeatherKit this morning. They all return an "Error Domain=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=2" error.
I am certain that the WeatherKit capability added (in project) and enabled as a Capability & App Service (on developer portal for the identifier). All other iCloud features of my apps are working as expected. I have also done all the normal troubleshooting using codesign / security cms, etc. to verify entitlements.
I created the following simple project to verify the integration.
import WeatherKit
import CoreLocation
struct ContentView: View {
@State private var temp: Measurement<UnitTemperature>? = nil
var body: some View {
VStack {
if let t = temp {
Text("\(t.value.rounded())°\(t.unit.symbol)")
} else {
Text("Fetching…")
.task {
let service = WeatherService()
do {
let location = CLLocation(latitude: 50.318668, longitude: -114.917710)
let weather = try await service.weather(for: location, including: .current)
temp = weather.temperature
} catch {
print("Error:", error)
}
}
}
}
}
}
Any ideas what may be happening?
Hi All, I’m puzzled by this issue: my app uses WeatherKit to fetch hourly UV-index and temperature forecasts. The same build, running on the latest iOS, succeeds on most devices but consistently fails on a few. Strangely, the paired Apple Watch version retrieves the data without problems. Could WeatherKit be applying per-user throttling? Any insight would be greatly appreciated.
In WatchOS 26 you can now configure Apple Watch Widgets that use AppIntents instead of having a preconfigured option via AppIntentRecommendation.
This is demonstrated in the Weather Details Widget. In that, the Intent has been set up such that the options have icons for each parameter.
How can I update my Intent code to offer this?
struct DataPointsWidgetIntent: AppIntent, WidgetConfigurationIntent {
static var title: LocalizedStringResource = "Data Points Widget Configuration"
static var description = IntentDescription("Configure the individual data point display for Widgets.")
static var isDiscoverable: Bool { return false}
init() {}
func perform() async throws -> some IntentResult {
print("DataPointsWidgetIntent perform")
return .result()
}
@Parameter(title: "Show Individual Data Points", default: true)
var showDataPoints: Bool?
@Parameter(title: "Trend Timescale", default: .week)
var timescale: TimescaleTypeAppEnum?
static var parameterSummary: some ParameterSummary {
Summary("Test Info") {
\.$showDataPoints
\.$timescale
}
}
}
enum TimescaleTypeAppEnum: String, AppEnum {
case week
case fortnight
static var typeDisplayRepresentation = TypeDisplayRepresentation(name: "Trend Timescale")
static var caseDisplayRepresentations: [Self: DisplayRepresentation] = [
.week: "Past Week",
.fortnight: "Past Fortnight"
]
}
Topic:
App & System Services
SubTopic:
Widgets & Live Activities
Tags:
WidgetKit
Intents
WeatherKit
App Intents
I pull an hourly UV index forecast in my app via WeatherKit, but I’ve noticed it flips back and forth between two "stable" forecasts throughout the day, as if the data source is switching between providers, as a result giving a sense of instability in the presented forecast. Is there any way to lock or specify a single forecast source for greater consistency? I have a feature that notifies users when the UV index crosses a set threshold, but these repeated “back-and-forth” changes trigger multiple alerts that feel spammy and unreliable. Any advice or best practices for handling this would be greatly appreciated.
I’m hitting a WeatherKit JWT failure (WDSJWTAuthenticatorServiceListener Code = 2) at runtime even though the entitlement is present in both the signed binary and the embedded provisioning profile.
Environment
Team ID
5SZLQLQ9MD
Bundle ID
ParkProfessor.ParkProfessorDisneyland
Device / OS
iPhone 15 Pro · iOS 17.4.1 (hardware, not simulator)
Xcode
15.3 (15E204a)
Console output
Failed to generate jwt token for: com.apple.weatherkit.authservice
Error Domain=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=2 "(null)"
Entitlement & profile snippets
codesign -d --entitlements :- WeatherKitTest.app | grep -A2 weatherkit
com.apple.developer.weatherkit
security cms -D -i embedded.mobileprovision | grep -A2 weatherkit
com.apple.developer.weatherkit
What I’ve already tried
Regenerated a new development certificate and a new iOS App Development provisioning profile with WeatherKit enabled.
Confirmed the capability is selected in Certificates ▸ Identifiers ▸ Profiles and added in Xcode target settings.
WeatherKit Terms of Service accepted in the portal.
Deleted the app, removed any device management profiles, rebooted the phone, clean-built & ran again.
Reproduced the issue in a minimal SwiftUI app that calls: WeatherService.shared.weather(for: CLLocation(latitude: 33.8121, longitude: -117.9190), including: .current) – same Code 2 error.
Request
It looks like the App ID may need a backend entitlement sync. Could someone from the WeatherKit team please check the status for Team 5SZLQLQ9MD, Bundle ID ParkProfessor.ParkProfessorDisneyland and enable WeatherKit token generation?
Thanks!
I use WeatherKit with Swift to get multiple cities weather by longitude and latitude.
But I use this API in WeatherService for daily forecast:
final public func weather<T>(for location: CLLocation, including dataSet: WeatherQuery<T>) async throws -> T
And I found there is something wired: The date of WeatherKit::DayWeather is based on my device's timezone settings.
Tokyo's Day Weather is start at UTC+8, New York' Day Weather is start UTC+8.
Is there any way to set timezone correctly?
We've been using the WeatherKit API for a few years now. Everything has been pretty stable. We'll periodically get 404 errors, but they usually disappear within a couple days.
Starting March 5th we've again been getting 404 errors that slowly ramped up to March 20th and continued. We have had no code changes on our end, so something seems to have changed / broken on the server side of things.
Here are some example API calls that are giving us a 404 error now
https://weatherkit.apple.com/api/v1/weather/en/35.9981205/-78.8920444?dataSets=forecastDaily&dailyStart=2025-03-21T05:00:00Z&timezone=America/New_York&countryCode=US
https://weatherkit.apple.com/api/v1/weather/en/41.4789363/-81.7404134?dataSets=forecastDaily&dailyStart=2025-03-21T04:56:00Z&timezone=America/New_York&countryCode=US
Does anyone have any insights or information on this?
Also if Apple is listening, an error more meaningful than 404 would be much much appreciated.
where can i find the account quota usage for WeatherAPI?
reposting this in case it got missed the first time around here
https://developer.apple.com/forums/thread/775900
We had a question that came up when we comparing data from WeatherKit to other sources - WeatherKit visibility was well beyond the boundaries we had historically, even from Darksky. That raises two questions:
is visibility actually in meters like the docs say?
is this visibility at ground level, 500ft, or some other height?
We were seeing visibility numbers of up to 40 miles (after converting the number the API sent to miles), where all of our other sources are usually within 10 miles
we’re looking to get some clarification around how the hourly forecasts should be interpreted to ensure we’re using your data in the correct manner. If you could provide the answers to the following questions would be extremely helpful:
1. What do the data points (e.g temperature) in the hourly forecast represent for a future hour? Do they represent the expected average over that future hour or do they represent the forecast for the point in time at the top of the hour?
2. What do those same data points represent in the hourly forecast for an hour which has already begun? e.g. it’s 8:30 and we pull the hourly forecast and the 8:00 hour is still returned. Which of the following would be the correct interpretation for the values returned for the 8:00 hour:
The values represent the forecast for the point in time at the top of the 8:00 hour (if this is the case we would expect it to stop updating)
The values represent the current forecast i.e. what the weather is right now
The values represent the average over the remaining portion of the 8:00 hour
The values represent the average over the full 8:00 hour including both the portion which has already elapsed and the portion which is still to come
3. What does the data represent after the hour (i.e. looking at historical hours)? Is it:
The last forecast made within the hour? If so, is that point-in-time or average for the hour (as explained above)?
The actual weather for that hour (using some non-forecast measure of real weather)? If so, again is that point-in-time at top of hour / point-in-time at end of hour / average over the hour?
We had a question that came up when we comparing data from WeatherKit to other sources - WeatherKit visibility was well beyond the boundaries we had historically, even from Darksky. That raises two questions:
is visibility actually in meters like the docs say?
is this visibility at ground level, 500ft, or some other height?
We were seeing visibility numbers of up to 40 miles (after converting the number the API sent to miles), where all of our other sources are usually within 10 miles
where can we find documentation on the following fields included in payloads? They're not listed alongside the other fields in the documentation linked below:
https://developer.apple.com/documentation/weatherkitrestapi/hourweatherconditions
precipitationIntensity
snowfallAmount
Or if we can get the data type, unit used, and description here that would be great