通过适用于iOS的FB SDK向facebook共享视频

通过适用于iOS的FB SDK向facebook共享视频,ios,facebook,facebook-graph-api,ios6,Ios,Facebook,Facebook Graph Api,Ios6,我在我的应用程序中创建了一个视频。 我想通过Facebook原生SDK将此视频共享到用户的Facebook墙。 我可以让视频共享正常工作,但在共享之前没有向用户显示预览/共享对话框。视频直接发布到用户的墙上。 这是我打开活动会话的代码 [FBSession openActiveSessionWithPublishPermissions:permissions defaultAudience:FBSessionDefaultAudienceOnlyMe allowLoginUI:YES compl

我在我的应用程序中创建了一个视频。 我想通过Facebook原生SDK将此视频共享到用户的Facebook墙。 我可以让视频共享正常工作,但在共享之前没有向用户显示预览/共享对话框。视频直接发布到用户的墙上。 这是我打开活动会话的代码

[FBSession openActiveSessionWithPublishPermissions:permissions defaultAudience:FBSessionDefaultAudienceOnlyMe allowLoginUI:YES completionHandler:^(FBSession *session, FBSessionState status, NSError *error){}
一旦我激活了会话,我就调用下面的方法来共享视频

- (void)sendVideoFeedRequestWithParams:(NSMutableDictionary *)params
{
// create the connection object
FBRequestConnection *newConnection = [[FBRequestConnection alloc] init];

// create a handler block to handle the results of the request
FBRequestHandler handler =
^(FBRequestConnection *connection, id result, NSError *error) {
    // output the results of the request
    [self requestCompleted:connection result:result error:error];
};

// create the request object, using the /me as the graph path
FBRequest *request = [[FBRequest alloc] initWithSession:FBSession.activeSession graphPath:@"me/videos" parameters:params HTTPMethod:@"POST"];

// add the request to the connection object, if more than one request is added
// the connection object will compose the requests as a batch request; whether or
// not the request is a batch or a singleton, the handler behavior is the same,
// allowing the application to be dynamic in regards to whether a single or multiple
// requests are occuring
[newConnection addRequest:request completionHandler:handler];

// if there's an outstanding connection, just cancel
[self.requestConnection cancel];

// keep track of our connection, and start it
self.requestConnection = newConnection;
[newConnection start];

}
我发送给此方法的参数是:

NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                               videoData, @"video.mov",
                               @"video/quicktime", @"contentType",
                               @"Video Test Title", @"title",
                               @"Video Test Description", @"description",
                               nil];
就发布视频而言,这很有效。但是,我希望显示一个共享/预览对话框。
有人知道如何完成吗?

你需要自己创建一些东西,或者在github(或类似平台)上搜索现有的解决方案。类似于自定义警报视图,您可以允许用户输入文本、点击时播放的视频缩略图和几个按钮。

您需要自己创建一些内容或在github(或类似网站)上搜索现有解决方案。类似于自定义警报视图,您可以在其中允许用户输入文本、点击时播放的视频缩略图和几个按钮。

谢谢您的回复。只能这样走。谢谢你的回复。只能这样。请在这里用新的facebook SDK检查。请在这里用新的facebook SDK检查