一个 iOS 应用程序能否支持多个推送通知注册? [英] Could one iOS application support multiple push notification registration?

查看:31
本文介绍了一个 iOS 应用程序能否支持多个推送通知注册?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


这是我第一次接触推送通知服务,我有点困惑.我只想得到一些概念上的帮助,而不是代码.
我需要构建一个应用程序来接收和注册不同类型的通知.例如,在我的应用中,我希望用户可以注册 PROMO 通知类别和 NEWS 通知类别,我希望他们可以选择要通知的类别.
阅读 Apple 文档,这对我来说不是很清楚,似乎一旦注册了应用程序设备,我只会收到一个令牌,并且似乎不可能收到更多用于不同类型注册的令牌(例如,NEWS 和 PROMO),因为令牌与应用程序和设备有关.对吗?
我不太清楚的另一件事是,如果设备注册了特定通知,是否可以仅将通知发送到一组设备?

如果 Apple Push 服务没有提供这些,您是否认为可以像这样管理所有内容:- 如果选择了 (PROMO || NEWS),我会注册应用设备以获取通知-我得到了令牌- 我将令牌发送到我的服务器,同时提供有关用户想要订阅的服务的附加信息-服务器(提供商)注册令牌和订阅类型(PROMO || NEWS)-稍后,当我收到要推送的通知时,我会向服务器询问为该特定类别注册的所有令牌,然后仅将通知发送给为该类别注册的那些设备.


This is the first time that I approach the push notification service and I'm little bit confused. I 'd like to have just some conceptual help, not code.
I need to build an app that should receive and register for different kind of notifications. For instance in my app I'd like that users could register for PROMO notifications category and NEWS notifications category, I'd like that they could choose which one they want to be notified.
Reading the Apple doc, that was not so clear to me, it seems that once the app device is registered I receive just one token and seems impossible to receive more tokens for different kind of registration(NEWS and PROMO for instance), because the token is related to the app and the device. Is that correct?
The other thing that is not so clear to me is, if a device is registered for a specific notification is it possible to send the notification only to a set o devices?

If nothing of that is offered by Apple Push services do you think that is possible to manage everything like that: -I register the app device for notification if (PROMO || NEWS) are selected -I get the token -I send the token to my server giving also as additional info about the service which the user wants to subscribe -The server (provider) register the token and the kind of subscription (PROMO || NEWS) -Later when I have a notification to push I ask the server all the tokens registered for that specific category and then I send the notification only to those devices registered for that category.


谢谢你帮我解决我真的很困惑.


Thanks for helping me out I'm really confused.

推荐答案

阅读 Apple 文档,这对我来说不是很清楚,似乎一旦注册了应用程序设备,我只会收到一个令牌,并且似乎不可能收到更多用于不同类型注册的令牌(例如,NEWS 和 PROMO),因为令牌与应用程序和设备相关.正确吗?"

"Reading the Apple doc, that was not so clear to me, it seems that once the app device is registered I receive just one token and seems impossible to receive more tokens for different kind of registration(NEWS and PROMO for instance), because the token is related to the app and the device. Is that correct?"

对我来说不太清楚的另一件事是,如果设备注册了特定通知,是否可以仅将通知发送到一组设备?

The other thing that is not so clear to me is, if a device is registered for a specific notification is it possible to send the notification only to a set o devices?

是的,您需要一个数据库,用于将推送令牌与相关服务(促销 | 新闻)连接起来.如果您有新的促销推送消息,则将该消息发送到所有相关令牌.在应用网站上,每次用户更改类别(促销/新闻)时,您都应该使用推送令牌将这些信息提供给您的服务.

YES, you need a DB where you connect a Push Token with the related Services (promo | news). If you have a new Promo Push Message you send the message to all related token. on the app site, everytime the user change the categorie (promo / news) you should prpvide these infos to your service with the push token.

这篇关于一个 iOS 应用程序能否支持多个推送通知注册?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆