Pregunta

I'm making a chat with a notification service. Sometimes that the notifications dont arrives to my device. I'm using JavaPNS, so my code isn't very complex, but when I send a lot of messages very quickly (about 10) from one device to another, I don't receive all the notifications. Some of them are lost in the way (generally one of two).

Here is my code:

PushNotificationPayload payload = PushNotificationPayload.complex();
payload.addAlert("Name : text"); payload.addSound("default");
payload.addBadge(1); 
payload.addCustomDictionary("type", NOTIF_MESSAGE);
Push.payload(payload, "******.p12", "password", false, URI);
¿Fue útil?

Solución

It's OK.

Important: Because delivery is not guaranteed, you should not depend on the remote-notifications facility for delivering critical data to an application via the payload. And never include sensitive data in the payload. You should use it only to notify the user that new data is available.

-Local and Push Notification Programming Guide.

Otros consejos

Apple doesn't guarantee that ALL MESSAGES are ever delivered. The documentation says:

delivery of notifications is “best effort” and is not guaranteed.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top