{"action":"created","issue":{"url":"https://api.github.com/repos/transistorsoft/cordova-background-geolocation-lt/issues/243","repository_url":"https://api.github.com/repos/transistorsoft/cordova-background-geolocation-lt","labels_url":"https://api.github.com/repos/transistorsoft/cordova-background-geolocation-lt/issues/243/labels{/name}","comments_url":"https://api.github.com/repos/transistorsoft/cordova-background-geolocation-lt/issues/243/comments","events_url":"https://api.github.com/repos/transistorsoft/cordova-background-geolocation-lt/issues/243/events","html_url":"https://github.com/transistorsoft/cordova-background-geolocation-lt/issues/243","id":196270795,"number":243,"title":"Background location reading is not working","user":{"login":"hiteshthakor","id":19173057,"avatar_url":"https://avatars.githubusercontent.com/u/19173057?v=3","gravatar_id":"","url":"https://api.github.com/users/hiteshthakor","html_url":"https://github.com/hiteshthakor","followers_url":"https://api.github.com/users/hiteshthakor/followers","following_url":"https://api.github.com/users/hiteshthakor/following{/other_user}","gists_url":"https://api.github.com/users/hiteshthakor/gists{/gist_id}","starred_url":"https://api.github.com/users/hiteshthakor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hiteshthakor/subscriptions","organizations_url":"https://api.github.com/users/hiteshthakor/orgs","repos_url":"https://api.github.com/users/hiteshthakor/repos","events_url":"https://api.github.com/users/hiteshthakor/events{/privacy}","received_events_url":"https://api.github.com/users/hiteshthakor/received_events","type":"User","site_admin":false},"labels":[{"id":493808234,"url":"https://api.github.com/repos/transistorsoft/cordova-background-geolocation-lt/labels/Waiting%20for%20feedback","name":"Waiting for feedback","color":"fef2c0","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-12-18T11:29:54Z","updated_at":"2016-12-29T16:53:19Z","closed_at":"2016-12-29T16:53:19Z","body":"\r\n    function onDeviceReady() {\r\n        // Get a reference to the plugin.\r\n        var bgGeo = window.BackgroundGeolocation;\r\n\r\n        //This callback will be executed every time a geolocation is recorded in the background.\r\n        var callbackFn = function (location, taskId) {\r\n            var coords = location.coords;\r\n            var lat = coords.latitude;\r\n            var lng = coords.longitude;\r\n\r\n            var addVisitUrl = 'myapiURL';\r\n            var item = {\r\n                \"UserName\": localStorage.getItem('username'),\r\n                \"Lat\": location.latitude,\r\n                \"Long\": location.longitude,\r\n                \"Token\": localStorage.getItem('accessKey')\r\n            };\r\n\r\n            $http({\r\n                method: 'POST',\r\n                url: addVisitUrl + 'Location/UpdateLocation',\r\n                data: item\r\n            });\r\n\r\n            alert(\"Location Updating\")\r\n            console.log('- Location: ', JSON.stringify(location));\r\n\r\n            // Must signal completion of your callbackFn.\r\n            bgGeo.finish(taskId);\r\n        };\r\n\r\n        // This callback will be executed if a location-error occurs.  Eg: this will be called if user disables location-services.\r\n        var failureFn = function (errorCode) {\r\n            console.warn('- BackgroundGeoLocation error: ', errorCode);\r\n        }\r\n\r\n        // Listen to location events & errors.\r\n        bgGeo.on('location', callbackFn, failureFn);\r\n\r\n        // Fired whenever state changes from moving->stationary or vice-versa.\r\n        bgGeo.on('motionchange', function (isMoving) {\r\n            console.log('- onMotionChange: ', isMoving);\r\n        });\r\n\r\n        // BackgroundGeoLocation is highly configurable.\r\n        bgGeo.configure({\r\n            // Geolocation config\r\n            desiredAccuracy: 0,\r\n            distanceFilter: 10,\r\n            stationaryRadius: 50,\r\n            locationUpdateInterval: 1000,\r\n            fastestLocationUpdateInterval: 5000,\r\n\r\n            // Activity Recognition config\r\n            activityType: 'AutomotiveNavigation',\r\n            activityRecognitionInterval: 5000,\r\n            stopTimeout: 5,\r\n\r\n            // Application config\r\n            debug: true,\r\n            stopOnTerminate: false,\r\n            startOnBoot: true,\r\n\r\n         \r\n        }, function (state) {\r\n            // This callback is executed when the plugin is ready to use.\r\n            console.log('BackgroundGeolocation ready: ', state);\r\n            if (!state.enabled) {\r\n                bgGeo.start();\r\n            }\r\n        });\r\n\r\n        // The plugin is typically toggled with some button on your UI.\r\n        function onToggleEnabled(value) {\r\n            if (value) {\r\n                bgGeo.start();\r\n            } else {\r\n                bgGeo.stop();\r\n            }\r\n        }\r\n        navigator.splashscreen.hide();\r\n    }"},"comment":{"url":"https://api.github.com/repos/transistorsoft/cordova-background-geolocation-lt/issues/comments/269658695","html_url":"https://github.com/transistorsoft/cordova-background-geolocation-lt/issues/243#issuecomment-269658695","issue_url":"https://api.github.com/repos/transistorsoft/cordova-background-geolocation-lt/issues/243","id":269658695,"user":{"login":"christocracy","id":14999,"avatar_url":"https://avatars.githubusercontent.com/u/14999?v=3","gravatar_id":"","url":"https://api.github.com/users/christocracy","html_url":"https://github.com/christocracy","followers_url":"https://api.github.com/users/christocracy/followers","following_url":"https://api.github.com/users/christocracy/following{/other_user}","gists_url":"https://api.github.com/users/christocracy/gists{/gist_id}","starred_url":"https://api.github.com/users/christocracy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christocracy/subscriptions","organizations_url":"https://api.github.com/users/christocracy/orgs","repos_url":"https://api.github.com/users/christocracy/repos","events_url":"https://api.github.com/users/christocracy/events{/privacy}","received_events_url":"https://api.github.com/users/christocracy/received_events","type":"User","site_admin":false},"created_at":"2016-12-29T16:53:19Z","updated_at":"2016-12-29T16:53:19Z","body":"Closing for lack of feedback."}}
{"actor":{"display_login":"christocracy"}}