Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Notification not work in foreground #175

Open
1 task
LimanASL opened this issue Sep 24, 2020 · 3 comments
Open
1 task

Android Notification not work in foreground #175

LimanASL opened this issue Sep 24, 2020 · 3 comments

Comments

@LimanASL
Copy link

Report

Environment

  • Platforms:
  • Android version:
  • iOS version:

Issues and Steps to Reproduce

Replaces this with steps to repro your issue, if applicable.

Expected Behavior

Describe what you expected would happen.

Actual Behavior

Describe what actually happened. Include screenshots, if applicable.

Link to Code

If you have some code that maintainers can clone/test for themselves, bugs can be resolved much faster. Please paste a link here.

@nithinyell
Copy link

+1

@LimanASL
Copy link
Author

LimanASL commented Sep 25, 2020

https://rnfirebase.io/messaging/notifications

Regarding to the document from 'react-native-firebase', if the application is in the foreground, an event will be delivered containing the notification data and no visible notification will be displayed.

In order to display the foreground notification, one of the solutions is use
'react-native-push-notification' to handle the onRemoteNotification function

import PushNotification from 'react-native-push-notification';

onRemoteNotification(notification: any) {
  console.log(notification);

  PushNotification.localNotification({
    message: notification.message,
  });
}

@nithinyell
Copy link

Thanks for the update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants