No Icon or Title in Android Notification

I have a standalone app both on iOS and Android. For the iOS app, the notification shows up with the notification icon I specify in exp.json (notification.icon) and with the right title.

When I send the same exact HTTP request to the Expo push service for an Android device (i.e. change the to field to an Android device), I get a notification whose title is my app name, not the specified title, and icon is a tinted square-in-circle icon, not the icon I specify in exp.json. This is on Android 6.0.

How can I get that icon and title in there for Android?

Thanks!

Any chance I could get a quick brain dump from someone at Expo on how push notifications work for Android / why they think this might not be working?

Some of this does seem to be expected (?) behavior given that notification.color is an option in exp.json — but why can’t Android remote notifications use notification.icon instead and why do they ignore the title?

Thanks,
Will

Hey @wfisher. I’ll test this out before we do the next Android release next week. Will make sure it’s fixed in that release if I can’t get it working.

2 Likes

I did config icon in app.json but Android displays just as an empty rectangle:

"notification": {
      "icon": "./assets/images/notif-icon.png"
    }

Anyone, please help!

@jesse My issue looks ike this a bit. On Android, I get my title, but with MY_APP_NAME - before it. What if I don’t want the app name in front?

@trungtrungkang I have the same problem. Did u solve this?

@trungtrungkang @gugamm Do you guys have transparent backgrounds with a white icon 48x48? I had the same issue until I made another icon with only white and transparent.

After look in the android documentation, this solved my problem

Can you please, share the documentation link?

Hey arivest, did you figure out how to remove MY_APP_NAME?

I only have this problem when I’m using my app in Expo. For standalone app, I can put the title I want. So this is not an issue for me.

I followed this instructions and made the icon 48x48px with only with and transparent pixels, but still get just a white square in as a notification icon.

Using a standalone build. The title works fine though.

Android docs: Material Design

I am also having this problem. I set an icon that is 96x96, it is mix of colors. During expo app the notification icon shows, but in production, its not working right.

Is there any solution?

If you are using Google Cloud Messaging, then this issue will not be solved by simply changing your icon. For example, this will not work:

 Notification notification  = new Notification.Builder(this)
                .setContentTitle(title)
                .setContentText(text)
                .setSmallIcon(R.drawable.ic_notification)
                .setContentIntent(pIntent)
                .setDefaults(Notification.DEFAULT_SOUND|Notification.DEFAULT_LIGHTS|Notification.DEFAULT_VIBRATE)
                .setAutoCancel(true)
                .build();