luckasfrigo luckasfrigo - 10 months ago 65
Android Question

Which are the possible error messages for OneSignal API DELETE call?

I tried to look for it into OneSignal's own documentation, but can't find it anywhere.

Basically we are trying to send a Push Notification to both iOS and Android devices. But if one of them fails (usually iOS, because of the lack of a certificate) we want to delete all push. OneSignal documentation says you can cancel a notification while it's being sent.

But in every attempt to do so we received this error message:

Notification has already been sent to all recipients

We could never simulate a situation where only some of the pushes were sent. So what we need to know is whether it produces some kind of warning when this situation happens. And, if so, what is the message.

Answer Source

This error message is shown when OneSignal has already delivered or attempted to delivered the notification to all target devices -- in this case there's nothing left to cancel.

You can simulate a case where only some of the notifications have been sent by using "Timezone" or "Active Time" delivery scheduling. This will spread the delivery of the notification to the recipients over the span of up to 24 hours, so you can cancel it before it has gone out to everyone.