iOS 7 alternative to CTCall?

别等时光非礼了梦想. 提交于 2019-12-02 17:47:12

I think it requires you to sign your app with com.apple.coretelephony.Calls.allow entitlement. I found it in SpringBoard binary. Apple added a whole bunch of new entitlements. So we should expect that many APIs will not work without them. Just for CoreTelephony alone there is four entitlements in SpringBoard.

I asked the same question here in stackoverflow 2 hours after your post... A first look at the class dump (https://github.com/EthanArbuckle/IOS-7-Headers/blob/master/Frameworks/CoreTelephony.framework/CTCall.h) shows, that this function is missing...

Actually I've tried the same as vualoaithu and got no luck. But I've also tried to use other methods of TUCallCenter object and looks like it works fine. For example following method works:

TUCallCenter *callCenter = [TUCallCenter sharedInstance];
if(callCenter) {
    NSLog(@"callCenter is created!");
    //Working part
    if([callCenter inCall]){
        NSLog(@"IN CALL"); // when you press answer button and can talk
    }else{
        NSLog(@"NOT IN CALL"); // other cases
    }
}

Also I've tried following:

    TUPhoneNumber* phoneNumber =
    [TUPhoneNumber phoneNumberWithDigits:@"55555555"
                             countryCode:@"1"];
if(phoneNumber) {
    NSLog(@"Phone Number obj = %@",phoneNumber);
    NSLog(@"Phone Number = %@",phoneNumber.digits);
    NSLog(@"Country Code = %@",phoneNumber.countryCode);
}
[callCenter dial:phoneNumber service:0];

But I got exception:

[TUPhoneNumber length]: unrecognized selector sent to instance 0x14dcefd0

Looks Like we are on the way. If someone will find solution. Please post it here. Thanks.

you can use

[[UIApplication sharedApplication] openURL: [NSURL URLWithString:[NSString stringWithFormat:@"tel:%@",num]]];

But you can't close call screen when call finished

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!