如何在 iPhone 上指定推送通知的用户?
我想向应用程序用户发送推送通知,并且可以发送给所有用户,但我也想选择用户。我怎样才能做到这一点?
I want to send push notifications to the application users and i can send to all users, but i want to select users also. How can i do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您当前能够向所有用户发送推送通知,那么您显然正在将他们的设备令牌存储在某个地方。如果您想向单个用户发送通知,您只需确定哪个令牌是他们的(可能通过将数据库中的信息与其关联,例如他们的电子邮件)并向 APNS 发送单个通知。
If you are currently able to send push notifications to all of your users, you're obviously storing their device tokens somewhere. If you want to send a notification to a single user, you just need to determine which token is theirs (possibly by associating information with it in the database—e.g. their email) and send a single notification to APNS.