1

I am trying to implement push notification service for my new chat application. For the POC sake, I got my device registered a demo app with FCM and created an account for my app on FCM. That way, I am done with all the formalities. I am using XMPP protocol based implementation from google.

Now, when I try to send the push for more than 50 times in a single shot(using for loop) to my android device. FCM sends me the delivery receipt for all the push notifications (say if I am sending 60 push at times then it sends me delivery receipts for 60 push) but on my mobile I just get 49 push notifications.

I tried multiple ways like sending each PUSH after a gap of a second, but still getting 49 messages.

Can any one suggest me what shall I do to rectify it. I want to see all the push notifications on my device. I have gone through various links, but could not find any help.

The packet I am sending from my server

{
"delivery_receipt_requested":true,
"notification":{
"title":"XXX",
"body":"Message 111...0"
},
"data":{
"message":"This is the simple sample message"
},
"time_to_live":2000,
"message_id":"m-0-f21bb45d-213c-4306-b773-1f7f71d1494b",
"to":"SOME VALID DEVICE TOKEN"
}

Can someone please suggest if I am missing anything.

Thanks in advance.

KENdi
  • 7,576
  • 2
  • 16
  • 31
Learner
  • 544
  • 1
  • 8
  • 19
  • Are you setting a unique `message_id` for each message? [Server ref](https://firebase.google.com/docs/cloud-messaging/xmpp-server-ref) says it is required, although that is not consistent with the [Cloud Messaging Guide](https://firebase.google.com/docs/cloud-messaging/server#format), which states: _FCM adds the field message_id, which is required. This ID uniquely identifies the message in an XMPP connection_. – Bob Snyder Aug 30 '17 at 18:32
  • Yes,The message id is unique. – Learner Aug 30 '17 at 23:58
  • Take a look here http://www.androiddocs.com/google/gcm/adv.html#throttling – algrid Aug 31 '17 at 14:37
  • Thanks..i will have a look at it....this might be the reason. – Learner Sep 01 '17 at 07:07

2 Answers2

1

There is a maximum count limit of notifications displaying for each app on Android.

So in your case you can receive all delivery receipt for the push notifications, meaning there is no problem for the device to receive them.

The main issue is the device can not display notifications beyond the limit, say 50 notifications.

Any notifications beyond the limit will not be shown on the notification area.

reference: android system notification limit per app

Wesley
  • 563
  • 1
  • 5
  • 22
0

I have done a small experiment on my mobile by developing a small app and a tool which sends push notification every 2 seconds using FCM to my app.App will be foreground and when i tap on setting in my app it will display the notification count my android app has received.

I sent around 1000 pushes and found that around 658 received on my mobile.So this assures that my mobile does receive the push more than 49 and FCM is not 100% reliable for the PUSH notifications.

Thanks

Learner
  • 544
  • 1
  • 8
  • 19