如何在iOS 6.x中以静默方式在后台启动APP

编程入门 行业动态 更新时间:2024-10-07 14:26:18
本文介绍了如何在iOS 6.x中以静默方式在后台启动APP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我们希望在iPhone中静默启动APP而不将此APP带到前台。在iOS 5.x中,我们通过以下代码实现此目标:

We want to launch an APP silently in iPhone without bring this APP to the Foreground. In iOS 5.x we achieve this goal by this code:

[(SBApplication*)app setDisplaySetting:0x4 flag:NO]; [(SBDisplayStack*)displayStack pushDisplay:app]; [(SBDisplayStack*)displayStack popDisplay:app];

但是,在iOS 6.x中,不再有SBDisplayStack。我做了一些搜索,但没有找到任何答案。有人说SBWorkSpace取代了iOS 6.x中的SBDisplayStack。我们使用SBAppToAppWorkspaceTransaction来实现,但始终将APP带到Foreground,这无法实现我们的目标。

But, in iOS 6.x there is not SBDisplayStack any more. I did some search but not found any answers. Someone says that SBWorkSpace replaces the SBDisplayStack in iOS 6.x. We use SBAppToAppWorkspaceTransaction to implement but always bring the APP to the Foreground which dose not achieve our goal.

任何人都可以帮助我吗? Thx!

Anyone can help me? Thx!

推荐答案

您可以使用 SBSLaunchApplicationWithIdentifier()函数 SpringBoardServices 私有框架。需要暂停参数:

You can use the SBSLaunchApplicationWithIdentifier() function from the SpringBoardServices private framework. It takes a suspended argument:

SBSLaunchApplicationWithIdentifier(CFSTR("company.app"), TRUE);

您还需要 com.apple.springboard.launchapplications 此权利。

更多推荐

如何在iOS 6.x中以静默方式在后台启动APP

本文发布于:2023-11-05 10:22:58,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1560574.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:中以   后台   方式   如何在   APP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!