New Command 2 Apple Push Notification Not sending multiple alerts

前端 未结 3 689
有刺的猬
有刺的猬 2020-12-20 02:52

I am trying to implement the new \'Command 2\' push notification in Java and cannot have it push multiple alerts. First alert is pushed successfully. Please help if you can

相关标签:
3条回答
  • 2020-12-20 03:04

    Since you are getting back a an error code from APNS, the connection should be dropped at that point and APNS will ignore everything after the error. When you receive an error back, the identifier is the identifier you are currently using a random number for.

    There's no easy solution here -- you have to rearchitect what you have so that when you receive the error, you can figure out everything after that point and resend -- I'd recommend using a sequential number for the Identifier and then storing the packets in a queue that you purge periodically (you have to keep them around for say 30 seconds to guarantee that Apple Accepted them).

    0 讨论(0)
  • 2020-12-20 03:17

    The command 2 and the frame data length applies to each message. If you send multiple messages in one connection, then for each message: send command 2, the message's frame data length, and the 5 parts (token, payload, id, expiry, priority)

    0 讨论(0)
  • 2020-12-20 03:24

    It looks like you are writing a single notification to bao, so why do you expect it to push multiple alerts? If you want to push multiple alerts, you have to repeat that sequence of bytes that you write into bao multiple times.

    0 讨论(0)
提交回复
热议问题