user1800529
user1800529

Reputation: 91

Open in my app for (xlsx,ppt,pptx.docx) from the safari or mail not working

I am using iOS 5.1 sdk for developing my app, but the "Open In" is not working for pptx, ppt, docx, xlsx. Can somebody give me the setting for info.plist? I am using com.microsoft.word.doc, com.microsoft.excel.xls, com.microsoft.powerpoint.ppt for the document type.

CFBundleTypeIconFiles CFBundleTypeName Microsoft PowerPoint presentation CFBundleTypeRole Viewer LSHandlerRank Alternate LSItemContentTypes com.microsoft.powerpoint.​ppt com.microsoft.powerpoint.​pptx CFBundleTypeIconFiles CFBundleTypeName Excel Document CFBundleTypeRole Viewer LSHandlerRank Alternate LSItemContentTypes com.microsoft.excel.xls com.microsoft.excel.xlsx

Upvotes: 2

Views: 1792

Answers (1)

user1800529
user1800529

Reputation: 91

NSArray *extensionArray = [NSArray arrayWithObjects:@"doc", @"docx", @"ppt", @"pptx", @"xls", @"xlsx",@"mp3",@"mp4",@"rft",@"rtf",@"pages",@"key",@"numbers",nil];

   for (int i=0; i<[extensionArray count]; i++) {
       NSString *fileExtension = [extensionArray objectAtIndex:i];
       NSString *utiString = (__bridge NSString *)UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension,(__bridge CFStringRef)fileExtension,NULL);
       NSLog(@"Extension: %@ UTI:%@",fileExtension,utiString);
   }

We can use this code to print the proper UTI.

Upvotes: 4

Related Questions