Push notifications not working in android

Push notifications are not working for android.

When sending through send bird push tester, it is giving something went wrong.

Hi @Tushar_Mehta,

Welcome to the Sendbird Community. Can you DM me the following information:

  • Application ID
  • FCM Server Key you’re testing
  • User you’re sending test to

Once I’ve got that information from you, I can take a look and try and see what is going on.

Hi @Tushar_Mehta,

Just a heads up, I deleted your post so that your information wasn’t exposed to the public. It looks like you don’t have an active subscription with us, and that is likely why it is not working. The free trial for the application you provided expired back in February of 2021.

Hi Tyler,

I am facing issue with push notifications… when app is in foreground, no push are coming while in background it is working…could you please help me in this?

Hi @Tushar_Mehta,

If you go to Settings → Notifications, and ensure that Send to devices both offline and online is checked:

Yes already this setting is on.

Hi @Tushar_Mehta , Let me ask you some questions :pray:

  1. Are you calling SendBirdPushHelper.registerPushHandler(handler)?
    The important thing is that handler should extend SendBirdPushHandler class.
    Please refer this link
  2. Are you sending android notifications from onMessageReceived?
    You should handle a payload and send notification by yourself from onMessageReceived.
    Please refer this link
    The document says ‘Unlike notification messages, the client app needs to parse and process those data messages in order to display them as local notifications.’