如何创建“返回应用程序”应用程序转到后台时的状态栏?

发布于 2024-10-05 06:34:57 字数 636 浏览 3 评论 0原文

当我的应用程序在播放音频或录制音频时移动到后台时,我想提供类似绿色“通话中”状态栏的功能,该状态栏会在您通话时出现并切换到另一个应用程序,从而为您提供快速“返回应用程序”功能。

我认为这可能是一个私有 API,但我注意到 Griffin iTalk 应用程序在录制音频时会执行此操作(见图) - 所以我知道它可以完成,但我无法弄清楚 API 是什么( Info.plist 设置、AVAudioSessionUIApplication/Delegate 或其他)来实现这个神奇的效果。我的应用程序当前正在后台工作并录制音频,并且工作得很好,我假设有一些地方我没有设置来获得这种行为。

有人可以向我指出展示此行为的正确文档或示例代码吗? (我已经搜索了音频文档 并且一直没能找到它)。

谢谢!

替代文本

When my app moves to the background while either playing audio or recording audio, I would like to provide something like the the green "In Call" status bar that appears when you are in a call and swap out to another app, giving you a quick "return to app" capability.

I thought this might be a private API, but I noticed the Griffin iTalk app does this when it is recording audio (see picture) - so I know it can be done, but I have not been able to figure out what the API is (the Info.plist setting, the AVAudioSession, the UIApplication/Delegate or the whatever) to make this magic happen. My app is currently working and recording audio in the background and works just fine, I assume there is some bit somewhere I'm not setting to get this behavior.

Can someone either point me to the right docs or sample code that exhibits this behavior? (I've scoured the Audio docs and haven't been able to find it).

Thanks!

alt text

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

柠檬心 2024-10-12 06:34:57

可能有一个私有 API 可以做到这一点,但如果你想进入 App Store,要做的就是 注册为 VOIP 应用,它可以让您看到通话状态栏,就像 Skype 或(我想)iTalk。

There may be a private API to do this, but if you want to get into the App Store, the thing to do is to register as a VOIP app, which gets you the in-call status bar, like Skype or (I imagine) iTalk.

只怪假的太真实 2024-10-12 06:34:57

实际上,红条实际上仅在应用程序在后台录制音频时才会出现。我只在标记应用程序 VOIP 和音频时这样做过。

您也许可以通过仅将其标记为后台音频应用程序来做到这一点,但我还没有尝试过这一点。

Actually the red-bar actually only appears when the application is recording audio in the background. I've only ever done this when marking the application VOIP and Audio.

You may be able to do this by only marking is as background Audio application only, but I haven't tried this.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文