Is there a list of countries that are currently supported by WeatherKit's WeatherAlerts?
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I have an application that uses WeatherKit for which I use the registered identifier com.[mycompanyname].[myappname] .
I'm now developing a second application using WeatherKit, so I need to create a new identifier on https://developer.apple.com/account/resources/identifiers/add/appId/bundle so that WeatherKit will recognize requests from com.[mycompanyname].[myappname2].
(in this post, I'm using "[xxx]" instead of the real strings)
When I go to create an identifier for the new app, I get the error message:
An attribute in the provided entity has invalid value
An App ID with Identifier 'com.[mycompanyname].[myappname2]' is not available. Please enter a different string.
Can anybody explain why I can't register the new app name, and how I can fix this?
Topic:
Developer Tools & Services
SubTopic:
Apple Developer Program
I've been working on this for weeks to no avail; the best I've gotten so far is a 403 error, and I haven't been able to track down a fully-fleshed example in either Java or Kotlin.
First, after generating privateKey, here's my code to create a JWTS token. It seems to create one, but can someone please check if there's anything missing or wrong or unneccessary?
token = Jwts.builder()
.setSubject ("com.mycompany.myproject")
.setId ("QXXXXXXXXX.com.mycompany.myproject")
.setHeaderParam("alg", "ES256")
.setHeaderParam("kid", "CXXXXXXXXX")
.setHeaderParam("id", "QXXXXXXXXX.com.mycompany.myproject")
.setIssuedAt (dateNow)
.setExpiration (dateExpires)
.claim("iss", "QXXXXXXXXX")
.claim("iat", timeNow) // same as dateNow, but in ms
.claim("exp", timeExpires) // same as dateExpires, but in ms
.claim("sub", "com.mycompany.myproject")
.signWith (privateKey, SignatureAlgorithm.ES256)
.compact();
With that in place, I'm creating the connection as follows. Although I've called URLs before, this is the first time I've attempted an authenticated connection, and there are a lot of moving parts.
URL url = new URL("https://weatherkit.apple.com/api/v1/weather/en/40.5/-73.5?dataSets=currentWeather&timezone=Europe/London");
HttpURLConnection conn = null;
conn = (HttpURLConnection) url.openConnection()
conn.setRequestMethod ("GET");
conn.setRequestProperty ("Authorization", "Bearer "+ token);
conn.setRequestProperty ("Content-Type", "application/x-www-form-urlencoded");
conn.setRequestProperty ("Content-Language", "en-US");
conn.setUseCaches (false);
conn.setDoInput (true);
conn.setDoOutput (true);
conn.setConnectTimeout (30000); //set timeout to 30 seconds
Executing conn.connect() churns for a little while and then returns a 403 error.
Any help from someone who's done this successfully is greatly appreciated.