我已经在plist文件中完成了所需的键,如下面的文档所述
- 打开应用程序的信息。plist文件。
- 在关键字段"Required background modes"中增加了新的行和类型。
- 展开这个数组,对于项目0,在Value字段中输入"App plays voip"
// To get call status set notification
self.callCenter = [[CTCallCenter alloc] init];
self.callCenter.callEventHandler = ^(CTCall* call) {
// anounce that we've had a state change in our call center
NSDictionary *dict = [NSDictionary dictionaryWithObject:call.callState forKey:@"callState"];
[[NSNotificationCenter defaultCenter] postNotificationName:@"CTCallStateDidChange" object:self userInfo:dict];
};
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(ctCallStateDidChange:) name:@"CTCallStateDidChange" object:nil];
即使设置了voip的plist值,当我从iphone拨打电话时,我也没有在我的应用程序中得到上述呼叫通知
请告诉我,我错过了什么,为什么我没有收到任何通知
期待您的宝贵意见
非常简单,您只需在xxx_info设置一些值。Plist,告诉系统你的应用是那些类型。详情请见帮助。
但是请注意,如果你的应用工作不像你说的那样,苹果会拒绝你的应用。