在iOS 7之前,我能够显示带有相关联系信息的ABPersonViewController,并通过点击手机信箱,我可以拨打电话。在我现在正在测试的iOS 8.3中,这不起作用。 然而,点击电子邮件单元格打开邮件应用程序,点击网站单元格打开safari并点击地址单元格按预期打开地图。 这是我用来创建ABPersonViewController实例的代码:
$$hashKey: "object:41"
_embedded: Object
_links: Array[0]
comment: Object
commentFormVisible: true
commentform: "test"
createdAt: Object
id: 134
resource: Object
text: "f"
total_comments: 0
__proto__: Object
如何在iOS 8和9中的ABPersonViewController中启用电话呼叫?
答案 0 :(得分:0)
从iOS 9开始,我们需要使用以下代码。因为旧的被弃用了!
CNMutableContact*conDetails=[[CNMutableContact alloc]init];
if ([conDetails.phoneNumber length]!=0) {
conDetails.phoneNumbers=[[NSArray alloc]initWithObjects:[CNLabeledValue labeledValueWithLabel:CNLabelPhoneNumberMain value:[CNPhoneNumber phoneNumberWithStringValue:@"your phonenumber"]], nil];
}
}