2015-03-31 67 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