0

I am using fcm to send notification to ios and android. The notification payload is like

{
        "to":"APA91bFOrqYNhaZxlmAk-........",
        "priority":"high",
        "notification":{
            "body":"this is game notification",
            "title":"hi",
            "icon" : "myIcon"
        },
        "data" : {
            "name" : "XYYZ",
            "company" : "ABC Pvt Ltd",
            "Country":"India"
        }
}

The Problem is most of the time data is not being received by the android device. So how can I know if the data was properly sent to the device? Is it FCM problem or android side problem?

AL.
  • 36,815
  • 10
  • 142
  • 281
nurulnabi
  • 459
  • 3
  • 11

1 Answers1

-1

There was no problem with FCM or Android, but it has certain limitations. Only in 2 scenarios app can receive push notifications.

  1. The app should be in Foreground or Background to receive push notifications.

  2. Still, the app can receive push notifications when it was killed or force closed, but the app should be whitelisted to start automatically in the background whenever it needs. Kindly check apps like Security360, Autostart Manager, Background App Manager, etc.

This answer is not a solution, but it is the workaround. Hope it helps.

Jaya Prakash
  • 93
  • 4
  • 11
  • @AL.the possible ways to reach out users via push notifications. either app is in foreground/background or remind users to whitelist the app – Jaya Prakash Mar 17 '17 at 15:49
  • 1
    You just described the behavior. This doesn't really answer the question nor provide a workaround. – AL. Mar 17 '17 at 23:14
  • ok. then go ahead with a workaround. I will be happy about that and banging my heading since years. – Jaya Prakash Mar 18 '17 at 05:41
  • Hi. I sense frustration somehow. The behavior you described is okay, but it's not really what the post is asking about. If you see in the comments section above, I was asking for the code snippets, because it's possible that the issue is there. We try to avoid *unnecessary answers* being posted. If the OP edits the question and you provide a more related answer, I'll remove the downvote. Hope this clears things. – AL. Mar 18 '17 at 05:53
  • I would like to post this as a comment, but I haven't enough reputation. thanks. – Jaya Prakash Mar 18 '17 at 06:15
  • That's okay. It usually happens. Keep an eye out on the OPs edit and put in an answer. We appreciate all the help you're contributing to the community. Cheers! – AL. Mar 18 '17 at 08:00
  • This does not provide an answer to the question. Once you have sufficient [reputation](http://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](http://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](http://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/low-quality-posts/15564988) – Mark Rotteveel Mar 19 '17 at 10:26
  • @MarkRotteveel ok – Jaya Prakash Mar 19 '17 at 17:05