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.

WeatherKit Documentation

Posts under WeatherKit tag

37 Posts
Sort by:
Post not yet marked as solved
1 Replies
124 Views
Hi, I'm in the process of developing a weather app using WeatherKit. Everything seems to be working fine in the Simulator, but when I put it on the device (iPhone 13 Pro Max) the temperature displays wrong. Example: On Simulator: 34 F On Device: 34.98 F Anyone else have this problem? Dan Uff
Posted
by
Post not yet marked as solved
1 Replies
99 Views
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
Posted
by
Post not yet marked as solved
0 Replies
136 Views
My guess the issue is that the iOS app is com.example.MyApp and the bundle id for the watchOS app is com.example.MyApp.watchkitapp, so WeatherKit works perfectly on the iOS app after registering bundleID and request WeatherKit service. But it does not work on watchOS, giving me 401 errors. I assume it is because of the bundleID, but maybe something else. 2022-06-25 08:58:58.999485-0500 JumpLog Watch App[72341:1201484] [WK_Geocode] failed to reverse geocode. location=CLLocationCoordinate2D(latitude: 37.62471885, longitude: -122.42857813), error=reverseGeocodeFailed(Error Domain=NMDeviceConnectionErrorDomain Code=2 "Timed out." UserInfo={NSDescription=Timed out.}) 2022-06-25 08:58:59.019561-0500 JumpLog Watch App[72341:1201484] [Database] Attempting to invalidate an assertion that is no longer valid 2022-06-25 08:58:59.724802-0500 JumpLog Watch App[72341:1198856] [WeatherService] Encountered an error when fetching weather data subset; location=<+37.62471885,-122.42857813> +/- 5.00m (speed 34.21 mps / course 332.23) @ 6/25/22, 8:56:58 AM Central Daylight Time, error=invalidJWTResponse(Optional(<NSHTTPURLResponse: 0x60000394bf20> { URL: https://weather-data.apple.com/v2/token } { Status Code: 401, Headers { Connection = ( close ); "Content-Length" = ( 0 ); Date = ( "Sat, 25 Jun 2022 13:58:59 GMT" ); Server = ( Apple ); "Strict-Transport-Security" = ( "max-age=31536000; includeSubdomains" ); "X-Apple-Origin" = ( "8961098f-b238-3714-ba44-5b569c861456" ); "X-Cache" = ( "TCP_MISS from a23-33-47-144.deploy.akamaitechnologies.com (AkamaiGHost/10.8.2-41841244) (-)" ); "X-Content-Type-Options" = ( nosniff ); "X-Frame-Options" = ( SAMEORIGIN ); "X-REQUEST-ID" = ( "2076edab-2346-4a50-83c1-e62f46aab9eb" ); "X-XSS-Protection" = ( "1; mode=block" ); } }))
Posted
by
Post not yet marked as solved
2 Replies
163 Views
I'm so glad apple has created a web api for WeatherKit as I thought my personal Dark Sky app was done once they were acquired. I've been able to recreate all dark sky calls using weatherKit. However, radar has always been hard to acquire. Now there is WeatherKit and MapKit, are there plans for radar in weatherKit, mapKit?
Posted
by
Post marked as solved
1 Replies
157 Views
According to the WeatherKit Documentation It says To provide weather information to a web app or other platform, like Android, use the WeatherKit REST API. For native iOS, macOS, tvOS, and watchOS apps, use WeatherKit. is it possible to use The WeatherKit REST API on a iOS native app below iOS 16? I don’t see us being able to drop iOS 15 support for at least a year or so.
Posted
by
Post not yet marked as solved
3 Replies
142 Views
It seems like the direction of the wind is reported in the direction it's heading vs the direction it's coming from. Most of the time in other weather products, wind is reported in the direction it's coming from. eg. A west wind is coming from the west (heading east) and would have a bearing of 90.0 ° (coming from the west) Am I correct in thinking that the below reported wind is actually a "West wind"? WeatherKit.Wind(compassDirection: East, direction: 90.0 °, speed: 7.09 km/h, gust: Optional(18.18 km/h))
Posted
by
Post not yet marked as solved
0 Replies
109 Views
I've been getting at the precipitationAmount data using this hack from another thread. I've often found that the precip amount is 0mm for every hour of the day. Every entry for today has the same precipAmount of 0mm: HourWeather(date: 2022-06-27 22:00:00 +0000, cloudCover: 0.15, condition: Mostly Clear, symbolName: "sun.max", dewPoint: 12.43 °C, humidity: 0.78, isDaylight: true, precipitation: , precipitationChance: 0.0, precipitationAmount: 0.0 mm However the iOS 16 beta 2 weather app is showing precip data for today at the same location. Is the iOS 16 Weather App using the same WeatherKit as I am? I'm finding the data in weatherkit to be pretty different than the data in the weather app.
Posted
by
Post not yet marked as solved
3 Replies
126 Views
I'm playing with Swift Charts and WeatherKit. I have a simple chart where I plot temperate values for the current day. When I log out the date values, they look right, but when I actually look at the data, it looks like it's missing a timezone offset. I'm looking at a location that is UTC-7. The data is showing the lowest temperature of the day occurring at 1:30pm and the peak temp occurring at midnight. I feel that I need to shift all the values coming from weatherkit by my timezone offset.
Posted
by
Post not yet marked as solved
0 Replies
63 Views
Has anyone been able to receive "weatherAlerts" back when calling the REST API? I can successfully pull currentWeather, forecastDaily, forecastHourly, and forecastNextHour, but I can't get it to return anything for a weatherAlert. This is true even when I'm using a location that I know has a current weather alert from the National Weather Service. For what it's worth, it is listed as a possible dataset when I check using "availability." Thanks!
Posted
by
Post not yet marked as solved
2 Replies
102 Views
Hi, i've been playing with WeatherKit for the first 3 betas but each time I try to get the UV Index of a forecast I've got 0 as value. For example the hourly forecast of San Francisco at the time of writing is the following : Optional(WeatherKit.HourWeather(date: 2022-07-06 14:00:00 +0000, cloudCover: 0.98, condition: Drizzle, symbolName: "cloud.moon.rain", dewPoint: 21.87 °C, humidity: 0.95, isDaylight: false, precipitation: rain, precipitationChance: 0.44, precipitationAmount: 0.44 mm, snowfallAmount: 0.0 mm, pressure: 1000.93 mbar, pressureTrend: Steady, temperature: 22.67 °C, apparentTemperature: 24.89 °C, uvIndex: WeatherKit.UVIndex(value: 0, category: Low), visibility: 8977.97 m, wind: WeatherKit.Wind(compassDirection: South Southeast, direction: 151.0 °, speed: 32.34 km/h, gust: Optional(48.66 km/h)))) While the UV Index at the time from The Weather Network is supposed to be 4. I've got this issue since beta 1 and it's happening on every location I try. Is this happening as well to other people ? Is there anything on my side in term of configuration that I should do ?
Posted
by
Post not yet marked as solved
3 Replies
464 Views
In the simulator with Xcode 14 beta 3, any request to WeatherKit results in the following error: [WeatherService] Encountered an error when fetching weather data subset; location=<+41.16107900,-104.80545000> +/- 5.00m (speed -1.00 mps / course -1.00) @ 7/6/22, 3:16:51 PM Mountain Daylight Time,  error=Error Domain=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=0 "(null)" I haven't had a single request succeed. Has anyone else encounter this?
Posted
by
Post not yet marked as solved
0 Replies
79 Views
Hi All, I started a simple wrapper for WeatherKit's REST API in Python. You can find it here: https://github.com/davecom/PyWeatherKit Right now it's extremely rudimentary. It can just produce a correct authentication token and retrieve a dictionary of weather data for some latitude/longitude. That's really all I need. But I thought I would put it out there incase others are interested and we can then maybe make the results more Pythonic. Cheers.
Posted
by
Post not yet marked as solved
0 Replies
93 Views
Hi, I try to fetch weather information for multiple dates through a single query but I only get information for the first day. let today = Date() let tomorrow = Calendar.current.date(byAdding: DateComponents(day: 1), to: today)! let forecast = try? await WeatherService.shared.weather(for: location, including: .daily(startDate: today, endDate: tomorrow)) Can we get weather information for a range of day?
Posted
by
Post not yet marked as solved
0 Replies
45 Views
I'm trying to get historical data using the following syntax: try await service.weather(for: location, including: .daily(startDate: past1, endDate: past2)) Where past1 and past2 are two dates in the past (I checked their format and they are correct). I always get the same result, namely the 10 days default forecast you usually get calling service.weather(for: location) Am I missing something?
Posted
by