gpt4 book ai didi

ios - 如何在 CoreSpotlight 的搜索结果中添加调用按钮?

转载 作者:行者123 更新时间:2023-11-29 01:36:53 25 4
gpt4 key购买 nike

在 WWDC session 中搜索 API 简介。他们显示带有调用按钮的 Airbnb 应用程序的搜索结果。据我所见,我认为结果是使用 CSSearchableItemAttributeSet 创建的,而不是来自 Web Markup api。我尝试将 CSSearchableItemAttributeSet 的 ItemContentType 设置为 kUTTypeItemkUTTypeMessagekUTTypeEmailMessage 当然还有 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];

enter image description here

最佳答案

试试这个:

attributeSet.supportsPhoneCall = @(YES);

关于ios - 如何在 CoreSpotlight 的搜索结果中添加调用按钮?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32862944/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com