iOS监听电话铃声响起,挂断的方法

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

可以监听有电话来时候的一些状态
#import <coretelephony ctcallcenter.h="">  
#import <coretelephony ctcall.h="">  
-(void)detectCall  
  {  
       CTCallCenter *callCenter = [[CTCallCenter alloc] init];  
      callCenter.callEventHandler=^(CTCall* call)  
      {  
          if (call.callState == CTCallStateDisconnected)  
          {  
              NSLog(@"Call has been disconnected");  

          }  
          else if (call.callState == CTCallStateConnected)  
          {  
              NSLog(@"Call has just been connected");  
          }  

          else if(call.callState == CTCallStateIncoming)  
          {  
              NSLog(@"Call is incoming");  

          }  

          else if (call.callState ==CTCallStateDialing)  
          {  
              NSLog(@"call is dialing");  
          }  
          else
          {  
              NSLog(@"Nothing is done");  
          }  
      };  
  }  </coretelephony></coretelephony>