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 If you try to share the actual file, you should see the If you just need to give message to your file instead of just opening another app, then custom for the code> for NSData object?
UIDocumentInteractionController
Need to use, it is designed to share entire files. UIActivityViewController
is for text and probably has an image UIActivity mfmailcomposeviewcontroller
and MFMessageComposeViewController
UIDocumentInteractionController
and other mail and for other messages (apple Developer):
Comments
Post a Comment