CoreSpotlight thumbnail image not showing up in Spotlight search

I am trying to make my app searchable with Core Spotlight. Everything works fine, the name and description come, but without thumbnails.

here is what i am trying:

CSSearchableItemAttributeSet *attributeSet = [[CSSearchableItemAttributeSet alloc]initWithItemContentType:(NSString *)kUTTypeImage]; attributeSet.title = @"My First Spotlight Search"; attributeSet.contentDescription = @"This is my first spotlight Search"; attributeSet.keywords = [NSArray arrayWithObjects:@"Hello", @"Welcome",@"Spotlight", nil]; UIImage *image = [UIImage imageNamed:@"searchIcon.png"]; NSData *imageData = [NSData dataWithData:UIImagePNGRepresentation(image)]; attributeSet.thumbnailData = imageData; CSSearchableItem *item = [[CSSearchableItem alloc]initWithUniqueIdentifier:@"com.deeplink" domainIdentifier:@"spotlight.sample" attributeSet:attributeSet]; [[CSSearchableIndex defaultSearchableIndex] indexSearchableItems:@[item] completionHandler: ^(NSError * __nullable error) { if (!error) NSLog(@"Search item indexed"); }]; 
+8
ios objective-c ios9 corespotlight
source share
1 answer

The iOS 9 beta 1 release notes indicate that thumbnails do not yet work for search results. See: https://developer.apple.com/library/prerelease/ios/releasenotes/General/RN-iOSSDK-9.0/index.html

+8
source share

All Articles