问题描述
当消息被推送到用户设备时,有没有办法跟踪用户响应(在查看"和关闭"之间的选择)?
谢谢.
如果用户点击关闭",你的应用不会收到通知;但是如果用户点击查看",你的应用程序就会启动,你可以检测到它是从通知中启动的——通知的有效负载被传递给 application:didFinishLaunchingWithOptions:.>
另外,不要忘记当通知出现时您的应用程序可能已经在运行的情况.在这种情况下,您的 application:didReceiveRemoteNotification: 函数将被调用.
完整详情在这里.
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.
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.
这篇关于针对用户响应的 Apple 推送通知服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!