gpt4 book ai didi

objective-c - 如何在 IOS 中将 HashTag 文本与 Facebook 上的视频分享?

转载 作者:行者123 更新时间:2023-12-04 03:15:28 25 4
gpt4 key购买 nike

我正在通过我的 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(@"分享权限..%@",[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
}
}];

关于objective-c - 如何在 IOS 中将 HashTag 文本与 Facebook 上的视频分享?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41465188/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com