apache / apache/cordova-plugin-device-orientation

Documentation: CompassError code 3 on Android 10

Open
#63 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
63
Forks
80
PR merge metrics
No merged PRs in 30d

Description

# Bug Report

## Problem
When subscribing to a `watchHeading` function, I get a `CompassError {code: 3}` response. It works on older Android phones. I haven't tested iOS. If I browsed the code correctly. The error code is neither one of `CompassError.COMPASS_INTERNAL_ERR CompassError.COMPASS_NOT_SUPPORTED`.

### What is expected to happen?
It should work.

### What does actually happen?
I get an undocumented `CompassError`.

## Information

It doesn't work on Android 10.

### Command or Code

```
import { DeviceOrientation } from '@ionic-native/device-orientation/ngx';

constructor(
private deviceOrientation: DeviceOrientation
) { }

this.compass = this.deviceOrientation.watchHeading({frequency: 500}).subscribe(data => {
// logic
});
```

### Environment, Platform, Device

I used Angular 11, Ionic framework 5 and Capacitor.

### Version information

`ionic info` output:

```
Ionic:

Ionic CLI : 6.13.1 (/usr/local/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 5.6.4
@angular-devkit/build-angular : 0.1102.8
@angular-devkit/schematics : 9.1.0
@angular/cli : 11.2.8
@ionic/angular-toolkit : 2.3.3

Capacitor:

Capacitor CLI : 2.4.7
@capacitor/core : 2.4.7

Cordova:

Cordova CLI : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : not available
Cordova Plugins : not available

Utility:

cordova-res (update available: 0.15.3) : 0.15.2
native-run (update available: 1.3.0) : 1.2.2

System:

Android SDK Tools : 26.1.1 (/Users/datigo/Library/Android/sdk)
ios-deploy : 1.10.0
ios-sim : ios-sim/9.0.0 darwin-x64 node-v12.18.3
NodeJS : v12.18.3 (/usr/local/Cellar/node@12/12.18.3/bin/node)
npm : 6.14.6
OS : macOS Catalina
Xcode : Xcode 12.4 Build version 12D4e
```

## Checklist

- [x] I searched for existing GitHub issues
- [x] I updated all Cordova tooling to most recent version
- [x] I included all the necessary information above

Contributor guide

Open the contributing guide

Research direction

Start at the watchHeading entry point and read how CompassError constants are defined and reported on Android. Reproduce the behavior on Android 10 if possible, then document what error code 3 means and when it occurs, with the older Android behavior noted for comparison.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, angular, java, javascript
Domain
mobile
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.