简体   繁体   English

发送通用推送通知-Xcode

[英]Send Universal Push Notifications - Xcode

I have finished this tutorial here http://mobiforge.com/developing/story/programming-apple-push-notification-services and now i can send a push notification to my device using my application. 我已经在这里http://mobiforge.com/developing/story/programming-apple-push-notification-services完成了本教程,现在我可以使用我的应用程序将推送通知发送到我的设备。 However i cannot figure out how to send push notifications not just to my specific device token but to all devices with my application. 但是我无法弄清楚如何不仅将推送通知发送到我的特定设备令牌,而且还发送到使用我的应用程序的所有设备。

您必须将消息分别发送到每个设备,即:循环发送

Apples Push Notification servers only know to direct messages to specific devices. 苹果推送通知服务器仅知道将消息定向到特定设备。 It is the developer's responsibility to pass the tokens you receive from the 开发人员有责任传递您从

- (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken

method to your server ( through an HTTP post for instance ) and keep track of all the existing tokens. 方法(例如通过HTTP发布)发送到服务器,并跟踪所有现有令牌。

If/when you want to send a message to all the devices - you simply need to iterate all the existing device tokens. 如果/当您想向所有设备发送消息时,只需要迭代所有现有的设备令牌。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM