{"action":"created","issue":{"url":"https://api.github.com/repos/schchr/cordova-plugin-timers/issues/5","repository_url":"https://api.github.com/repos/schchr/cordova-plugin-timers","labels_url":"https://api.github.com/repos/schchr/cordova-plugin-timers/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/schchr/cordova-plugin-timers/issues/5/comments","events_url":"https://api.github.com/repos/schchr/cordova-plugin-timers/issues/5/events","html_url":"https://github.com/schchr/cordova-plugin-timers/issues/5","id":174741562,"number":5,"title":"timers are paused when in background running on battery (android)","user":{"login":"Mehuge","id":99895,"avatar_url":"https://avatars.githubusercontent.com/u/99895?v=3","gravatar_id":"","url":"https://api.github.com/users/Mehuge","html_url":"https://github.com/Mehuge","followers_url":"https://api.github.com/users/Mehuge/followers","following_url":"https://api.github.com/users/Mehuge/following{/other_user}","gists_url":"https://api.github.com/users/Mehuge/gists{/gist_id}","starred_url":"https://api.github.com/users/Mehuge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mehuge/subscriptions","organizations_url":"https://api.github.com/users/Mehuge/orgs","repos_url":"https://api.github.com/users/Mehuge/repos","events_url":"https://api.github.com/users/Mehuge/events{/privacy}","received_events_url":"https://api.github.com/users/Mehuge/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-02T11:47:15Z","updated_at":"2016-09-05T10:13:57Z","closed_at":null,"body":"Hi.  Thank you for this plugin, though I am running an old version of Cordova for Android so I lifted the code and dropped it into my existing utility plugin, as it was easier.\r\n\r\nHave the timers working, I only needed setTimeout so only implement that, however, I was hoping this plugin would solve the issue of timers not running when the app is in background and running on battery power, but it doesn't seem to.\r\n\r\nThat is, if I set up a keepAlive in my web app, that uses utility.setTimeout (your Android alarm code) and I keep setting a new timeout each time it fires, then it will run for a while in background and then stop.  How long it runs for seems fairly random, sometimes it can run for ages, other times not.\r\n\r\nThis is because the OS has paused the app in background.\r\n\r\nhttps://gist.github.com/Mehuge/dad1d66b2d70ccb5b91e7deb5855f35a\r\n\r\nIs this what other people are seeing?"},"comment":{"url":"https://api.github.com/repos/schchr/cordova-plugin-timers/issues/comments/244711481","html_url":"https://github.com/schchr/cordova-plugin-timers/issues/5#issuecomment-244711481","issue_url":"https://api.github.com/repos/schchr/cordova-plugin-timers/issues/5","id":244711481,"user":{"login":"Mehuge","id":99895,"avatar_url":"https://avatars.githubusercontent.com/u/99895?v=3","gravatar_id":"","url":"https://api.github.com/users/Mehuge","html_url":"https://github.com/Mehuge","followers_url":"https://api.github.com/users/Mehuge/followers","following_url":"https://api.github.com/users/Mehuge/following{/other_user}","gists_url":"https://api.github.com/users/Mehuge/gists{/gist_id}","starred_url":"https://api.github.com/users/Mehuge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mehuge/subscriptions","organizations_url":"https://api.github.com/users/Mehuge/orgs","repos_url":"https://api.github.com/users/Mehuge/repos","events_url":"https://api.github.com/users/Mehuge/events{/privacy}","received_events_url":"https://api.github.com/users/Mehuge/received_events","type":"User","site_admin":false},"created_at":"2016-09-05T10:13:57Z","updated_at":"2016-09-05T10:13:57Z","body":"By background I mean not in foreground, either because the screen is off or because another app is in foreground, regardless of if the phone is in use or not.  \r\n\r\nIt is only an issue when running on battery, and is then at the mercy of the OS pausing it when not in foreground.   I was hoping using the alarm service would avoid the pausing issue but in my tests it does not."}}
{"actor":{"display_login":"Mehuge"}}