2

I am using PushBots to send push notifications to my Android App. Through the payload, I am able to set the largeIcon bitmap and change the title etc however I am unsure on how to change the notification icon (or smallIcon) that appears in the status bar.

At the moment it is just a white square on Android 5.0+ and below that, it uses the launcher icon.

I have imported my transparent icon in Android Studio as a notification which created the "ic_stat_name" drawable for the white icon.

However as I am using pushbots, I don't actually have any notification code that uses the Notification constructor. All I'm doing in my MainActivity is initializing PushBots and sending the Registration ID to my database. Other similar questions all have some sort of Notification code already present within their project.

How should I go about changing the icon from the square to the white icon? Someone with knowledge of PushBots may be able to help out here

Callum Atwal
  • 144
  • 1
  • 11

1 Answers1

3

Import your custom icon with the name "white_notification_icon" in the drawables folder and make sure you're using PushBots v2.0.13 to use a custom small Notification icon. Then Pushbots will automatically use that image as a notification bar icon.

Morten Holmgaard
  • 7,484
  • 8
  • 63
  • 85
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient [reputation](http://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](http://stackoverflow.com/help/privileges/comment). - [From Review](/review/low-quality-posts/11184023) – gio Feb 08 '16 at 09:27
  • I don't know why you guys have marked my answer as irrelevant. I used the same method and it worked. Still I've added another instruction that one must be using PushBots v2.0.13. For official documentation go to- https://pushbots.com/developer/docs/android-changelog – Udbhav Gupta Feb 08 '16 at 19:28
  • This is actually the correct answer. We just have to import an icon with the mentioned name in the drawables folder and Pushbots will automatically use it as a notification bar icon. – Shubham A. Jun 20 '16 at 17:40
  • how to set background color as we all know that only need to update payload and set accColor in to it. But it is not working – Ahmad Arslan Mar 17 '17 at 12:17