ios|ios 程序内监听系统来电
导入头文件
#import
#import
遵循代理
CXCallObserverDelegate
创建实例
@property(nonatomic, strong) CXCallObserver *callCenter;
初始化
self.callCenter = [CXCallObserver new];
[self.callCenter setDelegate:self queue:dispatch_get_main_queue()];
【ios|ios 程序内监听系统来电】代理事件
//MARK: CXCallObserverDelegate
- (void)callObserver:(CXCallObserver *)callObserver callChanged:(CXCall *)call {
NSLog(@"outgoing :%donHold :%dhasConnected :%dhasEnded :%d",call.outgoing,call.onHold,call.hasConnected,call.hasEnded);
/*
拨打:outgoing :1onHold :0hasConnected :0hasEnded :0
拒绝:outgoing :1onHold :0hasConnected :0hasEnded :1
链接:outgoing :1onHold :0hasConnected :1hasEnded :0
挂断:outgoing :1onHold :0hasConnected :1hasEnded :1
对方未接听时挂断:outgoing :1onHold :0hasConnected :0hasEnded :1新来电话:outgoing :0onHold :0hasConnected :0hasEnded :0
保留并接听:outgoing :1onHold :1hasConnected :1hasEnded :0
另一个挂掉:outgoing :0onHold :0hasConnected :1hasEnded :0
保持链接:outgoing :1onHold :0hasConnected :1hasEnded :1
对方挂掉:outgoing :0onHold :0hasConnected :1hasEnded :1
*/
}
推荐阅读
- JAVA(抽象类与接口的区别&重载与重写&内存泄漏)
- 基于微信小程序带后端ssm接口小区物业管理平台设计
- 期刊|期刊 | 国内核心期刊之(北大核心)
- 2020-04-07vue中Axios的封装和API接口的管理
- 你有婚内虐待行为吗()
- 标签、语法规范、内联框架、超链接、CSS的编写位置、CSS语法、开发工具、块和内联、常用选择器、后代元素选择器、伪类、伪元素。
- ?【段子图】内裤为啥湿呢(想想好邪恶啊...)
- 放下心中的偶像包袱吧
- 事件处理程序
- iOS中的Block