{"action":"created","issue":{"url":"https://api.github.com/repos/transistorsoft/nativescript-background-geolocation-lt/issues/38","repository_url":"https://api.github.com/repos/transistorsoft/nativescript-background-geolocation-lt","labels_url":"https://api.github.com/repos/transistorsoft/nativescript-background-geolocation-lt/issues/38/labels{/name}","comments_url":"https://api.github.com/repos/transistorsoft/nativescript-background-geolocation-lt/issues/38/comments","events_url":"https://api.github.com/repos/transistorsoft/nativescript-background-geolocation-lt/issues/38/events","html_url":"https://github.com/transistorsoft/nativescript-background-geolocation-lt/issues/38","id":193314885,"number":38,"title":"changePace question","user":{"login":"narayananl23","id":3720723,"avatar_url":"https://avatars.githubusercontent.com/u/3720723?v=3","gravatar_id":"","url":"https://api.github.com/users/narayananl23","html_url":"https://github.com/narayananl23","followers_url":"https://api.github.com/users/narayananl23/followers","following_url":"https://api.github.com/users/narayananl23/following{/other_user}","gists_url":"https://api.github.com/users/narayananl23/gists{/gist_id}","starred_url":"https://api.github.com/users/narayananl23/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/narayananl23/subscriptions","organizations_url":"https://api.github.com/users/narayananl23/orgs","repos_url":"https://api.github.com/users/narayananl23/repos","events_url":"https://api.github.com/users/narayananl23/events{/privacy}","received_events_url":"https://api.github.com/users/narayananl23/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2016-12-03T21:33:06Z","updated_at":"2016-12-06T05:59:00Z","closed_at":null,"body":"I would like to track my vehicle. In android for testing on emulator. How can I achieve it ? It only print\r\nonce. I shake'd my device for more than 10 sec, but it is not logging. \r\n\r\nBelow is my code. Where should i include changePace ?\r\n\r\n`export class HelloWorldModel extends Observable {\r\n\r\n    private _message: string;\r\n    private _state: any;\r\n\r\n    constructor() {\r\n        super();\r\n        //if (this._state) { return };\r\n        BackgroundGeolocation.on(\"location\", this.onLocation.bind(this));\r\n\r\n        // Configure it.\r\n        BackgroundGeolocation.configure({\r\n            debug: true,\r\n            desiredAccuracy: 10,\r\n            stationaryRadius: 25,\r\n            distanceFilter: 20,\r\n            activityRecognitionInterval: 10000,\r\n            changePace:true,\r\n            license: \"licString\"\r\n        }, function (state) {\r\n            this._state = state;\r\n        }.bind(this));  \r\n\r\n    }\r\n\r\n    public onStop() {\r\n        //if (!this._state.enabled) {\r\n        //BackgroundGeolocation.off(\"location\", this.onLocation.bind(this));\r\n        BackgroundGeolocation.stop(this.offLocation.bind(this));\r\n        // }  \r\n    }\r\n\r\n    public onStart() {\r\n        BackgroundGeolocation.start();\r\n    }\r\n\r\n    public onLocation(location: any) {\r\n        console.info('[js] location: ', JSON.stringify(location, null, 2));\r\n    }\r\n\r\n    public offLocation(location: any) {\r\n        console.info('Location is off');\r\n    }\r\n\r\n    public onLocationError(error: any) {\r\n        console.error('- onLocationError: ', error);\r\n    }`"},"comment":{"url":"https://api.github.com/repos/transistorsoft/nativescript-background-geolocation-lt/issues/comments/265067964","html_url":"https://github.com/transistorsoft/nativescript-background-geolocation-lt/issues/38#issuecomment-265067964","issue_url":"https://api.github.com/repos/transistorsoft/nativescript-background-geolocation-lt/issues/38","id":265067964,"user":{"login":"narayananl23","id":3720723,"avatar_url":"https://avatars.githubusercontent.com/u/3720723?v=3","gravatar_id":"","url":"https://api.github.com/users/narayananl23","html_url":"https://github.com/narayananl23","followers_url":"https://api.github.com/users/narayananl23/followers","following_url":"https://api.github.com/users/narayananl23/following{/other_user}","gists_url":"https://api.github.com/users/narayananl23/gists{/gist_id}","starred_url":"https://api.github.com/users/narayananl23/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/narayananl23/subscriptions","organizations_url":"https://api.github.com/users/narayananl23/orgs","repos_url":"https://api.github.com/users/narayananl23/repos","events_url":"https://api.github.com/users/narayananl23/events{/privacy}","received_events_url":"https://api.github.com/users/narayananl23/received_events","type":"User","site_admin":false},"created_at":"2016-12-06T05:59:00Z","updated_at":"2016-12-06T05:59:00Z","body":"Android default simulator works with the demo. It does not with mine. something wrong... something sily. All I am doing is startTap (printing location) and stopTap,  and clearTap with three buttons tap.\r\n\r\n```\r\nimport { Observable } from 'data/observable';\r\nimport { BackgroundGeolocation } from \"nativescript-background-geolocation-lt\";\r\nimport app = require(\"application\");\r\n\r\nexport class HelloWorldModel extends Observable {\r\n\r\n    private _message: string;\r\n    private _state: any;\r\n    private _enabled: boolean;\r\n\r\n    constructor() {\r\n        super();\r\n        if (this._state) { return };\r\n        BackgroundGeolocation.on(\"location\", this.onLocation.bind(this));\r\n        BackgroundGeolocation.on('motionchange', function (location) {\r\n            console.log('- motionchange only receives the final most accurate location.  Never samples');\r\n        });\r\n    }\r\n\r\n    public stopTap() {\r\n        BackgroundGeolocation.stop(this.offLocation.bind(this));\r\n        BackgroundGeolocation.getCount(function (count) {\r\n            console.log('- count: ', count);\r\n        });\r\n    }\r\n\r\n    public clearTap() {\r\n        BackgroundGeolocation.destroyLocations(function () {\r\n            console.log('- cleared database');\r\n        });\r\n        BackgroundGeolocation.resetOdometer(function () {\r\n            console.log('- cleared Odometer');\r\n        });\r\n    }\r\n\r\n    public startTap() {\r\n        // Configure it.\r\n        BackgroundGeolocation.changePace(true); // <-- Aggressive GPS monitoring immediately engaged. to suport testing on device\r\n        BackgroundGeolocation.configure({\r\n            debug: true,\r\n            desiredAccuracy: 0,\r\n            stationaryRadius: 25,\r\n            distanceFilter: 20,\r\n            activityRecognitionInterval: 10000,\r\n            locationUpdateInterval: 5000,\r\n            stopTimeout: 5,\r\n            isMoving: true,\r\n            license: \"****************\"\r\n        }, function (state) {\r\n            console.log('- Configure success.  Enabled? ', state.enabled);\r\n            BackgroundGeolocation.changePace(true);\r\n            BackgroundGeolocation.start(function () { });\r\n            this._state = state;\r\n        }.bind(this));\r\n    }\r\n\r\n\r\n    public onLocation(location: any) {\r\n        console.log(location.is_moving + \",\" + location.timestamp + \",\" + location.uuid + \",\" + location.coords.latitude + \",\" + location.coords.longitude);\r\n    }\r\n\r\n    public offLocation(location: any) {\r\n        console.info('off');\r\n    }\r\n\r\n    public onLocationError(error: any) {\r\n        console.error('- onLocationError: ', error);\r\n    }\r\n\r\n}\r\n```"}}
{"actor":{"display_login":"narayananl23"}}