Whenever I try accessing the WeatherKit, I always receive this message
2022-11-03 21:02:37.690374-0500 Weather[151:578] [AuthService] Failed to get remote object proxy for: com.apple.weatherkit.authservice with error: Error Domain=NSCocoaErrorDomain Code=407 "connection to service named com.apple.weatherkit.authservice" UserInfo={NSDebugDescription=connection to service named com.apple.weatherkit.authservice} 2022-11-03 21:02:37.6914-000 Weather[151:580] [WeatherService] Encountered an error when fetching weather data subset; location=< 37.785800,-122.441700> /- 5.00m (speed -1.00 mps / course -1.00) @ 11/3/22, 9:02:25 PM Central Daylight Time, error=xpcConnectionFailed(Error Domain=NSCocoaErrorDomain Code=4097 "connection to service named com.apple.weatherkit.authservice" UserInfo={NSDebugDescription=connection to service named com.apple.weatherkit.authservice}) erorr 2022-11-03 21:02:37.691307-0500 Weather[15211:580478] [WeatherService] Encountered an error when fetching weather data subset; location=< 37.7800,-122.401700> /- 5.00m (speed -1.00 mps / course -1.00) @ 11/3/22, 9:02:25 PM Central Daylight Time, error=xpcConnectionFailed(Error Domain=NSCocoaErrorDomain Code=4097 "connection to service named com.apple.weatherkit.authservice" UserInfo={NSDebugDescription=connection to service named com.apple.weatherkit.authservice}) erorr 2022-11-03 21:02:38.15636-0500 Weather[1511:5478] [AuthService] Failed to get remote object proxy for: com.apple.weatherkit.authservice with error: Error Domain=NSCocoaErrorDomain Code=409 "connection to service named com.apple.weatherkit.authservice" UserInfo={NSDebugDescription=connection to service named com.apple.weatherkit.authservice} 2022-11-03 21:02:38.1562-0500 Weather[15211:588] [WeatherService] Encountered an error when fetching weather data subset; location=< 37.783400,-122.4000> /- 5.00m (speed -1.00 mps / course -1.00) @ 11/3/22, 9:02:38 PM Central Daylight Time, error=xpcConnectionFailed(Error Domain=NSCocoaErrorDomain Code=4097 "connection to service named com.apple.weatherkit.authservice" UserInfo={NSDebugDescription=connection to service named com.apple.weatherkit.authservice})
Code:
Task {
do {
let result = try await service.weather(for: location)
print(result)
}
catch {
print("error")
}
}
Is this something relates to Auth? I have also enabled WeatherKit in my app bundle, but still receive this response.
CodePudding user response:
Make sure to add WeatherKit as a capability in Signing & Capabilities for your target.