Welcome to the iMore Forums Create Your Account or Ask a Question Answers in 5 minutes - no registration required!
Results 1 to 1 of 1
  1. Thread AuthorThread Author   #1  
    jailbreakR's Avatar
    iPhone Nanite

    1 Posts

    Question CTCallCenter

    What am I doing wrong?

    I don't get any error but I don't see anything happening either...

    I'm trying to figure out when the user is dialing so i can see what number they are dialing..

    I want my app to be activated when a certain number is dialed...

    i put this code in my DidResignActive (even tried it it didEnterBackground)

    callCenter = [[CTCallCenter alloc] init]; [callCenter setCallEventHandler:^(CTCall *call) { NSDictionary *dict = [NSDictionary dictionaryWithObject:call.callState forKey:@"callState
    ; [[NSNotificationCenter defaultCenter] postNotificationName:@"CTCallStateDidChange" object:nil userInfo:dict]; NSLog(@"state changed on call: %@", call); [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(callReceived name:CTCallStateIncoming object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(callEnded name:CTCallStateDisconnected object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(callConnected name:CTCallStateConnected object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(callDial name:CTCallStateDialing object:nil]; }];"]

Tags for this Thread

Posting Permissions