deviceOrientation-Plugin returns 0


#1

I am trying to implement to Ionic device-orientation plugin.
I’ve added to flowing to code to my App:

this.subscription = this.deviceOrientation.watchHeading({frequency: 1000}).subscribe(
      function(data){
        alert(data.magneticHeading)
      }
    );

I am using the Android Emulator to test the orientation value. But a always get the value 0.
I also ensured that the setting of the orientation works in Android Emulator (by using a compass-App)

Does anybody has an idea why the orientation doesn’t change ?


#2

Has anybody implemented the device-orientation plugin and could show me how he did this ?


#3

I’m having the exact same problem.

The Android emulator’s extended controls (the window that pops up when you click on the kebab button at the bottom of the sidebar) includes a “Location” tab. It looks like it even has the ability to play back a chronological sequence of GPS data.

So the emulator obviously supports location services. I just can’t get it to return any heading other than 0.