Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ private void handleRemotePushNotification(ReactApplicationContext context, Bundl
jsDelivery.notifyRemoteFetch(bundle);
}

if (config.getNotificationForeground() || !isForeground) {
if (config.getNotificationForeground() && !isForeground) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition doesn't make sense:
If "Allow notifications in foreground" and "Not in foreground":
Then Trigger the notification.

you probably missed a configuration on the AndroidManifest or in your app configuration...

Copy link
Contributor Author

@Dimon70007 Dimon70007 Nov 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With those changes showing local notifications works as expected (without duplication)
I use this repo in combine with react-native-firebase v6 messaging (for showing local notifications only)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not saying this change is not working for you, I'm saying that this change doesn't have sense (see the comment above).
If you experience duplicate notifications, this means there is a configuration issue in your project.

Copy link
Contributor Author

@Dimon70007 Dimon70007 Nov 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE: localNotification() works without changes in the application part

this is from readme, i use local notifications only with this library.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

anyway, thank you for great library

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  <!-- Change the value to true to enable pop-up for in foreground (remote-only, for local use ignoreInForeground) -->
        <meta-data  android:name="com.dieam.reactnativepushnotification.notification_foreground"
                    android:value="false"/>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, i've created a new PR about readme updating - #1762

Log.v(LOG_TAG, "sendNotification: " + bundle);

pushNotificationHelper.sendToNotificationCentre(bundle);
Expand Down