1. 关于iPhone系统电话事件监听
#import <CoreTelephony/CTCallCenter.h> #import <CoreTelephony/CTCall.h> - (void)listenCallEvent { CTCallCenter *callCenter = [[CTCallCenter alloc] init]; [callCenter setCallEventHandler:^(CTCall *call) { if (call.callState == CTCallStateConnected) { NSLog(@"Call has been connected!"); } else if (call.callState == CTCallStateDisconnected) { NSLog(@"Call has been disconnected!"); } else if (call.callState == CTCallStateIncoming) { NSLog(@"Call is incoming!"); } else if (call.callState == CTCallStateDialing) { NSLog(@"Call is dialing!"); } else { NSLog(@"None State!"); } }]; }// listenCallEvent