2015-03-31 66 views
0

我在我的应用程序中注册iOS推送通知。推送通知正在发送到所有设备。限制接收推送通知到已被推送的相同设备

[application registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeAlert) categories:nil]]; 

[application registerForRemoteNotifications]; 

我想限制接收推送通知从哪里发送。因为,如果我从我的A设备发送推送通知并进入主屏幕,则同一A设备也正在接收该推送通知。这不是我预期的行为。

如何限制接收推送通知到已被推送的同一设备?

+0

您需要将您的推送目标设置为您想要接收通知的设备 - 这由受到通知发送到APNS服务器的服务控制。实际发送推送的代码在哪里? – Paulw11 2015-03-31 07:14:57

+0

听起来好像您需要在服务器中管理deviceToken - > userId的表映射。并且您希望每个用户只发送一次,即使它有很多设备。 – IdoT 2015-03-31 07:18:05

+0

行..我们无法限制原始应用程序,我们将消息推送到服务器? – Stella 2015-03-31 07:25:40

回答

0
Send the APNS Device Token of Device A to the API/Webservice sending Push Notifications. 
Ask Web service developer to restrict sending Push Notification to APNS Device Token of Device A and send to rest devices. 
And you are done. 
+0

行..我们有没有办法限制原始应用程序,我们将消息推送到服务器? – Stella 2015-03-31 07:25:40

+0

Web服务是向APNS服务器发送推送通知的起源。 你不能限制它在客户端(iOS设备) – 2015-03-31 07:27:39

+0

谢谢。学到了一些东西。 – Stella 2015-03-31 07:28:55