如何通过 iPhone 应用程序发送单独的推送通知?
该应用程序适用于健身房。我希望它允许培训师向他们的客户发送单独的推送通知。这可能吗?下载后用用户名和教练注册有效果吗?
The app is for a Gym. I would like it to allow individual push notifications to be sent from trainers to their clients. Is this possible? Would registering the app with user name and trainer after downloading have any effect?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您的目标是从一个 iPhone 应用程序发起推送消息并将其传送到另一台 iPhone,那么是的,这是可能的。通常在这种类型的场景中,您的应用程序会将 APN 设备令牌上传到登录到您的应用程序的每个客户端的后端服务器。然后,后端服务器将该令牌与该特定用户相关联。如果您希望能够为每个用户处理多个设备,那么您还需要在此注册中包含唯一的设备 ID。
当培训师使用该应用程序时,他们会告诉后端服务器向一个或多个客户端发送推送消息。然后,您的后端将检索与要向其发送消息的客户端关联的令牌,并使用检索到的令牌将消息发送到 Apple 的 APN 接口。
请记住,APN 令牌特定于移动设备和应用程序。
If your goal is to initiate a push message from one iphone app and have it delivered to another iphone, then yes it is possible. Typically in this type of scenario, your application would upload an APN device token to a backend server for each client that logs into your application. The backend server would then associate that token to that particular user. If you want to be able to handle multiple devices per user, then you will want to also include a unique device id with this registration.
When the trainers are using the application, they would tell the backend server to send a push message to one or more clients. Your backend would then retrieve the tokens associated with the clients to which the message is to be sent and use the retrieved token to send the message(s) to Apple's APN interface.
Remember the APN token is specific to the mobile device and application.