WeatherKit

RSS for tag

Bring 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

67 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

WeatherKit suddenly returning JWT errors - no changes
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?
5
0
42
43m
WeatherKit API inaccessible for some users
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.
2
0
46
1d
WidgetKit WidgetConfigurationIntent Parameter Icons
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" ] }
1
0
28
2d
UV Index hourly forecast instability
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.
1
0
84
2w
WeatherKit JWT fails (WDSJWTAuthenticatorServiceListener Code 2) despite entitlement
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!
0
0
56
3w
WeatherKit DayWeather::date Timezone Issue
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?
0
1
57
Apr ’25
Weatherkit API Historical 404 Errors Starting 3/5/25
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.
0
0
41
Apr ’25
Weatherkit - visibility units and height
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
0
0
28
Apr ’25
WeatherKit - hourly temperature details
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?
2
0
218
Mar ’25
WeatherKit - visibility units and height
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
1
0
177
Mar ’25
WeatherKit - missing ForecastHourly field documentation
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
0
0
212
Mar ’25
WeatherKit historical
is using /api/v1/weather/{language}/{latitude}/{longitude} the correct way to retrieve historical weather data for a location? e.g. getting hourly weather data for Seattle from 2016-03-04 to 2016-03-11? https://developer.apple.com/documentation/weatherkitrestapi/get-api-v1-weather-_language_-_latitude_-_longitude_ this is pointed out in the API docs as being the method to pull hourly weather data for a specific location. It doesn't indicate wether it is for current weather or historical
1
0
217
Mar ’25
Weather Authentication Failed
I'm pretty new on this platform and also developing IOS mobile apps. I've been struggling for using the data of the api weather kit apple. I have an acount of apple developer, downloaded the certificate... i follow all the necessaries steps in the portal and also in my project and i keep having this error message when i try to use it. I don't know what else should i do for having working it. I would absolutely appreciate that someone could help me with this. Thank you very much!!!!! Encountered an error when fetching weather data subset; location=<+41.38268070,+2.17702390> +/- 0.00m (speed -1.00 mps / course -1.00) @ 2/3/25, 22:54:03 Central European Standard Time, error=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors 2 Error Domain=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=2 "(null)"
0
0
186
Mar ’25
WeatherKit AuthService Error
I have an app that I configured correctly. Checked the WeatherKit for the App ID, and added the WeatherKit to the Entitlements, and verified the Bundle ID was correct. I am getting the following error: 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=<+38.97170000,-95.23530000> +/- 0.00m (speed -1.00 mps / course -1.00) @ 3/1/25, 8:34:24 AM Central Standard Time, error=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors 2 Error Domain=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=2 "(null)" I then made a super simple app that has a hard coded CLLocation and makes the single API call to get the weather and that fails with the same error. This error is still happening after 12 - 48 hours after creating the AppID. I have dumped the contents of the Provisioning Profile for both apps and the Entitlement section looks correct for both. I am not sure what is configured incorrectly, or what steps I should take next.
3
0
258
Mar ’25
adding forecastNextHour to dataset significantly changes currentWeather
I have been struggling with getting accurate data from the weatherkit api. It tends to be just different enough from the weather app on the phone. While debugging this I randomly added forecastNextHour to my dataset string and it suddenly made everything match the app and the data looked good. For example there is at this moment a snow storm in Billings. This url: https://weatherkit.apple.com/api/v1/weather/en-US/45.79/-108.50?dataSets=currentWeather,forecastHourly,forecastNextHour&timezone=America/Denver&country=US says that there is heavy snow, and there is a 100% chance for the next few hours. This matches the iOS app. This url without forecastNextHour: https://weatherkit.apple.com/api/v1/weather/en-US/45.79/-108.50?dataSets=currentWeather,forecastHourly&timezone=America/Denver&country=US Says it is hazy and there is a small chance of snow of snow for the next few hours. Like 20-30 percent. This does not match any weather data I can find. I have even checked the forecastStart times and the current weather asOf time. They all match up and are accurate. Is there some unknown reason that without forecastNextHour the API becomes inaccurate? Thanks!
2
0
263
Feb ’25