push notification api to all devices not all getting delivered

Fair enough.

I would have done at the time, but I do recall the docs weren’t all there and I had to follow something in the support forum so it came from a number of sources. What I don’t understand is if I send to selected devices that works, but if I send to every device that is where I get unstuck. Unfortunately all development testing was done to selected devices so I may have missed something.

I will migrate to 4.x , but as there are quite a few code changes required so I need to hop along on 3 for a while and this is the only thing throwing a problem. Mmm I need to get back to basics on this I think

Let me persevere with the test channel and once I get that working and am under a better understanding and it still isn’t working when I think it should be, I may get back to you if that is ok.

Just going back to the error messages I got today, What would Invalid Parameters and Invalid Registration generally indicate??

“InvalidRegistration” means a device registration for the specified device ID could not be found.

In the code you showed, the registerDevice method seems to be missing the token you got from APNS. Please make sure you’re using a method where you pass in a channel and the token from APNS .

Regards,
Mark

Hi Mark, I’m still having prolems with this and I am pulling my hair out. I really don’t want to switch to another push notification system, but I need to get this working. I don’t mind paying for some time to get this sorted.

So just to reiterate the problem…

It seems to work wonderfully well when I send push notifications to selected devices, passing in the deviceID. They always arrive.

However when we do a push to everyone some people get the notification and some people don’t. I have a hunch that at some point it fails and the causes all the others to fail. This is only a hunch.

Yesterday we sent a push notification with ID: 0E2255CD-D255-D700-FF14-670764CD7200 It got to some people, not others. It arrived on my device, but not on a colleagues device. I then sent a single device to colleagues device and it arrived no problem.

Looking at my Dashboard for yesterday I can see that 1195 messages were sent. This looks about the right number to be sent. Is it possible to have a breakdown of these messages, like which devices it was delievered to? I now have a table setup which records each time someone reads the message., but only 11 messages were read according to this table. This isn’t very accurate I know as it as it only registers when they click on the message not when the message is received.

Hoping you can help a bit more…

Regards Mike

Hi mike.
Could you check please, what information contained in error message of MessageStatus after sending.
Especially when not all devices have received a message.

MessageStatus messageStatus = Backendless.Messaging.getMessageStatus( String messageId );
messageStatus.getErrorMessage();

Hi Oleg

I’m running on 3.0 and I think I have to do this through REST.

The Message ID was 0E2255CD-D255-D700-FF14-670764CD7200 and when I check the status now I get an error message of null and a status of unknown?

If I send an individual test message to an individual device it returns error message of null and status published.

In the console where it says 1195 messages sent - is this just showing they have been sent from your system? Can we get further information about those 1195 messages?

Mike

  1. The status ‘unknown’ does not look right. Could you please let us know how to reproduce it? Are you facing it every time when publishing messages? Perhaps digging into this issue would let us know the reason of why not all devices receive messages

  2. 1195 = (number of published messages) * (number of registered devices at the moment of publishing). Unfortunately we can’t find out which of these 1195 have actually received a message and which of them didn’t. Neither of messaging servers guarantee message delivery.

Are you planning to migrate to v4 of Backendless? Messaging has been enhanced in 4.0, you also can track which devices have not received messages due to incorrect device token in handleResponse block of publish() method.

Best Regards

Thanks Anton.

  1. The problem is I can only reproduce when sending a real notification to all users so therefore we have to wait till when we want to send a real notification if you see what I mean?

  2. ok thanks

  3. Yes, but as we already have some app users on the backendless system which we use for lots of things if we update to v4 it will mean supporting some users who are using the app with v3 and some who have updated and are now using v4. I can’t get in my head the best way to do the update! I would rather solve this first, especially as I have three apps with a user base on v3

how can we check if they have the incorrect device token? I think this may be a piece of the puzzle I am missing. Is it possible to pre check before sending a message out.

  1. If I send a message to my device or other selected devices it works fine. But perhaps those selected devices are working because I regularly login and use those devices. Could the problem be when I am sending to devices which havent been used on the system for a while? Is this related to the device token? Does the device token go out of date?

Unfortunately there is no way to find out which of them are invalid before publishing a push notification. In Backendless 4 devices with invalid tokens are being unregistered after publishing a message. So you will always have a list of valid devices. Regarding the default expiration period of deviceToken - unfortunately i don’t have the exact info, but the period is not short.

In our case it would be better to notify us in one-two days before sending a push. We could install your app and monitor the delivery and the message status. Meanwhile - please share the link to the app if it’s free or a project if it’s not (when sending a project - please attach a link to support topic).

Best Regards