{"action":"created","issue":{"url":"https://api.github.com/repos/mauron85/react-native-background-geolocation/issues/195","repository_url":"https://api.github.com/repos/mauron85/react-native-background-geolocation","labels_url":"https://api.github.com/repos/mauron85/react-native-background-geolocation/issues/195/labels{/name}","comments_url":"https://api.github.com/repos/mauron85/react-native-background-geolocation/issues/195/comments","events_url":"https://api.github.com/repos/mauron85/react-native-background-geolocation/issues/195/events","html_url":"https://github.com/mauron85/react-native-background-geolocation/issues/195","id":324308330,"number":195,"title":"BackgoundGeolocation.on('location, ...) not being fired on android 8.1.0","user":{"login":"GillesVercammen","id":22342373,"avatar_url":"https://avatars1.githubusercontent.com/u/22342373?v=4","gravatar_id":"","url":"https://api.github.com/users/GillesVercammen","html_url":"https://github.com/GillesVercammen","followers_url":"https://api.github.com/users/GillesVercammen/followers","following_url":"https://api.github.com/users/GillesVercammen/following{/other_user}","gists_url":"https://api.github.com/users/GillesVercammen/gists{/gist_id}","starred_url":"https://api.github.com/users/GillesVercammen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GillesVercammen/subscriptions","organizations_url":"https://api.github.com/users/GillesVercammen/orgs","repos_url":"https://api.github.com/users/GillesVercammen/repos","events_url":"https://api.github.com/users/GillesVercammen/events{/privacy}","received_events_url":"https://api.github.com/users/GillesVercammen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-18T07:59:43Z","updated_at":"2018-05-18T08:13:25Z","closed_at":null,"author_association":"NONE","body":"\r\n<!--- Include as many relevant details about the environment you experienced the bug in -->\r\n \"react-native\": \"0.53.3\",\r\nin my build.gradle: \r\next {\r\n    compileSdkVersion = 26\r\n    targetSdkVersion = 26\r\n    buildToolsVersion = \"26.0.2\"\r\n    supportLibVersion = \"26.1.0\"\r\n    googlePlayServicesVersion = \"11.8.0\"\r\n    oreoEXPERIMENTAL = \"yes\"\r\n}\r\n* Plugin version: v0.5.0-alpha.1 \r\n* Platform:  Android\r\n* OS version: 8.1.0 Oreo\r\n* Device manufacturer and model: Nexus 5\r\n* React Native version: 0.53.3\r\n* Plugin configuration options: \r\next {\r\n    compileSdkVersion = 26\r\n    targetSdkVersion = 26\r\n    buildToolsVersion = \"26.0.2\"\r\n    supportLibVersion = \"26.1.0\"\r\n    googlePlayServicesVersion = \"11.8.0\"\r\n    oreoEXPERIMENTAL = \"yes\"\r\n}\r\n* Link to your project: (private on bb)\r\n\r\n## Context\r\nThe backgroundlocation is being started after i press accept in the permission dialog, but it doesn't trigger the backgroundGeolocation.on('location', ...). I don't know if this is because there are no location received, or because it just doesn't trigger.\r\nall relevant backgroundgeolocation code:\r\nhttps://gist.github.com/GillesVercammen/aba915e6e53bd9abe5ba382f15c2742d\r\n\r\n\r\nOn ios it works like it should.\r\n\r\n## Expected Behavior\r\nUser logs in --> get asked for permission --> accepts --> background location is starting / tracking toggle on --> location gets updated, on location check distance --> if distance < 500, show alert\r\n\r\n## Actual Behavior\r\n\r\n1. The application ask for permission correctly, then when i press accept. The background location starts. i even get the notification that background location is enabled. The problem is that i never receive any locations, so i'm not getting into the BackgroundLocation.on('location') callback.\r\n\r\n2. The application is checking the status of the background tracking before the service has actually started. Relevant code: \r\nhttps://gist.github.com/GillesVercammen/77a4dd2c5e9ffffb497b5128891e137a\r\n\r\nThis is the order of function getting called in my debugged:\r\n[INFO] App is in background\r\nUserList.js:256 [NOTE] CHECKING THE TRACKING STATUS!!!\r\nUserList.js:261 [NOTE] TRACKING IS NOT RUNNING\r\nUserList.js:210 [INFO] App is in foreground\r\nUserList.js:221 IN FOREGROUND AND STARTING\r\nUserList.js:243 [NOTE] app is in handleAppstate and authorized, starting tracking!!!\r\nUserList.js:250 HANDLE STATE AND STARTING\r\nUserList.js:256 [NOTE] CHECKING THE TRACKING STATUS!!!\r\nUserList.js:261 [NOTE] TRACKING IS NOT RUNNING\r\n2UserList.js:186 [INFO] BackgroundGeolocation service has been started\r\n\r\nAs you can see it is checking station before the geolocation actually started running, which makes it so that my toggle is in 'off' modus, even though the app is tracking\r\n## Possible Fix\r\n\r\n## Steps to Reproduce\r\nhttps://gist.github.com/GillesVercammen/aba915e6e53bd9abe5ba382f15c2742d\r\n\r\n## Context\r\nI'm trying to track geolocation after permission was accepted on android.\r\nTrying to track when app is in foreground and background. both not working\r\n\r\n## Debug logs\r\n\r\nRelevant parts from printAndroidLogs or printIosLogs.\r\n05-18 09:47:27.615 31552-31552/be.appfoundry.digitalreceptionist.debug I/com.marianhello.bgloc.react.BackgroundGeolocationModule: App will be resumed\r\n05-18 09:47:27.665 31552-32350/be.appfoundry.digitalreceptionist.debug D/com.marianhello.bgloc.BackgroundGeolocationFacade: Stopping service\r\n05-18 09:47:27.688 31552-32351/be.appfoundry.digitalreceptionist.debug D/com.marianhello.bgloc.BackgroundGeolocationFacade: Starting service\r\n05-18 09:47:27.695 31552-32353/be.appfoundry.digitalreceptionist.debug D/com.marianhello.bgloc.BackgroundGeolocationFacade: Stopping service\r\n05-18 09:47:27.698 31552-32349/be.appfoundry.digitalreceptionist.debug D/com.marianhello.bgloc.data.sqlite.SQLiteConfigurationDAO: Configuration persisted with rowId = 1\r\n05-18 09:47:27.700 31552-32349/be.appfoundry.digitalreceptionist.debug D/com.marianhello.bgloc.BackgroundGeolocationFacade: Service configured with: Config[distanceFilter=50 stationaryRadius=50.0 desiredAccuracy=100 interval=10000 fastestInterval=5000 activitiesInterval=10000 isDebugging=true stopOnTerminate=false stopOnStillActivity=false startOnBoot=false startForeground=true locationProvider=2 nTitle=Background tracking nText=enabled nIconLarge= nIconSmall= nIconColor= url= syncUrl= syncThreshold=100 httpHeaders={} maxLocations=10000 postTemplate=null]\r\n05-18 09:47:27.701 31552-32354/be.appfoundry.digitalreceptionist.debug D/com.marianhello.bgloc.BackgroundGeolocationFacade: Starting service\r\n05-18 09:47:27.719 31552-32351/be.appfoundry.digitalreceptionist.debug I/com.marianhello.bgloc.BackgroundGeolocationFacade: Starting bg service\r\n05-18 09:47:27.765 31552-32354/be.appfoundry.digitalreceptionist.debug I/com.marianhello.bgloc.BackgroundGeolocationFacade: Starting bg service\r\n05-18 09:47:27.768 31552-32352/be.appfoundry.digitalreceptionist.debug D/com.marianhello.bgloc.data.sqlite.SQLiteConfigurationDAO: Configuration persisted with rowId = 1\r\n05-18 09:47:27.769 31552-32352/be.appfoundry.digitalreceptionist.debug D/com.marianhello.bgloc.BackgroundGeolocationFacade: Service configured with: Config[distanceFilter=50 stationaryRadius=50.0 desiredAccuracy=100 interval=20000 fastestInterval=5000 activitiesInterval=10000 isDebugging=true stopOnTerminate=false stopOnStillActivity=false startOnBoot=false startForeground=true locationProvider=2 nTitle=Background tracking nText=enabled nIconLarge= nIconSmall= nIconColor= url= syncUrl= syncThreshold=100 httpHeaders={} maxLocations=10000 postTemplate=null]\r\n05-18 09:47:27.832 31552-31552/be.appfoundry.digitalreceptionist.debug I/com.marianhello.bgloc.LocationService: Creating LocationService\r\n05-18 09:47:27.920 31552-31552/be.appfoundry.digitalreceptionist.debug D/com.marianhello.bgloc.BackgroundGeolocationFacade: Binding to service\r\n05-18 09:47:27.921 31552-32357/be.appfoundry.digitalreceptionist.debug I/com.marianhello.bgloc.LocationService: Network condition changed has connectivity: true\r\n05-18 09:47:27.941 31552-31552/be.appfoundry.digitalreceptionist.debug I/com.marianhello.bgloc.LocationService: Received start command startId: 1 intent: Intent { flg=0x4 cmp=be.appfoundry.digitalreceptionist.debug/com.marianhello.bgloc.LocationService (has extras) }\r\n05-18 09:47:28.043 31552-31552/be.appfoundry.digitalreceptionist.debug D/com.marianhello.bgloc.LocationService: Will start service with: Config[distanceFilter=50 stationaryRadius=50.0 desiredAccuracy=100 interval=20000 fastestInterval=5000 activitiesInterval=10000 isDebugging=true stopOnTerminate=false stopOnStillActivity=false startOnBoot=false startForeground=true locationProvider=2 nTitle=Background tracking nText=enabled nIconLarge= nIconSmall= nIconColor= url= syncUrl= syncThreshold=100 httpHeaders={} maxLocations=10000 postTemplate={\"altitude\":\"@altitude\",\"provider\":\"@provider\",\"bearing\":\"@bearing\",\"locationProvider\":\"@locationProvider\",\"latitude\":\"@latitude\",\"accuracy\":\"@accuracy\",\"time\":\"@time\",\"radius\":\"@radius\",\"speed\":\"@speed\",\"longitude\":\"@longitude\"}]\r\n05-18 09:47:28.060 31552-31552/be.appfoundry.digitalreceptionist.debug I/com.marianhello.bgloc.provider.RawLocationProvider: Creating RawLocationProvider\r\n05-18 09:47:28.080 31552-31552/be.appfoundry.digitalreceptionist.debug I/AudioTrack: AUDIO_OUTPUT_FLAG_FAST successful; frameCount 960 -> 960\r\n05-18 09:47:28.080 31552-31552/be.appfoundry.digitalreceptionist.debug D/AudioTrack: Client defaulted notificationFrames to 192 for frameCount 960\r\n05-18 09:47:28.094 31552-31552/be.appfoundry.digitalreceptionist.debug W/Notification: Use of stream types is deprecated for operations other than volume control\r\n05-18 09:47:28.094 31552-31552/be.appfoundry.digitalreceptionist.debug W/Notification: See the documentation of setSound() for what to use instead with android.media.AudioAttributes to qualify your playback use case\r\n05-18 09:47:28.097 31552-31552/be.appfoundry.digitalreceptionist.debug D/com.marianhello.bgloc.BackgroundGeolocationFacade: Binding to service\r\n05-18 09:47:28.119 31552-31552/be.appfoundry.digitalreceptionist.debug I/com.marianhello.bgloc.LocationService: Received start command startId: 2 intent: Intent { flg=0x4 cmp=be.appfoundry.digitalreceptionist.debug/com.marianhello.bgloc.LocationService (has extras) }\r\n05-18 09:47:28.131 31552-31552/be.appfoundry.digitalreceptionist.debug D/com.marianhello.bgloc.provider.RawLocationProvider: Destroying RawLocationProvider\r\n05-18 09:47:28.147 31552-31552/be.appfoundry.digitalreceptionist.debug D/com.marianhello.bgloc.LocationService: Will start service with: Config[distanceFilter=50 stationaryRadius=50.0 desiredAccuracy=100 interval=20000 fastestInterval=5000 activitiesInterval=10000 isDebugging=true stopOnTerminate=false stopOnStillActivity=false startOnBoot=false startForeground=true locationProvider=2 nTitle=Background tracking nText=enabled nIconLarge= nIconSmall= nIconColor= url= syncUrl= syncThreshold=100 httpHeaders={} maxLocations=10000 postTemplate={\"altitude\":\"@altitude\",\"provider\":\"@provider\",\"bearing\":\"@bearing\",\"locationProvider\":\"@locationProvider\",\"latitude\":\"@latitude\",\"accuracy\":\"@accuracy\",\"time\":\"@time\",\"radius\":\"@radius\",\"speed\":\"@speed\",\"longitude\":\"@longitude\"}]\r\n05-18 09:47:28.161 31552-31552/be.appfoundry.digitalreceptionist.debug I/com.marianhello.bgloc.provider.RawLocationProvider: Creating RawLocationProvider\r\n05-18 09:47:28.174 31552-31552/be.appfoundry.digitalreceptionist.debug I/AudioTrack: AUDIO_OUTPUT_FLAG_FAST successful; frameCount 960 -> 960\r\n05-18 09:47:28.174 31552-31552/be.appfoundry.digitalreceptionist.debug D/AudioTrack: Client defaulted notificationFrames to 192 for frameCount 960"},"comment":{"url":"https://api.github.com/repos/mauron85/react-native-background-geolocation/issues/comments/390130968","html_url":"https://github.com/mauron85/react-native-background-geolocation/issues/195#issuecomment-390130968","issue_url":"https://api.github.com/repos/mauron85/react-native-background-geolocation/issues/195","id":390130968,"user":{"login":"mauron85","id":359450,"avatar_url":"https://avatars0.githubusercontent.com/u/359450?v=4","gravatar_id":"","url":"https://api.github.com/users/mauron85","html_url":"https://github.com/mauron85","followers_url":"https://api.github.com/users/mauron85/followers","following_url":"https://api.github.com/users/mauron85/following{/other_user}","gists_url":"https://api.github.com/users/mauron85/gists{/gist_id}","starred_url":"https://api.github.com/users/mauron85/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mauron85/subscriptions","organizations_url":"https://api.github.com/users/mauron85/orgs","repos_url":"https://api.github.com/users/mauron85/repos","events_url":"https://api.github.com/users/mauron85/events{/privacy}","received_events_url":"https://api.github.com/users/mauron85/received_events","type":"User","site_admin":false},"created_at":"2018-05-18T08:13:25Z","updated_at":"2018-05-18T08:13:25Z","author_association":"OWNER","body":" v0.5.0-alpha.1 is too old. Please update your plugin and try to reproduce on latest version."}}
{"actor":{"display_login":"mauron85"}}