-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can't show PM10 data on Apple Watch #3
Comments
Hi! Sorry, I missed the notification email then :( If you're still interested in this, it looks like the problem was very simple - in one of the data series, for a different parameter (CO I think?) the returned values were listed as numbers, not as strings. And the parsing code in This seems to fix it: if let timestamp = try? Int(container.decode(String.self)) {
self.date = Date(timeIntervalSince1970: TimeInterval(timestamp))
} else {
throw InvalidValueError()
}
if let value = try? Double(container.decode(String.self)) {
self.value = value
} else if let value = try? container.decode(Double.self) {
self.value = value
} else {
throw InvalidValueError()
} |
without this changes, it works on Apple Watch simulator, but even compile with your changes, it still not worked on real apple watch. |
In what way it didn't work? |
I try with same parameters on Postman, which works. and then I hardcode those params for Apple watch extensions as show above, but failed to fetch data on apple watch.
The text was updated successfully, but these errors were encountered: