iOS: showing an alert when getting a call?

后端 未结 4 993
无人共我
无人共我 2021-01-01 07:19

I would like a local notification to be fired when a call is received (and to show an alert) - is this possible? Can a call event get an app to launch or a notification to b

4条回答
  •  南方客
    南方客 (楼主)
    2021-01-01 07:54

    The best you can do is hook the applicationWillResignActive method, which gets called basically whenever your app loses focus (which happens when a call comes in, but also happens for other reasons, so it's not perfect).

    See: http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIApplicationDelegate_Protocol/Reference/Reference.html

提交回复
热议问题