在WWDC会话中,搜索API简介。他们用一个呼叫按钮显示了Airbnb应用程序的搜索结果。据我所见,我认为结果是用CSSearchableItemAttributeSet创建的,而不是用Web Markup api创建的。我尝试将CSSearchableItemAttributeSet的ItemContentType设置为kUTTypeItem,kUTTypeMessage,kUTTypeEmailMessage,当然还有phoneNumbers值。它们似乎都不起作用。我输入的所有详细信息都正确显示,但呼叫按钮除外。
CSSearchableItemAttributeSet *attributeSet = [[CSSearchableItemAttributeSet alloc] initWithItemContentType:(__bridge NSString *)kUTTypeItem];
attributeSet.title = @"Call me back";
attributeSet.contentDescription = @"Firstname Lastname\n14:36 - 30 January 2014";
attributeSet.phoneNumbers = @[@"+66827364538"];
attributeSet.accountHandles = @[@"+66827364538"];如果我使用kUTTypeContent的话。呼叫按钮出现,但没有显示所有详细信息。我在创建CSPerson对象时输入的联系人的名称。
CSPerson *person = [[CSPerson alloc] initWithDisplayName:@"Theptai Intathep"
handles:@[@"+66827364538"]
handleIdentifier:CNContactPhoneNumbersKey];
attributeSet.authors = @[person];

发布于 2015-11-02 11:02:31
试试这个:
attributeSet.supportsPhoneCall = @(YES);
https://stackoverflow.com/questions/32862944
复制相似问题