Apple 针对用户响应的推送通知服务

发布于 2024-10-11 16:47:38 字数 60 浏览 3 评论 0原文

当消息被推送到用户设备时,有没有办法跟踪用户响应(“查看”和“关闭”之间的选择)?

谢谢。

Is there a way to track user response (the choice between the 'View' and 'Close') when the message has been push into the user device?

Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

浅笑轻吟梦一曲 2024-10-18 16:47:38

如果用户单击“关闭”,您的应用程序不会收到通知;但是如果用户单击“查看”,您的应用程序将启动,并且您可以检测到它是从通知启动的 - 通知的有效负载将传递到 application:didFinishLaunchingWithOptions:

另外,不要忘记通知到来时您的应用程序可能已经在运行的情况。在这种情况下,您的 application:didReceiveRemoteNotification: 函数将被调用。

完整详细信息位于此处

Your app is not notified if the user clicks "Close"; but if the user clicks "View", your app is launched, and you can detect that it was launched from a notification -- the notification's payload is passed to application:didFinishLaunchingWithOptions:.

Also, don't forget about the case where your app might already be running when the notification comes in. In that case, your application:didReceiveRemoteNotification: function will be called.

Full details are here.

酒几许 2024-10-18 16:47:38

我的策略是:

  1. 当您的服务器触发 APNs 通知时,保留用户设备令牌的记录。
  2. 相应地实现 didFinishLaunchingWithOptionsdidReceiveRemoteNotification 方法,以便每当用户的设备因您的 APNs 通知而变为活动状态时,它都会发送请求以通知您的服务器。此请求应包含设备令牌。
  3. 一旦收到此类请求,您的服务器就会执行查找和匹配过程。

My strategy would be:

  1. Keep a record of the user's device token when your server fires a APNs notification.
  2. Implement the didFinishLaunchingWithOptions and didReceiveRemoteNotification methods accordingly, so that whenever the user's device becomes active due to your APNs notification, it sends a request to let your server know. This request should contain the device token.
  3. Your server does a look-up and match process, once such a request is received.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文