标签:
#import <CoreTelephony/CTCallCenter.h> #import <CoreTelephony/CTCall.h> /// 监听拨打电话状态 _callCenter = [[CTCallCenter alloc] init]; _callCenter.callEventHandler=^(CTCall* call) { if (call.callState == CTCallStateDisconnected) { NSLog(@"挂断电话"); } else if (call.callState == CTCallStateConnected) { NSLog(@"电话刚连接通"); } else if(call.callState == CTCallStateIncoming) { NSLog(@"有电话打进来"); } else if (call.callState ==CTCallStateDialing) { NSLog(@"拨打电话"); } else { NSLog(@"Nothing is done"); } };
标签:
原文地址:http://www.cnblogs.com/joesen/p/4690103.html