简体   繁体   English

如何从后台iOS打开应用程序

[英]How to open an application from background ios

Is it possible to open the background app into foreground in iOS ?. 是否可以在iOS中将后台应用打开到前台?

I have a scenario like, If suppose my application in background then after sometime I need to up the application into foreground programmatically. 我有一个场景,如果假设我的应用程序在后台,那么一段时间后,我需要以编程方式将应用程序设置为前台。 Is it possible ? 可能吗 ?

I don't need to upload the application in Appstore. 我不需要在Appstore中上传应用程序。

Yes, it is possible. 对的,这是可能的。

You can wake your app up by different kinds of criteria using Push Notifications or Local Notifications. 您可以使用“推送通知”或“本地通知”按照不同的条件唤醒应用。 Remotely by using Push Notifications. 通过使用推送通知远程。 Locally by calendar alerts, location-based triggers or task alerts. 通过日历警报,基于位置的触发器或任务警报在本地进行。

The users can configure and complete turn of Notifications for your app, in which case it is not possible. 用户可以为您的应用配置并完成通知的轮流,在这种情况下,这是不可能的。

See introduction from Apple here. 请参阅Apple的介绍。 https://developer.apple.com/notifications/ https://developer.apple.com/notifications/

As far as i know iOS does not provide a way to open your app. 据我所知,iOS没有提供打开您的应用程序的方法。 You can continue long running tasks while in the background opportunistically fetch content remind users to re-open your app if need be and prompt the first two with silent push notifications if need be. 您可以继续运行长时间运行的任务,同时在后台机会性地获取内容,以提醒用户在需要时重新打开您的应用程序,并在需要时通过静默推送通知提示前两个。

您无法在ios设备中在没有用户操作的情况下启动应用程序,因为它受到Apple的限制,现在您可以使用backgroundfetch在后台打开应用程序以进行某些网络通话或所需的操作,但仅限于不到一分钟的时间最多持续30秒,在此期间您的网络请求应已完成并且所有长时间任务都已计划,即使在后台感染期间,您也可以通过在MAIN线程上发布通知来更新UI。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM