WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

System locked out geolocation #142

@mrwrighty

Description

@mrwrighty

Your Environment

  • Plugin version: 1.9.1
  • Platform: iOS
  • OS version: 12.1.4
  • Device manufacturer / model: Apple iPhone X
  • Nativescript version (tns info): 5.2.0
  • Plugin config
    nativescript_background_geolocation_lt_1.BackgroundGeolocation.ready({
    reset: true,
    debug: true,
    url: 'URL hidden for security',
    logLevel: nativescript_background_geolocation_lt_1.BackgroundGeolocation.LOG_LEVEL_VERBOSE,
    desiredAccuracy: nativescript_background_geolocation_lt_1.BackgroundGeolocation.DESIRED_ACCURACY_HIGH,
    distanceFilter: 100,
    stopTimeout: 1,
    autoSync: true,
    stopOnTerminate: false,
    startOnBoot: true,
    foregroundService: true,
    preventSuspend: true,
    heartbeatInterval: 60,
    enableHeadless: true
    }, function (state) {
    console.log('[ready] success -', state);
    // _this.paceButtonIcon = (state.isMoving) ? ICONS.pause : ICONS.play;
    _this.enabled = state.enabled;
    }, function (error) {
    console.warn('[ready] FAILURE -', error);
    });
    return _this;
    }
    Object.defineProperty(HelloWorldModel.prototype, "enabled", {
    get: function () {
    return this._enabled;
    },
    set: function (value) {
    console.log('- setEnabled: ', value);
    this.notifyPropertyChange('enabled', value);
    this._enabled = value;
    if (value) {
    nativescript_background_geolocation_lt_1.BackgroundGeolocation.start();
    }
    else {
    nativescript_background_geolocation_lt_1.BackgroundGeolocation.stop();
    }
    },
    enumerable: true,
    configurable: true
    });
    Object.defineProperty(HelloWorldModel.prototype, "location", {
    get: function () {
    return this._location;
    },
    set: function (location) {
    this._location = location;
    this.notifyPropertyChange('location', this._location);
    },
    enumerable: true,
    configurable: true
    });
    HelloWorldModel.prototype.onChangePace = function () {
    console.log('[changePace] -', this._isMoving);
    this._isMoving = !this._isMoving;
    nativescript_background_geolocation_lt_1.BackgroundGeolocation.changePace(this._isMoving);
    };
    HelloWorldModel.prototype.onGetCurrentPosition = function () {
    nativescript_background_geolocation_lt_1.BackgroundGeolocation.getCurrentPosition({
    samples: 3,
    persist: true
    }).then(function (location) {
    console.log('[getCurrentPosition] -', location);
    }).catch(function (error) {
    console.warn('[getCurrentPosition] ERROR -', error);
    });
    };
    return HelloWorldModel;
    }(observable_1.Observable));
    exports.HelloWorldModel = HelloWorldModel;

Expected Behavior

Background location enabled when location services enabled. App fails to start if location services set to Never.

Actual Behavior

Irrespective of the settings, geolocation failed to initialise. setEnabled always false.

Steps to Reproduce

Cannot at the moment. System forced in to setEnabled True by

if (value) {
nativescript_background_geolocation_lt_1.BackgroundGeolocation.start();
}
else {
nativescript_background_geolocation_lt_1.BackgroundGeolocation.start();
}

Therefore forcing a start under any circumstances. Changing Location services also now triggers warning, but generates an error "Location Error: The operation couldn't be completed (kCLErrorDomain error 1.)
2.
3.
4.

Context

Background location

Debug logs

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