React-native-push-notification: Push notification showed on foreground (Android only)

Created on 17 Oct 2019  路  1Comment  路  Source: zo0r/react-native-push-notification

Hi,
I read the docs but cannot figure out how to resolve this issue:
My problems:

  • On some android 5: OS notification was showed on foreground, we expect it would not show up like iOS did when app's in foreground. See the screenshot below:
    73539231_463656764358653_8044739397725192192_n

  • On some Android 5.0.2: OS notification was not showed on foreground, but there was a unread notification appear in notification center.

  • On iOS and Android 9: Everything is ok: When app is on foreground - no notification banner or unread notification show up.

Most helpful comment

I need to customize the source code of the library to get it works:

class RNPushNotificationHelper {
...
 public void sendToNotificationCentre(Bundle bundle) {
        try {
            // Luatnd:
            // In case of foreground: msg was handled by app and this fn was run
            // In case of background: msg was handled by GooglePlayService and this fn was not reached.
            Boolean isForeground = bundle.getBoolean("foreground");
            if (isForeground) return;
            // end luatnd
....
}

>All comments

I need to customize the source code of the library to get it works:

class RNPushNotificationHelper {
...
 public void sendToNotificationCentre(Bundle bundle) {
        try {
            // Luatnd:
            // In case of foreground: msg was handled by app and this fn was run
            // In case of background: msg was handled by GooglePlayService and this fn was not reached.
            Boolean isForeground = bundle.getBoolean("foreground");
            if (isForeground) return;
            // end luatnd
....
}
Was this page helpful?
0 / 5 - 0 ratings

Related issues

Benzer1406 picture Benzer1406  路  3Comments

sungjinoh picture sungjinoh  路  3Comments

nidzovito picture nidzovito  路  3Comments

selimonline picture selimonline  路  3Comments

edwinharly picture edwinharly  路  3Comments