CTCallCenter - Call Event Handler - In Background

As for the Apple documentation, there is no way to process the state of the phone while the application is paused: http://developer.apple.com/library/ios/#DOCUMENTATION/NetworkingInternet/Reference/CTCallCenter/Reference/Reference.html

"While it is suspended, your application does not receive call events"

Is this also true for the background? (Since the background state does not match the "paused" state of the application regarding the states described in the Apple documentation)

http://developer.apple.com/library/ios/#DOCUMENTATION/iPhone/Conceptual/iPhoneOSProgrammingGuide/ManagingYourApplicationsFlow/ManagingYourApplicationsFlow.html

I process the state of the phone using the following code:


CTCallCenter *callCenter = [[CTCallCenter alloc] init];

callCenter.callEventHandler=^(CTCall* call)
{

  //call state

};

callEventHandler, , , , , ( ( TCP) , )

!

+3
3

, , , callEventHandler, . , , .

, iOS . voip- voip UIBackgroundModes App-Info.plist.

+4

callEventHandler...

, apple dev, currentCalls , .

, ( ):

- (void)viewDidLoad {  
    [super viewDidLoad];

    _timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(phoneDetection) userInfo:nil repeats:YES];  
}  

- (void)phoneDetection {
    _callCenter = [[CTCallCenter alloc] init]; // Here is the important part : instanciating a call center each time you want to check !  

    [_callCenter setCallEventHandler:^(CTCall *call) {  
        NSLog(@"Call detected");  
    }];  

    NSLog(@"%@", _callCenter.currentCalls);  
}
+1

, , 10 .

Bluetooth, .

, . /bluetooth .

- "keepAlive" , - (push-, ..)

0

All Articles