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?
  • What error do you see on the makeWebRequest?

    On iOS, if you send a request with a double, you'll get a -201, but it works fine in the sim or with Android.
  • I am getting error 201 or 104.
  • -104 is you don't have a comm connection (not connected to the phone, so no comm)
    -201 invalid html body in request

    -104 happens so nothing odd there

    edit:

    -201 is what I meant in post #2 (not -202). Are you truing to use a double in your request instead of a float or a number?
  • I am getting the 104 pretty much all the time. See log below. Didn't happen on android.
    I'll investigate the 201 meanwhile. But it looks like that comm issue is there.


    Background: Tide request at: 16:44- Lat and Lon from ObjStore. Lat: 33.904044 and Lon: -118.380613
    Background: Communication error with tide server. Error Code: -201
    Background: Tide request at: 22:44- Lat and Lon from ObjStore. Lat: 33.904044 and Lon: -118.380613
    Background: Communication error with tide server. Error Code: -104
    Background: Tide request at: 4:44- Lat and Lon from ObjStore. Lat: 33.904044 and Lon: -118.380613
    Background: Communication error with tide server. Error Code: -104
    Background: Tide request at: 10:44- Lat and Lon from ObjStore. Lat: 33.904044 and Lon: -118.380613
    Background: Communication error with tide server. Error Code: -104
    Background: Tide request at: 16:44- Lat and Lon from ObjStore. Lat: 33.904044 and Lon: -118.380613
    Background: Communication error with tide server. Error Code: -104
    Background: Tide request at: 22:44- Lat and Lon from ObjStore. Lat: 33.904044 and Lon: -118.380613
    Background: Communication error with tide server. Error Code: -104
    Background: Tide request at: 4:44- Lat and Lon from ObjStore. Lat: 33.904044 and Lon: -118.380613
    Background: Communication error with tide server. Error Code: -104
    Background: Tide request at: 10:44- Lat and Lon from ObjStore. Lat: 33.904044 and Lon: -118.380613
    Background: Communication error with tide server. Error Code: -104
    Saving location from current activity: Obj: 142
    Background: Tide request at: 16:44- Lat and Lon from ObjStore. Lat: 33.920965 and Lon: -118.395390
    Background: Communication error with tide server. Error Code: -104
    Background: Tide request at: 22:44- Lat and Lon from ObjStore. Lat: 33.920965 and Lon: -118.395390
    Background: Communication error with tide server. Error Code: -104
    Background: Tide request at: 4:44- Lat and Lon from ObjStore. Lat: 33.920965 and Lon: -118.395390
    Background: Communication error with tide server. Error Code: -104
    Background: Tide request at: 10:44- Lat and Lon from ObjStore. Lat: 33.920965 and Lon: -118.395390
    Background: Communication error with tide server. Error Code: -104
    Background: Tide request at: 18:44- Lat and Lon from ObjStore. Lat: 33.920965 and Lon: -118.395390
    Background: Communication error with tide server. Error Code: -104
  • I am getting the 104 all the time. It never happened on android.
    I basically got it 20 times and only one 201. For some reason I cannot post the log here.

    I will be investigating the 201, but it looks like the real issue is the comm. IOS12. Any suggestions?
  • -104 would be your phone isn't connected. Are you sure you're not having a bluetooth issue?
  • It looks like I do have some. I read around the forum and I have been troubleshooting a bunch. But it does not seem to work too well.
    I am not sure if it is a IOS12 or some other issue.
    If you think that is the main issue, I'll look into that more. I assume 104 would point to that direction.
    Thanks Jim.
  • The error codes you see are defined in the API doc under Communications. -104 is that you aren't connected. You could log phoneConnected in Sys,getDeviceSettings() if you want to check. IF there's a wifi connection active, it will try to use that, so if you have a watch with wifi, turn that off.
  • A common mistake that someone can make when moving from Android to iOS, is to forget that the Connect app must be actually running on the iOS device.
    This is in contrast with Android where the Connect app doesn't have to be open all the time.
    On iOS the app can be backgrounded, that also works. As long as it is not completely killed/closed.
  • Hermo, being an Android person, that's one I forget about with iOS!

    As far as the -201, The place I first saw that with iOS was in a request that included lat/lon, where by default, a toDegrees() returns the lat and lon as an array of doubles. Before using them in the request, I just had to do a toFloat() on them.