iPhone How to programmatically handle SMS/Call alert notification

不羁的心 提交于 2019-12-08 06:45:22

问题


I'm having some problems with SMS alerts and call notification freezing up the video player. I'm currently displaying a video using MPMoviePlayerController with movieControl Hidden. I'm also overlaying a subtitle using UITextView on top of the video.

However whenever a SMS alert popup, the video will freeze up but the textView will continue to scroll. A call alert will also intrupt the video, causing the video to freeze up while the text continue scrolling, which leads to misallignment.

So is there any way to fix the video from freezing up? Or is there any way to detect SMS/Call alert notifications and handle it?


回答1:


check

- (void)applicationWillResignActive:(UIApplication *)application

and

- (void)applicationDidBecomeActive:(UIApplication *)application

methods of UIApplicationDelegate protocol. Or you can catch

UIApplicationDidBecomeActiveNotification

and

UIApplicationWillResignActiveNotification

notifications



来源:https://stackoverflow.com/questions/1801954/iphone-how-to-programmatically-handle-sms-call-alert-notification

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!