1
我正在發送音頻文件到其他應用程序。用UIActivityViewController發送音頻
如果我只提供文件的URL,我可以向空投,郵件和消息應用
NSURL *url = [[NSURL alloc]initFileURLWithPath:file];
NSArray *objectsToShare = @[url];
UIActivityViewController *controller = [[UIActivityViewController alloc] initWithActivityItems:objectsToShare applicationActivities:nil];
// Present the controller
[self presentViewController:controller animated:YES completion:nil];
如果我添加文件名的對象分享我也可以發送到剪貼板
...
NSArray *objectsToShare = @[@"filename.m4a", url];
...
但我怎樣才能發送它接受音頻文件的其他應用程序? 例如,我的應用程序接受「public.audio」,並由發送音頻文件的其他應用程序列出。