1

アプリで作成したビデオがあります。このビデオを 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];

これは、ビデオの投稿に関する限りうまく機能します。しかし、共有/プレビューダイアログを表示したいです。誰もそれを成し遂げる方法について何かヒントを得ましたか?

4

1 に答える 1

1

自分で何かを作成するか、github (または同様のもの) で既存のソリューションを検索する必要があります。ユーザーがテキストを入力できるようにするカスタムアラートビューのようなもので、タップすると再生されるビデオのサムネイルといくつかのボタンがあります。

于 2013-08-06T06:55:45.813 に答える