如果我想在iPhone的Facebook中发布视频,此代码中的更改内容是什么? [英] what to change in this code If I want to post videos in Facebook in iPhone?

查看:100
本文介绍了如果我想在iPhone的Facebook中发布视频,此代码中的更改内容是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Facebook上上传视频.

I want to upload video on Facebook .

为此,我使用的是旧代码,但不允许我在Facebook中发布视频.

for this I am using my this old code , but it is not allow me to post videos in Facebook .

- (id)initWithImage:(UIImage *)upload_image {

if (self = [super init]) {
    self.uploadImage = upload_image;
}
return self;
}

/** *这样,该类可以轻松扩展到其他文件 *作为FB的类型允许我们将其上传到图形中... *几乎没有修改任何代码 **/

/** * this way the class is easily extensible to other file * types as FB allows us to upload them into the graph... * with little if any modification to the code **/

- (void)appendDataToBody:(NSMutableData *)body {

/**
 * Facebook Graph API only support images at the moment, surely videos must occur soon.
 **/

        NSData *picture_data = UIImagePNGRepresentation(uploadImage);
[body appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"media\";\r\nfilename=\"media.png\"\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:picture_data];

}

谁能告诉我在这里我应该改变什么?将该视频发布到Facebook?

Can anyone tell me what should I change here ? to post the video in Facebook?

推荐答案

您可以下载下面链接中提供的官方视频上传教程

you can download the official video upload tutorial given to below link

视频上传的官方演示

并更改为在其上创建的API密钥

And change into the API key which is created onto

https://developers.facebook.com

在其中复制API密钥并放入以下方法

Form there copy API key and put into following method

- (void)viewDidLoad
{
    facebook = [[Facebook alloc] initWithAppId:@"Your Key"];
}

然后也更改为plist文件

And Also change into plist file also

感谢和问候,

霓虹灯塞缪尔

这篇关于如果我想在iPhone的Facebook中发布视频,此代码中的更改内容是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆