If I may piggyback on this thread because of its relevance, is there any chance that one field (that exists in DarkSky) be added to WeatherKit's WeatherAlerts?
DarkSky's alerts include a string containing a detailed description of each specific alert. Weatherkit, on the other hand, includes only a URL for further details -- and there doesn't seem to be a programmatic way of scraping the contents of that URL for the text. A full detail text would be far more useful.
Post
Replies
Boosts
Views
Activity
I'd like to add my voice to the chorus. A short text description would be very helpful; as it is, the best we can do is add spaces to create the 1-2 word phrase in the icon name.
In light of the "Invalid signature" result from jwt.io as mentioned above, here is how I'm generating the private key (the .p8 file is in an /assets directory, with its headers stripped)
AssetManager assetManager = this.getAssets();
InputStream stream = assetManager.open("PRIVATE_KEY_FILE.p8");
byte[] bytes = new byte[stream.available()];
int bytesRead = stream.read(bytes); // equals 200
byte[] pkcs8EncodedKey = new byte[0];
pkcs8EncodedKey = Base64.getDecoder().decode(bytes);
KeyFactory factory = KeyFactory.getInstance("EC");
PrivateKey privateKey = factory.generatePrivate(new PKCS8EncodedKeySpec(pkcs8EncodedKey));
Per a suggestion, I decoded the resulting token using https://jwt.io/ and received the following:
HEADER:
{ "alg": "ES256", "kid": "CXXXXXXXXX", "id": "QXXXXXXXXX.com.mycompany.myproject" }
PAYLOAD:
{ "sub": "com.mycompany.myproject", "jti": "QXXXXXXXXX.com.mycompany.myproject", "iat": 1658508182203, "exp": 1658508212203, "iss": "QXXXXXXXXX" }
VERIFY SIGNATURE:
Invalid signature
(Note, in both this and the original post, I've obfuscated the Apple-issued Team ID and Service ID)