[英]How can i attach a video file to Publish on Facebook with iOS8 Social Framework Swift
I am currently following this Topic: Social Framework iOS 8 swift and I have successfully finished it. 我目前正在关注这个主题: Social Framework iOS 8 swift,并且我已经成功完成了它。
Here is my complete code in Swift: 这是我在Swift中完整的代码:
import Social
and 和
@IBAction func shareFB(sender : AnyObject) {
if(SLComposeViewController.isAvailableForServiceType(SLServiceTypeFacebook))
{
var SocialMedia :SLComposeViewController = SLComposeViewController(forServiceType: SLServiceTypeFacebook)
SocialMedia.completionHandler = {
result -> Void in
var getResult = result as SLComposeViewControllerResult;
switch(getResult.toRaw()) {
case SLComposeViewControllerResult.Cancelled.toRaw(): println("Cancelled")
case SLComposeViewControllerResult.Done.toRaw(): println("It's Work!")
default: println("Error!")
}
self.dismissViewControllerAnimated(true, completion: nil)
}
self.presentViewController(SocialMedia, animated: true, completion: nil)
SocialMedia.setInitialText("Test a Post on Facebook")
}
}
If I want to attach or upload a video file to Publish on Facebook by Social Framework, how or not possible? 如果我想附加或上传视频文件以通过Social Framework在Facebook上发布,怎么办? if not What should I do? 如果没有,我该怎么办? Thanks in advance for the answers. 预先感谢您的回答。
You can only add text, urls and image. 您只能添加文本,URL和图像。
Look on the Compose Post Section here for more information. 有关更多信息,请参见此处的撰写帖子部分。
https://developer.apple.com/library/prerelease/ios/documentation/NetworkingInternet/Reference/SLComposeViewController_Class/index.html#//apple_ref/c/tdef/SLComposeViewControllerCompletionHandler https://developer.apple.com/library/prerelease/ios/documentation/NetworkingInternet/Reference/SLComposeViewController_Class/index.html#//apple_ref/c/tdef/SLComposeViewControllerCompletionHandler
What you will have to share is the video url. 您必须分享的是视频网址。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.