Skip to content

Commit 4350ab4

Browse files
authored
Issue wix#525, changed the conditions for InvalidNotificationException
To fix issue wix#525 (wix#525), I did 2 changes below. ``` @OverRide public void onReceived() throws InvalidNotificationException { // 1. removed the following if/else statement // if (!mAppLifecycleFacade.isAppVisible()) { // postNotification(null); // notifyReceivedBackgroundToJS(); // } else { // notifyReceivedToJS(); // } // 2. added the following 2 statements, instead of the if/else statement above postNotification(null); notifyReceivedToJS(); } ```
1 parent 885f053 commit 4350ab4

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

lib/android/app/src/main/java/com/wix/reactnativenotifications/core/notification/PushNotification.java

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,18 @@ protected PushNotification(Context context, Bundle bundle, AppLifecycleFacade ap
6363

6464
@Override
6565
public void onReceived() throws InvalidNotificationException {
66-
if (!mAppLifecycleFacade.isAppVisible()) {
67-
postNotification(null);
68-
notifyReceivedBackgroundToJS();
69-
} else {
70-
notifyReceivedToJS();
71-
}
66+
// To fix issue #525 (https://github.com/wix/react-native-notifications/issues/525), I did 2 changes below
67+
// 1. removed the following if/else statement
68+
// if (!mAppLifecycleFacade.isAppVisible()) {
69+
// postNotification(null);
70+
// notifyReceivedBackgroundToJS();
71+
// } else {
72+
// notifyReceivedToJS();
73+
// }
74+
75+
// 2. added the following 2 statements, instead of the if/else statement above
76+
postNotification(null);
77+
notifyReceivedToJS();
7278
}
7379

7480
@Override

0 commit comments

Comments
 (0)