挂断的秘籍

2019-05-13 作者:www.bifa365365.com   |   浏览(130)

能够侦测有电话来时候的局部景况

#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>
//该片段来自于http://outofmemory.cn

本文由www.bifa365365.com发布于www.bifa365365.com,转载请注明出处:挂断的秘籍

关键词: www.bifa3653