{"action":"created","issue":{"url":"https://api.github.com/repos/geektimecoil/react-native-onesignal/issues/69","repository_url":"https://api.github.com/repos/geektimecoil/react-native-onesignal","labels_url":"https://api.github.com/repos/geektimecoil/react-native-onesignal/issues/69/labels{/name}","comments_url":"https://api.github.com/repos/geektimecoil/react-native-onesignal/issues/69/comments","events_url":"https://api.github.com/repos/geektimecoil/react-native-onesignal/issues/69/events","html_url":"https://github.com/geektimecoil/react-native-onesignal/issues/69","id":170553472,"number":69,"title":"Android: GcmService start Intent only called after first app resume","user":{"login":"seb0zz","id":1436535,"avatar_url":"https://avatars.githubusercontent.com/u/1436535?v=3","gravatar_id":"","url":"https://api.github.com/users/seb0zz","html_url":"https://github.com/seb0zz","followers_url":"https://api.github.com/users/seb0zz/followers","following_url":"https://api.github.com/users/seb0zz/following{/other_user}","gists_url":"https://api.github.com/users/seb0zz/gists{/gist_id}","starred_url":"https://api.github.com/users/seb0zz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seb0zz/subscriptions","organizations_url":"https://api.github.com/users/seb0zz/orgs","repos_url":"https://api.github.com/users/seb0zz/repos","events_url":"https://api.github.com/users/seb0zz/events{/privacy}","received_events_url":"https://api.github.com/users/seb0zz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-11T01:17:33Z","updated_at":"2016-08-11T09:33:07Z","closed_at":null,"body":"Hi,\r\n\r\nmy problem is that the GCM service registration is not done on the initial app start but only after the first app resuming. So I get the following log output only after re-opening the app:\r\n\r\n`D/GCM     (24221): GcmService start Intent { act=com.google.android.c2dm.intent.REGISTER pkg=com.google.android.gms cmp=com.google.android.gms/.gcm.GcmService (has extras) } com.google.android.c2dm.intent.REGISTER`\r\n\r\nThe problem with this is that only after the GCM registration my code is able to process the `notificationOpened` handler without clicking on a push notification. Does anybody have a clue why the GCM registration is not done on the initial app start?\r\n\r\nThis is my manifest:\r\n\r\n```\r\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\r\n    package=\"com.example\"\r\n    android:versionCode=\"1\"\r\n    android:versionName=\"1.0\">\r\n\r\n  <uses-permission android:name=\"android.permission.INTERNET\" />\r\n  <uses-permission android:name=\"android.permission.SYSTEM_ALERT_WINDOW\"/>\r\n  <uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\" />\r\n\r\n  <uses-permission android:name=\"android.permission.CAMERA\" />\r\n  <uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>\r\n  <uses-feature android:name=\"android.hardware.camera\" android:required=\"false\"/>\r\n  <uses-feature android:name=\"android.hardware.camera.autofocus\" android:required=\"false\"/>\r\n\r\n  <permission\r\n    android:name=\"${applicationId}.permission.C2D_MESSAGE\"\r\n    android:protectionLevel=\"signature\" />\r\n  <uses-permission android:name=\"${applicationId}.permission.C2D_MESSAGE\" />\r\n  <uses-permission android:name=\"android.permission.WAKE_LOCK\" />\r\n  <uses-permission android:name=\"android.permission.VIBRATE\" />\r\n  <uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\" />\r\n\r\n  <uses-sdk\r\n        android:minSdkVersion=\"16\"\r\n        android:targetSdkVersion=\"22\" />\r\n\r\n    <application\r\n      android:name=\".MainApplication\"\r\n      android:allowBackup=\"true\"\r\n      android:label=\"@string/app_name\"\r\n      android:icon=\"@mipmap/ic_launcher\"\r\n      android:theme=\"@style/AppTheme\">\r\n\r\n      <!--Auth0 Lock-->\r\n      <activity\r\n        android:name=\"com.auth0.lock.LockActivity\"\r\n        android:theme=\"@style/Lock.Theme\"\r\n        android:screenOrientation=\"portrait\"\r\n        android:launchMode=\"singleTask\">\r\n      </activity>\r\n      <!--Auth0 Lock End-->\r\n      <!--Auth0 Lock Embedded WebView-->\r\n      <activity\r\n        android:name=\"com.auth0.identity.web.WebViewActivity\"\r\n        android:theme=\"@style/Lock.Theme\">\r\n      </activity>\r\n      <!--Auth0 Lock Embedded WebView End-->\r\n      <!--Auth0 Lock Passwordless-->\r\n      <activity\r\n        android:name=\"com.auth0.lock.passwordless.LockPasswordlessActivity\"\r\n        android:theme=\"@style/Lock.Theme\"\r\n        android:screenOrientation=\"portrait\"\r\n        android:launchMode=\"singleTask\">\r\n      </activity>\r\n      <activity\r\n        android:name=\"com.auth0.lock.passwordless.CountryCodeActivity\"\r\n        android:theme=\"@style/Lock.Theme\">\r\n      </activity>\r\n      <!--Auth0 Lock Passwordless End-->\r\n\r\n      <activity\r\n        android:name=\".MainActivity\"\r\n        android:label=\"@string/app_name\"\r\n        android:screenOrientation=\"portrait\"\r\n        \r\n        android:configChanges=\"keyboard|keyboardHidden|orientation|screenSize\">\r\n        <intent-filter>\r\n            <action android:name=\"android.intent.action.MAIN\" />\r\n            <category android:name=\"android.intent.category.LAUNCHER\" />\r\n        </intent-filter>\r\n      </activity>\r\n\r\n      <activity android:name=\"com.facebook.react.devsupport.DevSettingsActivity\" />\r\n\r\n      <receiver\r\n        android:name=\"com.google.android.gms.gcm.GcmReceiver\"\r\n        android:permission=\"com.google.android.c2dm.permission.SEND\" >\r\n        <intent-filter>\r\n          <action android:name=\"com.google.android.c2dm.intent.RECEIVE\" />\r\n          <action android:name=\"com.google.android.c2dm.intent.REGISTRATION\" />\r\n          <category android:name=\"${applicationId}\" />\r\n        </intent-filter>\r\n      </receiver>\r\n\r\n    </application>\r\n\r\n</manifest>\r\n```\r\n\r\nCheers"},"comment":{"url":"https://api.github.com/repos/geektimecoil/react-native-onesignal/issues/comments/239114097","html_url":"https://github.com/geektimecoil/react-native-onesignal/issues/69#issuecomment-239114097","issue_url":"https://api.github.com/repos/geektimecoil/react-native-onesignal/issues/69","id":239114097,"user":{"login":"seb0zz","id":1436535,"avatar_url":"https://avatars.githubusercontent.com/u/1436535?v=3","gravatar_id":"","url":"https://api.github.com/users/seb0zz","html_url":"https://github.com/seb0zz","followers_url":"https://api.github.com/users/seb0zz/followers","following_url":"https://api.github.com/users/seb0zz/following{/other_user}","gists_url":"https://api.github.com/users/seb0zz/gists{/gist_id}","starred_url":"https://api.github.com/users/seb0zz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seb0zz/subscriptions","organizations_url":"https://api.github.com/users/seb0zz/orgs","repos_url":"https://api.github.com/users/seb0zz/repos","events_url":"https://api.github.com/users/seb0zz/events{/privacy}","received_events_url":"https://api.github.com/users/seb0zz/received_events","type":"User","site_admin":false},"created_at":"2016-08-11T09:33:06Z","updated_at":"2016-08-11T09:33:06Z","body":"Well spent some more time in debugging. It seems that `enableNotificationsWhenActive` does not work. It does actually toggle notifications in the notification center but `onNotificationOpened` is never called."}}
{"actor":{"display_login":"seb0zz"}}