gpt4 book ai didi

ios - 向 iOS 用户发送多个推送通知

转载 作者:行者123 更新时间:2023-11-29 02:39:25 24 4
gpt4 key购买 nike

是否可以一次/即时向注册的 iOS 用户发送多个(10 - 15)条通知? iOS 推送通知有哪些限制?

最佳答案

是否可以一次/瞬间向注册的 iOS 用户发送多个(10 - 15)条通知?

不,您不能同时向同一用户发送 10-15 条通知,请在此处阅读更多信息 apple docs .

If you are sending multiple notifications to the same device orcomputer within a short period of time, the push service will sendonly the last one.

但是,如果您打算同时向不同的用户发送推送通知,那么应该没有问题(我猜这就是您正在寻找的)。

iOS 推送通知有哪些限制?

如果您没有同时将它们发送给同一用户,则 APN 的推送通知没有限制,如此处所述。请查看 Push Notification Throughput and Error Checking

There are no caps or batch size limits for using APNs. The iOS 6.1press release stated that APNs has sent over 4 trillion pushnotifications since it was established. It was announced at WWDC 2012that APNs is sending 7 billion notifications daily.

If you're seeing throughput lower than 9,000 notifications per second,your server might benefit from improved error handling logic.

Here's how to check for errors when using the enhanced notificationformat. Keep writing until a write fails. If the stream is ready forwriting again, resend the notification and keep going. If the streamisn't ready for writing, see if the stream is available for reading.

If it is, read everything available from the stream. If you get zerobytes back, the connection was closed because of an error such as aninvalid command byte or other parsing error. If you get six bytesback, that's an error response that you can check for the responsecode and the ID of the notification that caused the error. You'll needto send every notification following that one again.

Once everything has been sent, do one last check for an errorresponse.

It can take a while for the dropped connection to make its way fromAPNs back to your server just because of normal latency. It's possibleto send over 500 notifications before a write fails because of theconnection being dropped. Around 1,700 notifications writes can failjust because the pipe is full, so just retry in that case once thestream is ready for writing again.

希望这对您有所帮助。

关于ios - 向 iOS 用户发送多个推送通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25973509/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com