Watchface loses GPS coordinates (only on Fenix 6 + iOS)

Dear Community,

My Watchface calculates sunrise/sunset based on the last known GPS coordinates:

			var curLoc = Activity.getActivityInfo().currentLocation;
			if (curLoc != null) {
				lat = curLoc.toDegrees()[0].toFloat();
				lon = curLoc.toDegrees()[1].toFloat();
			}

In case the location is null, it does not display the data.

This check and, respectively, the calculation is happening every midnight, and of course every fresh start of the watchface: during onUpdate I check if the data was already calculated today, and perform the location query and calulaion, if not, and then set the flag "already calculated today". The result is being saved to the buffered bitmap then, if that's important.

Now I have a second user of Fenix 6 and iOS who reports me, that the watchface loses GPS data (does not display sunrise/sunset data) periodically, and the period is a matter of hour(s), or when the user receives a notification from the phone and clears if from the watch.

Has anyone experienced the same issue? Is there any way to avoid this?

  • I'm checking for the location by

    var location = Activity.getActivityInfo().currentLocation()

    during onUpdate like following:

    1. is data already calculated today? yes - return, otherwise:

    2. get GPS location

    3. if valid, store it

    4. get the location from storage and calculate the data

    5. draw to the buffered bitmap

    6. set the flag "calculated today", flag is not saved in storage so it couldn't happen that GPS data is erased but flag persists

    Is this correct?

    Regarding how long is he using the activity after GPS lock - unfortunately, I do not know.

  • You can also try to get location from Weather.getCurrentConditions().observationLocationPosition, just make sure you do all the checks first - this way if the device supports it, the user won't even have to turn on the GPS for you to know the location :)