当目标c中有推送通知时,如何在没有用户交互的情况下将iPhone应用程序从后台移到前台? [英] How to bring iphone app from background to foreground without user interaction when push notification comes in objective c?

查看:52
本文介绍了当目标c中有推送通知时,如何在没有用户交互的情况下将iPhone应用程序从后台移到前台?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请向我建议使用客观的C代码,以在推送通知到来时将应用程序从后台运行到前台,而无需任何用户交互.

Please suggest me objective c code for bringing the app from background to foreground without any user interaction when push notification comes.

推荐答案

不幸的是,由于Notification的到来和您的应用即使没有用户交互也自动启动,这是不可能的.

Unfortunately it is not possible as Notification come and your app started automatically even without user interaction.

随着推送通知"的到来,它可以通过操作系统进行处理.

As Push Notification comes it Handles by OS.

如果在应用程序未运行时收到应用程序的通知,则设备会提醒用户该应用程序有数据在等待它.

If a notification for an application arrives when that application is not running, the device alerts the user that the application has data waiting for it.

然后,这意味着用户必须与设备进行交互.

Then It means user have to interact with the Device.

来自Apple文档.

当操作系统传递推送通知(iOS或OS X)且目标应用程序未在前台运行时,它将显示通知(警报,图标徽章编号,声音).如果存在通知警报,并且用户点击或单击操作按钮(或移动操作滑块),则应用程序将启动并调用方法以传递本地通知对象或远程通知有效内容.如果在传递通知时应用程序在前台运行,则应用程序委托将收到本地或推送通知.

仅此而已.

希望它能使您明白.

这篇关于当目标c中有推送通知时,如何在没有用户交互的情况下将iPhone应用程序从后台移到前台?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆