heading (compass)

Type Event
Dispatch chain Runtime
Revision 2017.3060
Keywords heading, compass

Overview

These are events generated by the compass hardware, if available on the device.

On iOS, you can use the appropriate UIRequiredDeviceCapabilities key to limit an app to devices with specific capabilities. On Android, you can include the usesFeatures table for the same purpose. Please see the Project Build Settings guide for more information.

Gotchas

Android

Android only supports event.magnetic, not event.geographic.

To enable heading events on Android devices, you must set the following permission in build.settings:

settings =
{
    android =
    {
        usesPermissions =
        {
            "android.permission.ACCESS_FINE_LOCATION"
        },
    },
}

Properties

event.name