设备空闲时处理推送通知
我已经实现了Apple Push通知服务。我有一个要求,当收到通知时,我需要在设备中执行代码。当我按照文档进行操作时,我发现有两种方法可以执行此操作
application:didReceiveRemoteNotification -->如果应用程序正在运行,则会调用此
application:didFinishLaunchingWithOptions-->, 则会调用此方法如果应用程序由于警报消息视图按钮而被带到前台,则会调用此函数。
但我的要求不同。我需要在应用程序处于后台以及设备空闲时执行代码。有想过我该怎么做吗?
谢谢 -斯里坎特
I have implemented Apple Push notification service. I have a requirement that I need to execute code in the device when a notification is received. When I followed the documentation, I found that there are two ways to do this
application:didReceiveRemoteNotification --> this is invoked if the app is running
application:didFinishLaunchingWithOptions--> this is invoked if the app is brought to foreground because of the alert message view button.
But my requirement is different. I need to execute code when the app is in the background and also when the device is idle. Any thought how i can do it?
Thanks
-Srikanth
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当应用程序处于睡眠状态时,您无法使用推送通知来执行此操作。
You cannot do this with push notifications when the app is sleeping.