简体   繁体   English

iOS - 使用相同的消息和有效负载同时从同一服务器向多个应用程序发送推送通知的正确方法

[英]iOS - correct way to send push notification to multiple apps from the same server at the same time with the same message and payload

I have two separate applications in "development", lets call them App A and App B , that are supposed to receive the exact same message and payload from the same server as a push notification. 我在“开发”中有两个独立的应用程序,我们称之为App A和App B,它们应该从推送通知中获得与同一服务器完全相同的消息和有效负载。 Both have different application ids, certificate requests, provisioning profiles, development APN certificates, and produce different tokens. 两者都有不同的应用程序ID,证书请求,供应配置文件,开发APN证书,并生成不同的令牌。

If I send a push notification to either application individually each application will receive a notification. 如果我单独向任一应用程序发送推送通知,则每个应用程序都将收到通知。 But if I try to send a push notification to each application concurrently, only the fist application will receive the notification. 但是,如果我尝试同时向每个应用程序发送推送通知,则只有第一个应用程序将收到通知。 But I will receive no errors for the other application. 但我不会收到其他应用程序的错误。

I have tried to delay the push notification by up to 10 seconds between sending the push notification to the last application without success. 我试图在将推送通知发送到最后一个应用程序之间将推送通知延迟最多10秒,但没有成功。 Is there some way that I need to handle the connections to the apple server to enable this type of push notifications? 我是否需要一些方法来处理与Apple服务器的连接以启用此类推送通知?

Also note that there is another question that is having the exact same issue, but without any answers. 另请注意,还有另一个问题是完全相同的问题,但没有任何答案。 Limitations on push notifications for multiple apps from the same server 来自同一服务器的多个应用程序的推送通知限制

I was able to get the notifications to be delivered to both of the applications successfully by closing the previous connection. 通过关闭先前的连接,我能够成功地将通知发送到两个应用程序。 This is not recommended by Apple, and they state that I should keep them open, as there is a potential to have a lot of notifications pushed per day to each application. Apple不推荐这样做,他们声明我应该保持打开状态,因为每天都有可能会向每个应用程序推送大量通知。

Keep your connections with APNs open across multiple notifications; 通过多个通知保持与APN的连接; don't repeatedly open and close connections. 不要反复打开和关闭连接。 APNs treats rapid connection and disconnection as a denial-of-service attack APN将快速连接和断开视为拒绝服务攻击

Read More Here 在这里阅读更多

try to use two instance of your server , and keep your connection open while sending. 尝试使用服务器的两个实例,并在发送时保持连接打开。

Connect each instance to a different port: 2195, 2196 将每个实例连接到不同的端口:2195,2196

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在不使用php循环的情况下同时向ios设备发送1000条推送通知 - How to send 1000 push notification at same time to ios devices without using the loop in php 从php服务器向iOS设备发送多个推送通知 - Send Multiple push notification from php server to ios Devices 如何使用php FCM同时处理Android和iOS的不同有效负载? - How to handle differrent payload of notification to Android and iOS in a same time using php FCM? 同时发送Email和Telegram通知 - To send Email and notification on Telegram at same time 同时管理多个标签 - Server multiple tabs at the same time Laravel 多个应用程序相同的服务器如果同名,队列是否冲突? - Laravel multiple apps same server do queues conflict if same name? 如何在同一时间和同一应用程序中集成多个推送通知 - how to integrate multiple push notifications for the same time & for the same app 在PHP中同时发送多个HTTP请求 - Send multiple http request at same time in php Mailchimp自动化多次发送同一封电子邮件 - Mailchimp automation send same email multiple time 在 PHP 中使用 Parse 将相同的通知推送到多个 Android 设备 - Push same notification to multiple Android devices using Parse in PHP
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM