My android notification icon is a white square... help

Hi All,

I am using Raix:Push to send notifications to my android app. The only problem is that I am getting a white square as notification Icon. I read we have to use a white notification with a transparent background added to the following path while building the app.

cordova-build-override/platforms/android/res/drawable/pushicon.png

I have done this but nothing seems to have changed. I still get a white square. I have also added the name of the icon to the client startup file under Push.Configure

Anyone experienced this before, any ideas?

I’m having the same problem here at the moment… I guess it might have to do something with the target SDK version or whatsitcalled. I don’t know exactly what is going on here, but I suspect if I’d target an older version we might be in luck.

But this is just a guess, based on other information on the internet, eg: https://forums.xamarin.com/discussion/comment/362983/#Comment_362983

If somebody knows more about this it’d be greatly appreciated.

@adim86 @DanielDornhardt I’m experiencing a similar issue at the moment. On versions previous to Android 8, it seems to work, though I believe it is using one of the app icons I have defined in the mobile-config.js. On Android 8 I’m getting a white box instead of my icon. Were either of your able to resolve your issues?

I found a solution finally by following these steps:

  1. Generate Icons with Google’s icon generator. You must include all the files unzipped in the res folder. (Android decides which to display.) Generate Icons

  2. Create cordova-build-override in root of project. The contents of this directory must perfectly match the path spec within your .meteor/local/cordova-build. In my case it was cordova-build-override/platforms/android/app/src/main/res/drawable-xxx

  3. The res directory created by unzipping the generated icons should be the res directory in this path spec with all the drawable folders.

  4. Include the exact name of your generated icon without a file type in your Push.Configure android.json, just its name. It should have ic_stat in it e.g. ic_stat_icon_logo Android will intelligently use the drawable folders to decide the best resolution to display.

This sucked to figure out as raix:push documentation is out of date if you’re using a more recent version of Meteor. Hope this helps someone!!

3 Likes

Wanted to say thanks. This worked a treat.

Previous to this, I had put google-services.json into cordova-build-override/platforms/android/app which also works, and may help someone trying to find where to put this.

2 Likes

I love you bro. Thank you

Now in SDK 31 my app crashes, if no valid ic_stat icon is provided, this really saved me :wink: Thanks!