When I run on my watch (vivoactive HR) using the latest version (3.11) of iOS GCM on the latest version of iOS 10 I get back a -2 error. If I have GCM running in the foreground on my phone I can see it crash as soon as the request is made.
How do I figure out why GCM is crashing? Is there anything that I can do differently in my app? I know that there were bugs with GCM on iOS 10 requesting web data, but the most recent build seems to have fixed that (at least for the build in weather widget).
Here is an example of the data that it is getting back:
http://tidesandcurrents.noaa.gov/api/datagetter?begin_date=20161006%2000%3A00&end_date=20161006%2006%3A00&station=8454000&product=predictions&datum=mllw&units=english&time_zone=lst&application=web_services&format=json
and the code:
function requestNextTideData()
{
var begin_date = startTimes[iTimes];
var end_date = endTimes[iTimes];
System.println("makeRequest()");
var url = "tidesandcurrents.noaa.gov/.../datagetter";
var station = stations[iStation]["id"];
System.println("begin_data = " + begin_date + ", end_date = " + end_date + ", station = " + station);
Comm.makeWebRequest(
url,
{
"begin_date" => begin_date,
"end_date" => end_date,
"station" => stations[iStation]["id"],
"product" => "predictions",
"datum" => "mllw",
"units" => "english",
"time_zone" => "lst_ldt",
"application" => "web_services",
"format" => "json"
},
{
:method => Comm.HTTP_REQUEST_METHOD_GET,
:responseType => Comm.HTTP_RESPONSE_CONTENT_TYPE_JSON
},
method(:onReceive));
System.println("makeRequest() done");
}