My package which uses java-apns needs to reply to
its caller (the component which contacted me asking
to push a message to APNs) with a status from this
push request -- whether success or failure -- but
this is difficult to do under these circumstances.
For example, when I send to an invalid token, my
delegate on messageSent is called (inside which I
ought to be able to report successfully received
by APNs), but then, a second later, so is my
delegate on connectionClosed (inside which I
report a failed send).
How, then, can we know for certain that a message
was accepted for sending by APNs, and that it
is not going to be rejected a second later? Unless
we'd need to delay reporting status in messageSent
until we see that no connectionClosed was called.
Huh? That sounds complicated!
Any help on this is greatly appreciated!
--aryeh