{"action":"opened","issue":{"url":"https://api.github.com/repos/invertase/react-native-firebase/issues/994","repository_url":"https://api.github.com/repos/invertase/react-native-firebase","labels_url":"https://api.github.com/repos/invertase/react-native-firebase/issues/994/labels{/name}","comments_url":"https://api.github.com/repos/invertase/react-native-firebase/issues/994/comments","events_url":"https://api.github.com/repos/invertase/react-native-firebase/issues/994/events","html_url":"https://github.com/invertase/react-native-firebase/issues/994","id":315290744,"number":994,"title":"[Push Notification] push icon change to a different icon when it is in background and foreground","user":{"login":"rogBordignon","id":6150736,"avatar_url":"https://avatars1.githubusercontent.com/u/6150736?v=4","gravatar_id":"","url":"https://api.github.com/users/rogBordignon","html_url":"https://github.com/rogBordignon","followers_url":"https://api.github.com/users/rogBordignon/followers","following_url":"https://api.github.com/users/rogBordignon/following{/other_user}","gists_url":"https://api.github.com/users/rogBordignon/gists{/gist_id}","starred_url":"https://api.github.com/users/rogBordignon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rogBordignon/subscriptions","organizations_url":"https://api.github.com/users/rogBordignon/orgs","repos_url":"https://api.github.com/users/rogBordignon/repos","events_url":"https://api.github.com/users/rogBordignon/events{/privacy}","received_events_url":"https://api.github.com/users/rogBordignon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-18T00:50:19Z","updated_at":"2018-04-18T00:50:19Z","closed_at":null,"author_association":"NONE","body":"### Issue\r\n\r\nThe problem seems to happen when a send a remote notification from firebase to my application.\r\nWhen my app is in foreground, the notification icon is the correct one (\"û\") but when it is in background or when my app is closed, the notification icon is the default one (\"the Robot\").\r\n\r\nI have some screenshot to demonstrate: \r\nThe first one is the notification when my app was running in foreground with the correct icon:\r\n![whatsapp image 2018-04-17 at 8 06 56 pm](https://user-images.githubusercontent.com/6150736/38905069-29ddcfb2-427c-11e8-9905-1d065f967077.jpeg)\r\nThe second is the same but when my app was running in background and with the default icon:\r\n![whatsapp image 2018-04-17 at 8 05 40 pm](https://user-images.githubusercontent.com/6150736/38905065-279dbf00-427c-11e8-99ec-25f3cae0f335.jpeg)\r\nThe third is just to show that I've sent the exactly same notification but the icon are not the same:\r\n![whatsapp image 2018-04-17 at 8 07 30 pm](https://user-images.githubusercontent.com/6150736/38905070-2b89f12e-427c-11e8-9142-3ff83e43bbaa.jpeg)\r\n\r\nMy source code:\r\n```\r\n     .\r\n     .\r\n     .\r\n\r\nconst channel = new firebase.notifications.Android.Channel('channelId', 'new-sales', firebase.notifications.Android.Importance.High)\r\n   .setDescription('new sales avaiable')\r\n   .enableVibration(true)\r\n   .setLockScreenVisibility(firebase.notifications.Android.Visibility.Public)\r\n\r\n   // Create the channel\r\nfirebase.notifications().android.createChannel(channel);\r\n\r\nvar realNotification = new firebase.notifications.Notification()\r\n\r\nfirebase.messaging().hasPermission().then(enabled => {\r\n\tif (enabled) {\r\n\t\tthis.notificationDisplayedListener = firebase.notifications().onNotificationDisplayed((notification : Notification) => {\r\n\t\t\trealNotification = new firebase.notifications.Notification()\r\n            .setNotificationId(\"032\")\r\n            .setTitle(notification.title)\r\n            .setBody(notification.body).android\r\n            .setChannelId('channelId')\r\n            .android.setSmallIcon('icon')\r\n\t\t\tfirebase.notifications().displayNotification(realNotification)\r\n\t\t});\r\n\t\tthis.notificationListener = firebase.notifications().onNotification((notification : Notification) => {\r\n\t\t\trealNotification = new firebase.notifications.Notification()\r\n            .setNotificationId(\"033\")\r\n            .setTitle(notification.title)\r\n            .setBody(notification.body)\r\n            .android.setChannelId('channelId')\r\n            .android.setSmallIcon('icon')\r\n\t\t\tfirebase.notifications().displayNotification(realNotification)\r\n\t\t});\r\n\t} \r\n     .\r\n     .\r\n     .\r\n\r\n```\r\n\r\nP.S. Sorry for my bad english, this is my first post here. \r\n\r\n### Environment\r\n\r\n1. Application Target Platform:\r\nAndroid\r\n\r\n2. Development Operating System:\r\nmacOS High Sierra\r\n\r\n3. Build Tools:\r\nAndroid studio\r\n\r\n4. React Native version:\r\n0.54.2\r\n\r\n5. RNFirebase Version:\r\n4.0.3\r\n\r\n6. Firebase Module:\r\nNotifications"}}
{"actor":{"display_login":"rogBordignon"}}