Sensors with Sailjail

I’ve been fiddling with a compass app, attempting to make a horizontally scrolling compass for use in a dashboard app.

I now have a ‘working’ model (POC so to speak), upon building and testing the app, I found that the Compass was not functioning. After reading about Sailjail permissions, I see that Sensors should not be declared directly, but without this, compass would not function.

I looked at my import statements and realised that I had added QtLocation and QtPositioning which are not being used, so I removed them anyway, thinking that perhaps just the import statements alone, are causing Sailjail to halt proceedings…but no. I had to add Sensors.

What am I missing here?, my app now works with Sensors declared in .desktop file and the compass will not function without it…what’s going on here?

The Sensors permission is indeed internal, and should not be used directly in applications. Instead you should use a more specific permission. In a perfect world we would have a specific permission for compass, but we don’t. Perhaps in the future we will, but in the mean time I suggest you use Location permission. It does provide your app with a bit more than what is really needed in your case, but I’m afraid that’s the best we can do at the moment.


Thanks @vige, will do.