Backendless Support
 
Solved

How to prevent push notifications from being shown when App is in foreground

I do know to identify the App state, but when i return false from MyPushService (see code below), it still shows the notification in Android notification center.

@Override

public boolean onMessage( Context context, Intent intent )

{

return false;

}

Leave a Comment

Comments (3)

photo
1

Hi Roei,

Have you also declared MyPushReceiver class and registered it in AndroidManifest.xml? It's described here in the doc: https://github.com/Backendless/Android-SDK/blob/master/docs/push.md

photo
1

Hey Sergey, I have declared and implemented the MyPushReceiver class. The problem was declaring the BackendlessPushReceiver too, according to the documentation.

Thanks for your quick reply.

Roei

photo
1

Glad it helped :)

photo