2

我是 iPhone 应用程序开发的新手。现在我正在为 iPhone 开发应用程序 在这个应用程序中,我需要将视频上传到 Facebook。我在下面的代码中使用。现在输入 Facebook 的用户名和密码。显示错误消息警报。like safari 无法打开页面,因为地址无效。

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


                //@"com.facebook.samples.VideoUploadTest"];
    facebook.sessionDelegate = self;

}

- (IBAction)buttonClicked:(id)sender {
    NSArray* permissions = [[NSArray alloc] initWithObjects:
                            @"publish_stream", nil];
    [facebook authorize:permissions delegate:self];
    [permissions release];
}

- (void)fbDidLogin {
    NSString *filePath = [[NSBundle mainBundle] pathForResource:@"sample" ofType:@"mov"];
    NSData *videoData = [NSData dataWithContentsOfFile:filePath];
    NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                   videoData, @"video.mov",
                                   @"video/quicktime", @"contentType",
                                   @"Video Test Title", @"title",
                                   @"Video Test Description", @"description",
                                   nil];
    [facebook requestWithGraphPath:@"me/videos"
                         andParams:params
                     andHttpMethod:@"POST"
                       andDelegate:self];
}

从此网址引用[http://developers.facebook.com/blog/post/532/]

4

1 回答 1

1

有关 SSO 设置,请参阅此处。

http://developers.facebook.com/docs/mobile/ios/build/

于 2012-06-16T08:45:56.997 回答