从设备向所有联系人发送推送通知
我有一个应用程序,我想在我的联系人中选择一个用户。如果那个人安装了我的应用程序,那么我想使用通知发送一些与该应用程序相关的数据。其他用户收到通知,并在此应用程序中对其进行操作。这可能吗?我在想,如果我可以识别该用户设备,我可以将此消息存储在服务器中。当用户连接到应用程序时,它将从服务器检索并获取该用户的消息。但问题是我可以从我的联系人列表中识别其他类似的设备吗?我可以使用电话号码而不是设备 ID 来发送此通知吗?
请帮忙。
谢谢你, 安克斯
I have an app where I would like to select a user in my contacts. If that person has my app installed, then I would like to send some data that is relevant for this app using a notification. The other user gets the notification, and acts on it within this app. Is that possible? I am thinking that if I can identify that users device, I can store this message in a server. When the user connects to the app, it will retrieve and get this users message from the server. But question is can I identify other devices like this, from my contact list. Can I send this notification using phone number instead of device id?
Please help.
Thank you,
Anks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,你不能。您必须拥有设备的 Apple Push 令牌,并且用户必须打开通知才能接收来自 Apple Push 的通知。
您需要维护一个服务器端数据库,将 APNS 令牌链接到特定的用户帐户。有很多点与这种实现相关。您更好的选择是在您的应用程序中维护一个“联系人列表”以链接联系人。
No, you cannot. You have to have the Apple Push Token for a device and the user has to have notifications turned on to be able to receive notifications from Apple Push.
You would need to maintain a server side database linking the APNS Token to a specific user account. There are a lot of dots to connect with this kind of implmentation. Your better bet would be maintaining a "list of contacts" within your App to link contacts to.