Background process web request issue with IOS12

My watchface pulls data out of an API request through a background process. I call it every 6 hours, to save battery life.
It worked fine for over a year with my android device.

I just moved back to iPhone, and it doesn’t seem to work at all. No data seem to make it through, and the watch face is stuck with the same info.
Any ideas?
I just changed phone, and paired the watch. I was thinking of trying of removing the watch face and reinstalling it. But I don’t see why that should be the solution. It looks more like something to do with the way phone and watch are handling background processes. Any ideas?
  • So the 104 is indeed as HermoT suggest. I was killing the app, and therefore no communication happening. PS not a great implementation, IMHO.
    But the 201 comes from the same issue as a previous post a while ago. https://forums.garmin.com/forum/developers/connect-iq/1432917-webrequest-response-issue
    Moving it back there. It is something related to the responsetype and wifi.
  • for the -201, as I said, I'd really look at what you are passing in the makeWebRequest - with lat/lon being a prime candidate. You might be using them as a doubles (as that's what you get with toDegrees() for a location) and adding a toFloat() to them would solve this.

    You are posting a 201 error, but from your log, it's really a -201, and something different. It's not coming from the site, but from GCM on the phone - the request never makes it past that. It's like a 400 error and a -400 are different.

  • For debugging to check for doubles, you can put in something like this if you're not sure on what type something is
    if(latitude instanceof Double) {Sys.println("Danger Will Robinson!");
  • So the 104 is indeed as HermoT suggest. I was killing the app, and therefore no communication happening. PS not a great implementation, IMHO.


    I don't like it either, but it is an iOS platform limitation I think. On Android it probably runs as a service or daemon, whereas iOS platform doesn't allow such things.
  • I assisted agsurf5 and the -201 error is caused when using an empty string as value in the params dictionary:

    {"extremes"=>""}

    Luckily we can workaround the issue by putting in any value (except empty and null) because worldtides api is only expecting the parameter as a switch and thus ignores the value.

    This is definitely a bug.
  • Is it like the problem with doubles where the request never makes it past iOS so it never makes it to the server?
  • Correct, it doesn't go out the Connect gateway...my guess is that the bug is in Connect (iOS)