ios - UIActivityViewController with NSURL to audio file only shows airdrop -


I try to use UIActivityViewController to share an audio file (.aac) I am here. This is a temporary file that I have written in the sandboxed document directory.

I pass NS URL to initWithActivityItem: method.

[AUDIODETA instrument file: [urlToAudioFile path] OPTION: NSDTVViewingPiloting error: & amp; Error]; UIActivityViewController * Activity = [[UIActivityViewController alloc] initWithActivityItems: @ [urlToAudioFile] Application Display: Zero]; [Self.view.window.rootViewController presentViewController: Activity Animated: Yes Completed: ^ {...}];

When I press the share button, it takes a few seconds and activity sheet is the only option which is the airdrope.

How can I show other options like email or iMessage? Is there a call back method, so that when I finish the "sharing" I can decide to remove the temporary file again?

Is there any way to add any audio file without first typing it on disk? Can not I just pass the NSData object?

If you try to share the actual file, you should see the UIDocumentInteractionController Need to use, it is designed to share entire files. UIActivityViewController is for text and probably has an image

If you just need to give message to your file instead of just opening another app, then custom UIActivity mfmailcomposeviewcontroller and MFMessageComposeViewController

for the code> for UIDocumentInteractionController and other mail and for other messages (apple Developer):


Comments