{"action":"created","issue":{"url":"https://api.github.com/repos/koga73/cordova-gimbal-bridge/issues/1","repository_url":"https://api.github.com/repos/koga73/cordova-gimbal-bridge","labels_url":"https://api.github.com/repos/koga73/cordova-gimbal-bridge/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/koga73/cordova-gimbal-bridge/issues/1/comments","events_url":"https://api.github.com/repos/koga73/cordova-gimbal-bridge/issues/1/events","html_url":"https://github.com/koga73/cordova-gimbal-bridge/pull/1","id":181524520,"number":1,"title":"Refactor Android Gimbal bridge","user":{"login":"rlepinski","id":3967591,"avatar_url":"https://avatars.githubusercontent.com/u/3967591?v=3","gravatar_id":"","url":"https://api.github.com/users/rlepinski","html_url":"https://github.com/rlepinski","followers_url":"https://api.github.com/users/rlepinski/followers","following_url":"https://api.github.com/users/rlepinski/following{/other_user}","gists_url":"https://api.github.com/users/rlepinski/gists{/gist_id}","starred_url":"https://api.github.com/users/rlepinski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rlepinski/subscriptions","organizations_url":"https://api.github.com/users/rlepinski/orgs","repos_url":"https://api.github.com/users/rlepinski/repos","events_url":"https://api.github.com/users/rlepinski/events{/privacy}","received_events_url":"https://api.github.com/users/rlepinski/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-06T21:01:18Z","updated_at":"2016-10-06T23:43:42Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/koga73/cordova-gimbal-bridge/pulls/1","html_url":"https://github.com/koga73/cordova-gimbal-bridge/pull/1","diff_url":"https://github.com/koga73/cordova-gimbal-bridge/pull/1.diff","patch_url":"https://github.com/koga73/cordova-gimbal-bridge/pull/1.patch"},"body":"This is a pretty big refactor of the Android support.\r\n\r\nGimbal's service already already runs as a persistent service in the background and will auto start when the phone boots, however this does not retain the listener. I assume you added a service because you needed a place to set up the listener to forward events to Urban Airship. I was able to simplify that process by extending the base urbanairship cordova plugin to broadcast when airship is ready (will be called anytime the app starts) - https://github.com/urbanairship/phonegap-ua-push/pull/145. Now, the plugin only has to worry about calling start/stop on the adapter.\r\n\r\nI am in the process of testing it to make sure it works the way we expect."},"comment":{"url":"https://api.github.com/repos/koga73/cordova-gimbal-bridge/issues/comments/252118669","html_url":"https://github.com/koga73/cordova-gimbal-bridge/pull/1#issuecomment-252118669","issue_url":"https://api.github.com/repos/koga73/cordova-gimbal-bridge/issues/1","id":252118669,"user":{"login":"koga73","id":1231138,"avatar_url":"https://avatars.githubusercontent.com/u/1231138?v=3","gravatar_id":"","url":"https://api.github.com/users/koga73","html_url":"https://github.com/koga73","followers_url":"https://api.github.com/users/koga73/followers","following_url":"https://api.github.com/users/koga73/following{/other_user}","gists_url":"https://api.github.com/users/koga73/gists{/gist_id}","starred_url":"https://api.github.com/users/koga73/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koga73/subscriptions","organizations_url":"https://api.github.com/users/koga73/orgs","repos_url":"https://api.github.com/users/koga73/repos","events_url":"https://api.github.com/users/koga73/events{/privacy}","received_events_url":"https://api.github.com/users/koga73/received_events","type":"User","site_admin":false},"created_at":"2016-10-06T23:43:42Z","updated_at":"2016-10-06T23:43:42Z","body":"Do the visit events fire when the app is closed?\r\n\r\nWe have four test cases for visit events firing and push notifications:\r\n1. App is open in foreground\r\n2. App is open in background\r\n3. App is closed via Recents from hardware button\r\n4. Device is restarted\r\n\r\nFrom our testing we started by just trying to call setApiKey and start / stop adapter from GimbalPlugin.java, however as soon as the app was put in the background the code was suspended and none of the visit events would fire. We dug through the sample application bundled with the Gimbal SDK and implemented the service in order to capture visit events in the background. After doing so test cases 1 and 2 worked but 3 still did not. Even in the Gimbal sample application visit events don't fire once the app is closed via Recents. We were able to fix the sample app by moving Gimbal.start() into onCommandStart in the sample AppService.\r\n\r\nIn regards to permissions we were testing on Android 23 but tried dropping the targetSdk to Android 22 so we would already have location access. In this scenario test case 3 failed and only seemed to work if the user explicitly allowed permission after the service was running and setApiKey had been called.\r\n\r\nSome food for thought"}}
{"actor":{"display_login":"koga73"}}