{"action":"created","issue":{"url":"https://api.github.com/repos/firebase/quickstart-android/issues/612","repository_url":"https://api.github.com/repos/firebase/quickstart-android","labels_url":"https://api.github.com/repos/firebase/quickstart-android/issues/612/labels{/name}","comments_url":"https://api.github.com/repos/firebase/quickstart-android/issues/612/comments","events_url":"https://api.github.com/repos/firebase/quickstart-android/issues/612/events","html_url":"https://github.com/firebase/quickstart-android/issues/612","id":355097287,"node_id":"MDU6SXNzdWUzNTUwOTcyODc=","number":612,"title":"App (killed) starts automagically after receiving notification ","user":{"login":"hare989","id":19308038,"node_id":"MDQ6VXNlcjE5MzA4MDM4","avatar_url":"https://avatars3.githubusercontent.com/u/19308038?v=4","gravatar_id":"","url":"https://api.github.com/users/hare989","html_url":"https://github.com/hare989","followers_url":"https://api.github.com/users/hare989/followers","following_url":"https://api.github.com/users/hare989/following{/other_user}","gists_url":"https://api.github.com/users/hare989/gists{/gist_id}","starred_url":"https://api.github.com/users/hare989/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hare989/subscriptions","organizations_url":"https://api.github.com/users/hare989/orgs","repos_url":"https://api.github.com/users/hare989/repos","events_url":"https://api.github.com/users/hare989/events{/privacy}","received_events_url":"https://api.github.com/users/hare989/received_events","type":"User","site_admin":false},"labels":[{"id":817640958,"node_id":"MDU6TGFiZWw4MTc2NDA5NTg=","url":"https://api.github.com/repos/firebase/quickstart-android/labels/messaging","name":"messaging","color":"e85733","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-29T10:29:43Z","updated_at":"2018-09-13T21:09:08Z","closed_at":"2018-09-13T21:09:08Z","author_association":"NONE","body":"### Step 2: Describe your environment\r\n\r\n  * Android device: Emulators, Huawei P9 Lite, Samsung Galaxy Tab 3 \r\n  * Android OS version: 4.4.4, 5.1, 6.0, 7.0\r\n  * Google Play Services version: com.google.gms:google-services:4.1.0\r\n    (Also found in play-services-basement-15.0.1.aar in values.xml:\r\n     <integer name=\"google_play_services_version\">12451000</integer>)\r\n  * Firebase/Play Services SDK version: \r\n       - com.google.android.gms:play-services-ads:15.0.1\r\n       - com.google.android.gms:play-services-analytics:16.0.3\r\n       - com.google.firebase:firebase-core:16.0.3\r\n       - com.google.firebase:firebase-messaging:17.3.0\r\n  \r\n### Step 3: Describe the problem:\r\n\r\nAfter I figured out how to receive notification when my app is killed I faced with other thing: now when I receive notification when app is killed, notification is showed in status bar but immediately after that application starts automagically without launcher activity ever created and without intent data from notification data payload. It starts Application subclass where I create login activity. Also, if I swipe app from recent apps, notification will stay in status bar and and after clearing all notifications app starts automagically again. This happens no matter if notification is sent via console or with cURL.\r\n\r\n#### Steps to reproduce:\r\n\r\n  1. App killed\r\n  2. Send notification to single device with or without data payload from Firebase console or using cURL\r\n  \r\n#### Observed Results:\r\n\r\n  App starts automagically with Application singleton subclass onCreate method; Launcher activity \r\n  defined in AndroidManifest.xml was never created. Cannot obtain intent with data from notification.\r\n  \r\n#### Expected Results:\r\n\r\n  Push notification icon is showed in status bar.\r\n  App doesn't start without user interaction.\r\n  \r\n#### Relevant Code:\r\n\r\nAndroidManifest.xml\r\n  ```\r\n <service android:name=.MyFirebaseMessagingService\">\r\n            <intent-filter>\r\n                <action android:name=\"com.google.firebase.MESSAGING_EVENT\" />\r\n            </intent-filter>\r\n        </service>\r\n.\r\n.\r\n.\r\n\r\n<meta-data\r\n            android:name=\"com.google.android.gms.version\"\r\n            android:value=\"@integer/google_play_services_version\" />\r\n  ```\r\n\r\n**onMessageReceived** in MyFirebaseMessagingService.java is never called because app is killed.\r\n"},"comment":{"url":"https://api.github.com/repos/firebase/quickstart-android/issues/comments/421154059","html_url":"https://github.com/firebase/quickstart-android/issues/612#issuecomment-421154059","issue_url":"https://api.github.com/repos/firebase/quickstart-android/issues/612","id":421154059,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMTE1NDA1OQ==","user":{"login":"samtstern","id":8466666,"node_id":"MDQ6VXNlcjg0NjY2NjY=","avatar_url":"https://avatars2.githubusercontent.com/u/8466666?v=4","gravatar_id":"","url":"https://api.github.com/users/samtstern","html_url":"https://github.com/samtstern","followers_url":"https://api.github.com/users/samtstern/followers","following_url":"https://api.github.com/users/samtstern/following{/other_user}","gists_url":"https://api.github.com/users/samtstern/gists{/gist_id}","starred_url":"https://api.github.com/users/samtstern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samtstern/subscriptions","organizations_url":"https://api.github.com/users/samtstern/orgs","repos_url":"https://api.github.com/users/samtstern/repos","events_url":"https://api.github.com/users/samtstern/events{/privacy}","received_events_url":"https://api.github.com/users/samtstern/received_events","type":"User","site_admin":false},"created_at":"2018-09-13T21:09:08Z","updated_at":"2018-09-13T21:09:08Z","author_association":"MEMBER","body":"> It starts Application subclass where I create login activity\r\n\r\nThis sounds like the issue to me.  No part of your app can run without the `Application` being initialized.  If your `Application` class is launching an activity, that will happen at some pretty random times!\r\n\r\nI suggest removing that logic from your `Application` class, this doesn't sound like a bug with FCM."}}
{"actor":{"display_login":"samtstern"}}