{"action":"created","issue":{"url":"https://api.github.com/repos/mauron85/cordova-plugin-background-geolocation/issues/85","repository_url":"https://api.github.com/repos/mauron85/cordova-plugin-background-geolocation","labels_url":"https://api.github.com/repos/mauron85/cordova-plugin-background-geolocation/issues/85/labels{/name}","comments_url":"https://api.github.com/repos/mauron85/cordova-plugin-background-geolocation/issues/85/comments","events_url":"https://api.github.com/repos/mauron85/cordova-plugin-background-geolocation/issues/85/events","html_url":"https://github.com/mauron85/cordova-plugin-background-geolocation/issues/85","id":158488419,"number":85,"title":"How to prevent multiple instance on Android","user":{"login":"coyu1314","id":6372043,"avatar_url":"https://avatars.githubusercontent.com/u/6372043?v=3","gravatar_id":"","url":"https://api.github.com/users/coyu1314","html_url":"https://github.com/coyu1314","followers_url":"https://api.github.com/users/coyu1314/followers","following_url":"https://api.github.com/users/coyu1314/following{/other_user}","gists_url":"https://api.github.com/users/coyu1314/gists{/gist_id}","starred_url":"https://api.github.com/users/coyu1314/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coyu1314/subscriptions","organizations_url":"https://api.github.com/users/coyu1314/orgs","repos_url":"https://api.github.com/users/coyu1314/repos","events_url":"https://api.github.com/users/coyu1314/events{/privacy}","received_events_url":"https://api.github.com/users/coyu1314/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-06-04T05:25:44Z","updated_at":"2016-06-04T07:42:11Z","closed_at":null,"body":"I noticed that every time when I launch the app from main menu(without killing the app. NOT open it from the background). It will create a new instance of the location service. which means if I keep opening it 10 times, I would have 10 instances of it. and it will send 10 requests of the same location to the server for every location change. Is there a way to prevent it from creating a new instance when the app is relaunched from the menu?\r\n\r\nStep to reproduce\r\n1. open the app from menu\r\n2. press home button (don't kill the app, just put it in background)\r\n3. reopen the app from menu \r\n4. repeat step 2 and 3 a few times.\r\n5. Now, if you check the server records, you will see that for every location change, you will get the multiple requests of the same location(depends on how many time you reopen the app). this will eat up lots of server resource if you have significant amount of user updating the location. \r\n\r\nDevice: oneplus 2. os 5.1.1"},"comment":{"url":"https://api.github.com/repos/mauron85/cordova-plugin-background-geolocation/issues/comments/223742234","html_url":"https://github.com/mauron85/cordova-plugin-background-geolocation/issues/85#issuecomment-223742234","issue_url":"https://api.github.com/repos/mauron85/cordova-plugin-background-geolocation/issues/85","id":223742234,"user":{"login":"mauron85","id":359450,"avatar_url":"https://avatars.githubusercontent.com/u/359450?v=3","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":"2016-06-04T07:42:11Z","updated_at":"2016-06-04T07:42:11Z","body":"I will try to replicate this. Anyway in next version, service code is improved that it should not happened. Try next branch.\r\n```\r\ncordova plugin add cordova-plugin-mauron85-background-geolocation\r\n```"}}
{"actor":{"display_login":"mauron85"}}