如果被短信、推送通知或低电量状态等 uialert 中断,如何自动继续录制

发布于 2024-10-03 12:40:43 字数 321 浏览 1 评论 0原文

我在 iPhone OS 4.1 上有一个录音应用程序。我注意到,当弹出任何警报(例如短信、计时器、警报或推送通知,最重要的是低电量警报)时,应用程序会停止录制(可能是因为它失去焦点)。问题是,一旦用户消除警报(确定或取消),我怎样才能让应用程序从停止的地方继续录制,而无需用户再次按任何按钮。最重要的是,如何让应用程序在 UIalert 中断之前继续在前台执行任何操作,而无需任何其他用户输入。

我在 netflix 和 hulu+ 应用程序上看到过这种情况,当弹出任何警报时视频会暂停,但当用户关闭弹出窗口时视频会自动继续。

我不会查看任何私有 API。

任何帮助将不胜感激。

I have a voice recording app on iPhone OS 4.1. I notice that the app stops recording (maybe because it loses focus) when any alert such as text message or timer or alarms or push notifications and most importantly, low battery alerts, pop up. Question is, as soon as the user dismisses the alert (ok or cancel) how can I get the app to continue recording from where it left off without having the user to press any button again. Bottomline, how do I get the app to continue whatever it was doing in the foreground before the UIalert interruptions without any additional user inputs.

I have seen this on netflix and hulu+ apps where the video is paused when any alert pops up, but the video automatically continues when the popup is dismissed by the user.

I am not looking at any private APIs please.

Any help would be greatly appreciated.

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

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

发布评论

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

评论(1

流年里的时光 2024-10-10 12:40:43

您应该考虑在应用程序委托的 -applicationWillResignActive-applicationDidBecomeActive 方法中处理这些问题。这些方法将分别在这些轻微中断发生之前和之后触发。

You should look into handling these issues in the -applicationWillResignActive and -applicationDidBecomeActive methods of your Application delegate. These methods will fire before and after, respectively, those minor interruptions occur.

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