Ios 如何在Corespotlight搜索中显示消息和视频按钮?
我想在用户搜索联系人时显示消息和视频按钮我可以显示呼叫按钮,但无法显示消息和视频按钮 下面是我正在使用的一段代码Ios 如何在Corespotlight搜索中显示消息和视频按钮?,ios,objective-c,corespotlight,Ios,Objective C,Corespotlight,我想在用户搜索联系人时显示消息和视频按钮我可以显示呼叫按钮,但无法显示消息和视频按钮 下面是我正在使用的一段代码 CSSearchableItemAttributeSet * attributeSet = [[CSSearchableItemAttributeSet alloc] initWithItemContentType:(NSString *)kUTTyp
CSSearchableItemAttributeSet * attributeSet = [[CSSearchableItemAttributeSet alloc]
initWithItemContentType:(NSString *)kUTTypeItem];
attributeSet.displayName = [contact.name.compositeName capitalizedString];
attributeSet.contentDescription = @"my awesome Contacts ";
attributeSet.keywords = @[[contact.name.compositeName capitalizedString]];
UIImage *image = [UIImage imageNamed:@"dialer_filled_icn"];
NSData *imageData = [NSData dataWithData:UIImagePNGRepresentation(image)];
attributeSet.thumbnailData = imageData;
attributeSet.phoneNumbers = @[JustNumber([contact.phones[0] number])];
attributeSet.instantMessageAddresses = @[JustNumber([contact.phones[0] number])];
attributeSet.supportsPhoneCall = @(YES);
CSSearchableItem *item1 = [[CSSearchableItem alloc]
initWithUniqueIdentifier:JustNumber([contact.phones[0] number])
domainIdentifier:@"com.domain.appname"
attributeSet:attributeSet];
[[CSSearchableIndex defaultSearchableIndex] indexSearchableItems:@[item1]
completionHandler: ^(NSError * __nullable error) {
if (!error)
NSLog(@"Search item(s) journaled for indexing.");
}];
如有任何建议,将不胜感激