应用程序打开时处理推送通知
我正在运行推送通知。有用。我收到通知并用于
application:didReceiveRemoteNotification:
获取传入数据,然后将用户发送到必要的屏幕。
问题是,如果您正在使用该应用程序并收到通知,它会跳转到目标屏幕,而不会发出任何警报/声音/任何内容。
我可以在 application:didReceiveRemoteNotification:
中放置一个警报,但该警报每次都会出现,而不仅仅是在应用程序运行时出现。
关于如何处理这个问题的想法?
I have my Push Notification running. It works. I receive a notification and use
application:didReceiveRemoteNotification:
to get the incoming data and then send the user to the necessary screen.
Problem is, if you are using the App and a notification is received, it jumps to the destination screen without giving any alert/sound/anything.
I could put an alert in application:didReceiveRemoteNotification:
, but then that alert would appear every time, not just when the app is running.
Ideas about how to handle this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议检查 UIApplication 中的 applicationState 属性以确定应用程序是否在后台运行。
I would recommend checking the applicationState property in UIApplication to determine if the app is running in the background or not.