hansemannn/titanium-firebase-cloud-messaging

Notification icon shown in notification message, but not in data message

danny005 opened this issue · 8 comments

I think this issue isn't resolved:

#67

Sending notification message works fine. But in a data mesage, the default notification icon is not shown. And yes, I have updated the tiapp.xml as suggested, otherwise the notification message wouldn't display the icon.

m1ga commented

I'll test it again at the weekend. Do you have a sample project (without the firebase JSON) which doesn't work for you so I can run that?

I have tested it in a very large project, so no sample project available, sorry. But can provide a sample project with Ti Classic if required.

m1ga commented

that would be very helpful so I check the icons and places

m1ga commented

With a data notification I'll get the app/platform/android/res/drawable/notificationicon.png icon
Screenshot_20190428-182600
appicon is a 2, notificationicon is a 1 (as shown in the status bar) without any changes in tiapp.xml.

Hmm, should it be notification_icon.png or notificationicon.png (without underscore)? Can you upload it as demo project to Github? Will give it a try.

m1ga commented

depends: https://github.com/hansemannn/titanium-firebase-cloud-messaging#setting-the-notification-icon

without any changes to the tiapp.xml you have to use the "without underscore" variant. If you set a custom icon you just name it like you want to e.g. @drawable/notificationicon or @drawable/notification_icon and the png file according to it.
Without the tiapp.xml line you will get the default icon for notification messages. A data message uses the notificationicon.png

m1ga commented

test_fcm.zip
I hope this still works 😄 I've copied the code parts to new clean project and hope everything is included besides the google-services.json (place that in the assets/android folder)

m1ga commented

Closing this for now. If it is still an issue please open a new ticket