I am trying to use the UIActivityViewController to share an audio file (.aac). This is a temporary file that I wrote in the isolated documents directory.
I pass NSURL in the initWithActivityItem: .
[audioData writeToFile:[urlToAudioFile path] options:NSDataWritingFileProtectionNone error:&error]; UIActivityViewController *activity = [[UIActivityViewController alloc] initWithActivityItems:@[urlToAudioFile] applicationActivities:nil]; [self.view.window.rootViewController presentViewController:activity animated:YES completion:^{ ... }];
When I click the sharing button, it takes a few seconds, and an activity sheet pops up, the only option of which is Airdrop.
How can I get other options like email or iMessage? Is there a callback method so that I can determine when the βsharingβ is over so that I can delete the temporary file again?
Is there a way to add an audio file without having to burn it to disk? Can't I just pass the NSData object NSData ?
ios ios7 uiactivityviewcontroller
Joseph
source share