Skip to content
This repository was archived by the owner on Sep 15, 2021. It is now read-only.
This repository was archived by the owner on Sep 15, 2021. It is now read-only.

Bug : DeviceMotion Plugin crashes if no accelerometer supported #1190

@vejja

Description

@vejja

When running in a desktop browser, the Device Motion Plugin crashes with the following error :

ionic.bundle.js:25642 TypeError: Cannot read property 'watchAcceleration' of undefined
at Object.watchAcceleration (lib/ngCordova/dist/ng-cordova.js:1910:46)

The error happens when there is no accelerometer support on the testing device.
This is due to an unhandled q.reject promise return at the stated line.

Not a major bug (as supposedly people will use this plugin on accelerometer-enabled devices) but still getting in my way through the debugging process; I'm submitting a pull request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions