在这里,我想在应用程序打开时阻止呼叫,但是当获取呼叫信息地址为0x0时会出现问题。
我检索这样的来电者信息:
NSDictionary *info = (NSDictionary*)userInfo;
NSString *state=[info[@"kCTCallStatus"] stringValue];
CTCall *call = (CTCall *)info[@"kCTCall"];
NSString *caller = CTCallCopyAddress(NULL, call);
NSLog(@"Phone Number: %@",caller);
CTCallDisconnect(call);
响应就像:
{status = 4,type = 0x1,subtype = 0x1,uuid = 0x16e2fe20 [**],地址= 0x0,externalID = -1,start = 2.22507e-308,会话开始= 4.83562e + 08,结束= 2.22507e-308,audioToneRelay = 0,setupAudioInterruption = 1,deviceOriginatedEnd = 0}
打印来电者1的说明: 零