How can I send push notification to multiple devices in one go in iPhone?

后端 未结 2 1159
执念已碎
执念已碎 2021-01-13 14:57

I want to send same messages to all devices who are registered with application but how can send them without making multiple connections...

My current PHP code:

相关标签:
2条回答
  • 2021-01-13 15:10

    You can use one connection to send multiple messages, so you don't need to open multiple connections. You can't use one message for multiple devices.

    0 讨论(0)
  • 2021-01-13 15:22

    Bottom line, you can't. You need to send a message to each token.

    Its not working like a email where you can have multiple recipients.

    Once the connection is open you can send a bunch of messages, thats also the preferred way (based on Apples SDK).

    from the SDK:

    http://developer.apple.com/library/mac/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingWIthAPS/CommunicatingWIthAPS.html#//apple_ref/doc/uid/TP40008194-CH101-SW2

    You should also retain connections with APNs across multiple notifications. APNs may consider connections that are rapidly and repeatedly established and torn down as a denial-of-service attack. Upon error, APNs closes the connection on which the error occurred.

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