1

I am using UIActivityViewController to display sharing options. When the activity items array of the UIActivityViewController is set with asset URLs for photo assets, the UIActivityViewController shows options like mail, copy, facebook,etc. But when the activity items array of the UIActivityViewController is set with asset URLs for video assets, the UIActivityViewController is empty! However, if the activity items is set with URL of a local video file (ie. temporary directory), the UIActivityViewController shows some options. So the question is how should I initialise activity view controller for a video asset?

UIActivityViewController *activityVC = [[UIActivityViewController alloc]initWithActivityItems:selectedAssetsURL applicationActivities:nil];

[self presentViewController:activityVC
                   animated:YES
                 completion:nil];

In the above code, for example, when selected asset URL is "assets-library://asset/asset.mp4?id=FE12BF5E-5ACA-4E1A-8784-9A0C5A45E038&ext=mp4", the activity controller is empty. I ve tried with .mov and .m4v formats too. But if the URL of a photo asset is mentioned, options like copy, mail, Facebook, etc. are shown! Same is the case with the local URL of a video. Only for asset URL of a video, it is empty.

EDIT: This problem occurs only in iOS 6 I guess. In iOS 7, the UIActivityViewController was showing facebook and mail activity types when I set an asset URL as the activity item.

Anand
  • 115
  • 1
  • 12
  • Can you show your codes ? – Raptor Sep 02 '13 at 10:24
  • I found [this related question and I suspect Voromax's answer is the same in your case](http://stackoverflow.com/questions/12866012/uiactivity-and-avasset-data-type-usage). – Michael Dautermann Sep 02 '13 at 10:31
  • When I set activity item to be the URL of a local video file (e.g.: file://localhost/private/var/mobile/Applications/3E6AB34A-CA9A-49F3-9096-6FCC12C8C4AE/tmp/16FDE164-184D-47C3-A80A-B0F1B8ACC78B-95826-00000D9DC9E40CD7.mp4), UIActivityTypeMail and UIActivityTypeSaveToCameraRoll are displayed. If it is set to be an asset URL, even UIActivityTypeSaveToCameraRoll is not displayed. – Anand Sep 02 '13 at 10:59

1 Answers1

0

No, unfortunately it's not possible to do this yet.

You can only share videos facebook using UIActivityViewController in iOS 7.

Toseef Khilji
  • 17,192
  • 12
  • 80
  • 121