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

Push Notification on background #722

Closed
tlofano opened this issue Apr 24, 2018 · 4 comments
Closed

Push Notification on background #722

tlofano opened this issue Apr 24, 2018 · 4 comments

Comments

@tlofano
Copy link

tlofano commented Apr 24, 2018

Do you want to request a feature or report a bug?
Question: Currently, is the onNotification event supported on background?
If the answer is yes. I'm having problems with this, is there any other requirement that the documentation doesn't say?
If the answer is no, I'm submitting a Feature Request.

What is the current behavior?
onNotification is only triggered when the app is in the foreground

What is the expected behavior?
onNotification trigger when the app is in background

Which versions of Amplify, and which browser / OS are affected by this issue? Did this work in previous versions?
I'm developing for Android.
aws-amplify-react-native: 0.2.9
aws-amplify: 0.2.15
react-native: 0.54.4

I follow this implementation:
https://aws.github.io/aws-amplify/media/push_notifications_setup.html

@powerful23
Copy link
Contributor

@tlofano It should be triggered in background. Can you give more details about what you want to do with this callback?

@tlofano
Copy link
Author

tlofano commented Apr 26, 2018

@powerful23 thanks for quick response. I'll close the issue because I found and fix my problem. Again, thanks. My implementatios was say the documentation:

PushNotification.configure(aws_exports);

PushNotification.onRegister((token) => {
     console.log('in app registration', token);
});

PushNotification.onNotification((notification) => {
      this.somethingToDo();
});

This works well, even on background.

@tlofano tlofano closed this as completed Apr 26, 2018
@iuliuvisovan
Copy link

What was the problem in your case?

@github-actions
Copy link

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels or Discussions for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants