{"action":"created","issue":{"url":"https://api.github.com/repos/transistorsoft/cordova-background-geolocation-lt/issues/154","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/154/labels{/name}","comments_url":"https://api.github.com/repos/transistorsoft/cordova-background-geolocation-lt/issues/154/comments","events_url":"https://api.github.com/repos/transistorsoft/cordova-background-geolocation-lt/issues/154/events","html_url":"https://github.com/transistorsoft/cordova-background-geolocation-lt/issues/154","id":165280366,"number":154,"title":"url doesn't seem to be taken into consideration during configuration","user":{"login":"fcamblor","id":603815,"avatar_url":"https://avatars.githubusercontent.com/u/603815?v=3","gravatar_id":"","url":"https://api.github.com/users/fcamblor","html_url":"https://github.com/fcamblor","followers_url":"https://api.github.com/users/fcamblor/followers","following_url":"https://api.github.com/users/fcamblor/following{/other_user}","gists_url":"https://api.github.com/users/fcamblor/gists{/gist_id}","starred_url":"https://api.github.com/users/fcamblor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fcamblor/subscriptions","organizations_url":"https://api.github.com/users/fcamblor/orgs","repos_url":"https://api.github.com/users/fcamblor/repos","events_url":"https://api.github.com/users/fcamblor/events{/privacy}","received_events_url":"https://api.github.com/users/fcamblor/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":21,"created_at":"2016-07-13T09:47:07Z","updated_at":"2016-07-26T20:58:56Z","closed_at":"2016-07-26T16:29:57Z","body":"Using `com.transistorsoft.cordova.background-geolocation@1.6.2`, I'm configuring the background geocoder as follow (typescript, but is easily understandable) :\r\n```\r\nclass CordovaGeoTracker implements IGeoTracker {\r\n    private bgGeo = _.get<any>(window, 'BackgroundGeolocation');\r\n\r\n    public start(){\r\n        var defer = Q.defer<void>();\r\n\r\n        this.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            // HTTP / SQLite config\r\n            url: 'https://geolocation-console.herokuapp.com/locations',\r\n            method: 'POST',\r\n            autoSync: true,\r\n            maxDaysToPersist: 1,\r\n            headers: {\r\n            },\r\n            params: {\r\n            }\r\n        }, (state: any) => {\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                this.bgGeo.start(() => {\r\n                    defer.resolve();\r\n                });\r\n            } else {\r\n                defer.resolve();\r\n            }\r\n        });\r\n\r\n        // Listen to location events & errors.\r\n        this.bgGeo.on('location', (location: any, taskId: any) => {\r\n            var coords = location.coords;\r\n            var lat    = coords.latitude;\r\n            var lng    = coords.longitude;\r\n            console.log('- Location: ', JSON.stringify(location));\r\n\r\n            // Must signal completion of your callbackFn.\r\n            this.bgGeo.finish(taskId);\r\n        }, (errorCode: any) => {\r\n            console.warn('- BackgroundGeoLocation error: ', errorCode);\r\n        });\r\n\r\n        // Fired whenever state changes from moving->stationary or vice-versa.\r\n        this.bgGeo.on('motionchange', (isMoving: boolean) => {\r\n            console.log('- onMotionChange: ', isMoving);\r\n        });\r\n\r\n        return defer.promise;\r\n    }\r\n}\r\n```\r\n\r\nHowever, once initialized, when I execute following code in the remote debug console of my iPhone, I don't get any URL configured :\r\n\r\n```\r\nBackgroundGeolocation.getState(function(state){ console.log(state); })\r\n\r\n>>\r\nObject\r\nactivityRecognitionInterval: 5000\r\nactivityType: 2\r\nautoSync: true\r\nbatchSync: false\r\ndebug: true\r\ndesiredAccuracy: -1\r\ndisableElasticity: false\r\ndisableMotionActivityUpdates: false\r\ndisableStopDetection: false\r\ndistanceFilter: 10\r\nenabled: true\r\nheartbeatInterval: 60\r\nhttpMethod: \"POST\"\r\nisMoving: false\r\nlocationTimeout: 60\r\nmaxBatchSize: -1\r\nmaxDaysToPersist: 1\r\nmaxRecordsToPersist: -1\r\npausesLocationUpdatesAutomatically: false\r\npreventSuspend: false\r\nschedule: false\r\nschedulerEnabled: false\r\nstartOnBoot: true\r\nstationaryRadius: 50\r\nstopAfterElapsedMinutes: -1\r\nstopDetectionDelay: 0\r\nstopOnTerminate: false\r\nstopTimeout: 300\r\nuseSignificantChangesOnly: false\r\n```\r\n\r\n(and when I start the app, I never see any location on my geolocation console .. whereas when using the SampleApp, it works)\r\n\r\nWould you have any idea of what's going wrong ?"},"comment":{"url":"https://api.github.com/repos/transistorsoft/cordova-background-geolocation-lt/issues/comments/235403455","html_url":"https://github.com/transistorsoft/cordova-background-geolocation-lt/issues/154#issuecomment-235403455","issue_url":"https://api.github.com/repos/transistorsoft/cordova-background-geolocation-lt/issues/154","id":235403455,"user":{"login":"fcamblor","id":603815,"avatar_url":"https://avatars.githubusercontent.com/u/603815?v=3","gravatar_id":"","url":"https://api.github.com/users/fcamblor","html_url":"https://github.com/fcamblor","followers_url":"https://api.github.com/users/fcamblor/followers","following_url":"https://api.github.com/users/fcamblor/following{/other_user}","gists_url":"https://api.github.com/users/fcamblor/gists{/gist_id}","starred_url":"https://api.github.com/users/fcamblor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fcamblor/subscriptions","organizations_url":"https://api.github.com/users/fcamblor/orgs","repos_url":"https://api.github.com/users/fcamblor/repos","events_url":"https://api.github.com/users/fcamblor/events{/privacy}","received_events_url":"https://api.github.com/users/fcamblor/received_events","type":"User","site_admin":false},"created_at":"2016-07-26T20:58:55Z","updated_at":"2016-07-26T20:58:55Z","body":"@joshgarwood FYI I'm using `lodash` (with its typings definition file) for the `_.get<any>(window, key)` to make it compile.\r\n\r\nObviously, I won't have any definition for `BackgroundGeolocation` object by doing this since it doesn't exist yet."}}
{"actor":{"display_login":"fcamblor"}}