Changes to the Position Permission

I'd like to direct everyone to this recent post on the develop blog:

https://developer.garmin.com/index.php/blog/post/changes-to-the-position-permission

TL;DR, if your apps use Toybox.Activity.Info.currentLocation, enable the Position permission and re-build your app before June 30th because GDPR. :)
  • Former Member
    Former Member
    Thanks Jim, you are correct. I have corrected the information in my earlier post.
  • So my code stopped working with 2.4.6, spent some time to put debug code and find out what the issue is. I had not set the positioning permission. Does it not give any error if a permission is required? I have seen with other permissions that a message was given to indicate this. In the simulator with 2.4.6 there is no error message, info.currentLocation just returns null. So easy to fix my code but it seems that the sim should have given an error message.
  • Normally for something like this, the API entry in question is a function call (e.g., Communications.makeWebRequest() for the Communications permission, UserProfile.getProfile() for the User Profile permission, ...). When you make the function call, the permission can be validated by the system. Unfortunately, currentLocation is a member of a structure and not a method, so we can't do this check in that way. The most reasonable solution we could come up with was to use null.

    Given that the documentation for Activity.Info says:

    Fields in this class may return null so should be checked for null values prior to use.


    it seems reasonable for us to return null. It isn't ideal, I agree, but it was what we had to work with.

    Travis
  • I've found a way. Just add the line '<iq:uses-permission id="Positioning"/>' in manifest.xml with an editor outside Eclipse and rebuold your watchface. Works for my sappy watchface V7.9.7.