IOS 如何在 Facebook 上用视频分享 HashTag 文本?
How to share HashTag Text with Video On Facebook in IOS?
我正在通过我的 IOS 应用程序在 Facebook 上分享视频(没有 SLComposer)。它会成功发送,但我想用它添加标签文本。我正在尝试,但它不会与视频共享(仅共享视频)。
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];
请帮我解决这个问题?
100% 工作
我得到了这些的 ANS...
//使用这些我们只分享的代码不能发送视频的文本/标题或名称...
-(void)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(@"Permission for sharing..%@",[FBSDKAccessToken currentAccessToken].permissions);
if ([[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
}
}];
}
我正在通过我的 IOS 应用程序在 Facebook 上分享视频(没有 SLComposer)。它会成功发送,但我想用它添加标签文本。我正在尝试,但它不会与视频共享(仅共享视频)。
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];
请帮我解决这个问题?
100% 工作 我得到了这些的 ANS...
//使用这些我们只分享的代码不能发送视频的文本/标题或名称...
-(void)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(@"Permission for sharing..%@",[FBSDKAccessToken currentAccessToken].permissions); if ([[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
}
}];
}