相关疑难解决方法(0)

iOS 5 - CTCallCenter不适合我

我的手机:iOS 5.1.1越狱使用Absynth2

我正在尝试做什么: 检测来电或拨打电话时...

好的,这是我的代码,我放在AppDelegate下面didEnterBackground,也试过didResignActive- 我没有得到任何错误,但我也没有得到任何结果..

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];
Run Code Online (Sandbox Code Playgroud)

任何帮助表示赞赏.谢谢!

iphone xcode jailbreak ios core-telephony

1
推荐指数
1
解决办法
6236
查看次数

标签 统计

core-telephony ×1

ios ×1

iphone ×1

jailbreak ×1

xcode ×1