WeatherKit request fail

Hello,

I have an app on the App Store built around WeatherKit and it was working fine, up until this morning when I started seeing errors when using the app.

When debugging using Xcode I see the familiar error

Failed to generate jwt token for: com.apple.weatherkit.authservice with error: Error Domain=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=2 "(null)"

which, according to what I've read on the forums looks like an authentication error.

Attaching a network debugger to the Simulator, I saw this error:

This I have tried:

  • Verify that WeatherKit is enabled on both Capabilities and App Services tabs on the Dev Portal.
  • Toggle on/off this value and regenerate Provisioning Profiles
  • Uninstall/reinstall
  • Checking that I have API available calls.

Nothing. If I create a new Bundle ID and sign with that, it works correctly. But this is not an option since that will force all my customers to download everything from scratch.

I am getting emails from customers demanding money back and I can't figure out what has happened.

The only thing I can think of, is that I started developing an Apple Watch app to complement the iOS app, but that was last week and everything was working fine.

Hello,

Same problem for me, i added WeatherKit capabilities for iOS and watch targets, both in xcode and developer account also enabled the App Services.

On the watch it is working but on the phone does not, getting the same error

`Failed to generate jwt token for: com.apple.weatherkit.authservice with error: Error Domain=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=2 "(null)"

What's interesting is that the Widgets work...

And i'm certain that the error started from Sunday to Monday, when I wasn't working...

Just an update

Something is wrong with the bundle id (identifier) of the ios app.

I have tried using directly the weather api: https://weatherkit.apple.com/api/v1/weather/

I have generated a key for weather api from Certificates, Identifiers & Profiles and using that to create a JWT token

Now i have run into the problem again, for the JWT generation the identifier is needed, and if i use my app identifier it fails with this message: {"reason": "NOT_ENABLED"}, this i think means that something is not enabled for this identifier, even tho i have no idea what, as weatherkit capabilities and services are enabled

In the end i have used the identifier of my watch app and with that one it works..

Have no idea why this is happening, but maybe this workaround will also work for you

Written by Mausa in 822165022
In the end i have used the identifier of my watch app and with that one it works.. Have no idea why this is happening, but maybe this workaround will also work for you 0  comments

Can't use this as a workaround because that means I'll have to use the REST API to make all the requests to WeatherKit, a significant lift if your coming from using the Swift API on an iOS App.

I am losing my head (and quite possibly, my job) over this situation.

I can finally prove that the requests started failing without my input:

Here you can see 3 push notifications: One received on Sunday, one received Monday and another on Tuesday. The forecast for Sunday was generated correctly, but the one for Monday and Tuesday failed with the generic error message "Tap to access it".

(For a little bit of more background, these are local pushes generated locally on the device using UIApplication Background Fetch)

Suffice to say that I didn't touch the Developer Portal or deployed a new version to the AppStore this Sunday.

And just like that, this morning it quietly started working again.

Still haven't heard back from Apple about what happened, but filing a DTS ticket + talking to a Dev Evangelist seemed to did the trick.

Still... 5 days of downtime...

WeatherKit request fail
 
 
Q