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

How to send silent push when app is closed or in the backgroud? (Android) #127

Open
benevbright opened this issue Jun 8, 2017 · 0 comments

Comments

@benevbright
Copy link

Hi, I'm using this plugin long time but have not figured out how to send a silent push on Android.

min SDK : 21
First of all, weird thing is that

  • I don't have to use Service as creator said on the readme. I can receive push notification all the time even when app is closed.
  • And It works fine if I comment all codes in the PushNotificationGcmListener.cs except
    CrossPushNotification.PushNotificationListener.OnMessage(values, DeviceType.Android);
    which includes feature handling silent push.

My app receives push notifications when app is closed and is in the background.
https://developers.google.com/cloud-messaging/downstream
like this document said,

When your app is in the background, Android directs messages with notification to the system tray. A user click on a notification opens the app launcher by default.

But the problem is that I can't handle silent push when my app is in the background or closed. I got push notification that doesn't have a title, it's empty message but it goes off!

Where can I try to avoid to receive my silent push message?

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

1 participant