2017-01-04 11 views
0

IOSアプリケーションからFacebook(SLComposerなし)でビデオを共有しています。それは正常に送信されますが、私はそれをハッシュタグテキストを追加したい。私はそれを試してみましたが、ビデオと共有された追加はできません(ビデオのみが共有されます)。IOSでFacebook上のビデオとHashTagテキストを共有するには?

FBSDKShareVideo *ShareVideo = [FBSDKShareVideo videoWithVideoURL:appDelegateObj.finalVideoUrl]; 
ShareVideo.videoURL = appDelegateObj.finalVideoUrl; 
FBSDKShareVideoContent *ShareContnt = [[FBSDKShareVideoContent alloc] init]; 
ShareContnt.video = ShareVideo; 
ShareContnt.hashtag = [FBSDKHashtag hashtagWithString:[NSString stringWithFormat:@"%@",@"We are #sharing this #video for the #testing of #video and the #HashTag Text"]]; 
[FBSDKShareAPI shareWithContent:ShareContnt delegate:self]; 

この問題についてお手伝いしますか?

+0

ドキュメントを読むhttps://developers.facebook.com/docs/reference/ios/current/class/FBSDKHashtag /: '共有ダイアログで使用できる単一のハッシュタグを表します。'、 'stringRepresentationが有効なハッシュタグ(単一の '#'の後に1つ以上の単語文字を含む)であることを確認する責任があります。無効なハッシュタグはコンテンツの共有時に無視されます。あなたは有効なプロパティで有効性をチェックすることができます。あなたのは有効ではありません。 – Larme

+0

私はもっと素敵です。私はそれをどうやって行うのか?私は最後に6時間ここにこだわっています。 –

+0

docは、あなたは1つのハッシュタグしか持たないと言いますが、1つまたは複数のハッシュタグ=> "Hello"でそれを置くことはできません#自体に接頭辞が付きます)は動作しますが、 "こんにちは!"あなたの文字列は明らかに無効なので、バイパスされます。 – Larme

答えて

0

100%ワーキング 私はこれらのANSを得ました...

//これらのコード我々は唯一のシェアは、テキスト/タイトルまたはビデオの名前を送信することはできません...

を使用して - (無効)facbookSharng {

NSLog(@"Permission for sharing..%@",[FBSDKAccessToken currentAccessToken].permissions); 
if ([[FBSDKAccessToken currentAccessToken] hasGranted:@"contact_email"]) 
{ 
    FBSDKShareVideo *ShareVideo = [FBSDKShareVideo videoWithVideoURL:appDelegateObj.finalVideoUrl]; 
    ShareVideo.videoURL = appDelegateObj.finalVideoUrl; 
    FBSDKShareVideoContent *ShareContnt = [[FBSDKShareVideoContent alloc] init]; 
    ShareContnt.video = ShareVideo; 
    [FBSDKShareAPI shareWithContent:ShareContnt delegate:self] 

     // write the deleate methdo for post ID.. 
} 

}

//しかし、これらのFacebookのための別の方法を提供し、

NSLog(@ "共有の許可"%@ "、[FBSDKAccessToken currentAccessToken] .permissions); ([FBSDKAccessToken currentAccessToken]がhasGranted: "CONTACT_EMAIL" @])場合 {

NSData *videoData = [NSData dataWithContentsOfURL:appDelegateObj.finalVideoUrl]; 
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithCapacity:3L]; 

[params setObject:videoData forKey:@"video_filename.MOV"]; 
[params setObject:@"Title for this post." forKey:@"title"]; 
[params setObject:@"#Description for this post." forKey:@"description"]; 

[[[FBSDKGraphRequest alloc] initWithGraphPath:@"/me/videos" parameters:params HTTPMethod:@"POST"] 
startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) { 
    if (!error) { 
     //video posted 
     NSLog(@"Facebook sharing completed %@:",result); 
     strFbSocialPostId = [result valueForKey:@"id"];//post ID 
    } 
}]; 

}

関連する問題