Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

[Android][3521] Notification Icon wrong while App is open
Started by martin.schreiber9 Sep 23 2019 02:17 AM

3 replies to this topic
android notifications
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

martin.schreiber9

[GLOBAL: userInfoPane.html]
martin.schreiber9
  • Observer

  • 17 posts
  • Corona SDK

During the 64bit Testing we changed our noptification icons. They are now in the AndroidResources/res folder and are used by adding 

applicationChildElements =
	{
		  [[<meta-data android:name="com.google.firebase.messaging.default_notification_icon"
		   android:resource="@drawable/notification_icon"/>]]
	},
}		

to our build.settings file.

 

That works, whenever the app is closed or in the background. However, sometimes you receive a notification, while you have the app open. In this case, instead of the notification icon we selected, a "Warning Sign" (I added a screenshot) is displayed.

 

We're using Corona 2019.3521 right now.

Attached Files



[TOPIC: post.html]
#2

vlads

[GLOBAL: userInfoPane.html]
vlads
  • Contributor

  • 972 posts
  • Corona Staff

There are several ways to deal with this issue:

1. legacy way: add IconNotificationDefault-["ldpi", "mdpi", "hdpi", "xhdpi", "xxhdpi", "xxxhdpi"].png to your root directory.

2. Add res/drawable*/corona_statusbar_icon_default.png

This will replace the exclamation shipped by default.



[TOPIC: post.html]
#3

martin.schreiber9

[GLOBAL: userInfoPane.html]
martin.schreiber9
  • Observer

  • 17 posts
  • Corona SDK

Thank you. I will try as soon as possible.



[TOPIC: post.html]
#4

martin.schreiber9

[GLOBAL: userInfoPane.html]
martin.schreiber9
  • Observer

  • 17 posts
  • Corona SDK

Sorry this took longer to test.

 

Replacing the corona_statusbar_icon_default.png icon works. Now the right icon is displayed, but it has the wrong background color. To explain, when sending the notification from a backend server, i can choose the background color. It is blue in our case. For the normal notifications it has the blue background, but while the app is open the background is light grey, as it was for the "Warning sign".

 

It's not really a priority, but it would be nice, if that color was used, if it is specified.




[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: android, notifications