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.
public boolean onMessage( Context context, Intent intent )
return false;

Hi Roei,

Have you also declared MyPushReceiver class and registered it in AndroidManifest.xml? It’s described here in the doc:

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.

Glad it helped :slight_smile: