Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Heading event: -1 for geographic orientation
Started by tap32 Nov 16 2019 05:58 AM

3 replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

tap32

[GLOBAL: userInfoPane.html]
tap32
  • Contributor

  • 256 posts
  • Corona SDK

I've just found an issue where on iOS the heading event can return -1 for geographic orientation if the location services are disabled or the compass is not properly calibrated. Has anyone else come across this, and are there any good approaches to detecting this issue?

 

This does not seem to affect the magnetic value.

 

 

 

 



[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,393 posts
  • Enterprise

If it's negative ignore it?



[TOPIC: post.html]
#3

tap32

[GLOBAL: userInfoPane.html]
tap32
  • Contributor

  • 256 posts
  • Corona SDK

That's my current approach, but I was wondering if there's a way to detect it using a system.getInfo call or similiar.



[TOPIC: post.html]
#4

tap32

[GLOBAL: userInfoPane.html]
tap32
  • Contributor

  • 256 posts
  • Corona SDK

So reading through the Apple docs it is clear that iOS requires location services to return geographic heading. If iOS cannot get the location geographic returns a negative value.

https://developer.apple.com/documentation/corelocation/clheading/1423568-trueheading

 

Is there anyway to detect if location services are enabled?




[topic_controls]
[/topic_controls]