如果被短信、推送通知或低电量状态等 uialert 中断,如何自动继续录制
我在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该考虑在应用程序委托的
-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.