I am trying to access user's bearing from current location in my iOS app.
I am using below code to access it
func locationManager(_ manager: CLLocationManager, didUpdateHeading newHeading: CLHeading) {
heading = newHeading.trueHeading > 0 ? newHeading.trueHeading : newHeading.magneticHeading
}
However, it's not useful if we look at in 2D plane, where degree ranges from 0 to 360 clockwise. I want to send the bearing data to a different subscriber user through socket where an annotation with heading indicator(just like current location indicator with heading) on map can be displayed on iOS and Android. I am using a custom image which has heading indicator pointing up(12 O'Clock) to show on it on my other app.
Android has bearing which is the kind value I am looking for.
How can I get that value?
Thanks