ios-使用FBSDKShareDialog在Facebook上共享视频
我有一个应用程序,可以在facebook的墙上分享摄像头滚动的最后一段视频 我使用的代码是:ios-使用FBSDKShareDialog在Facebook上共享视频,ios,objective-c,fbsdk,Ios,Objective C,Fbsdk,我有一个应用程序,可以在facebook的墙上分享摄像头滚动的最后一段视频 我使用的代码是: PHFetchOptions *fetchOptions = [[PHFetchOptions alloc] init]; [fetchOptions setSortDescriptors:[NSArray arrayWithObjects:[NSSortDescriptor sortDescriptorWithKey:@"creationDate" ascending:fals
PHFetchOptions *fetchOptions = [[PHFetchOptions alloc] init];
[fetchOptions setSortDescriptors:[NSArray arrayWithObjects:[NSSortDescriptor sortDescriptorWithKey:@"creationDate" ascending:false], nil]];
PHFetchResult *fetchResult = [PHAsset fetchAssetsWithMediaType:PHAssetMediaTypeVideo options:fetchOptions];
NSString *videoIdentifier = @"";
if(fetchResult != nil) {
if ([fetchResult count] > 0) {
if ([[fetchResult firstObject] isKindOfClass: [PHAsset class]]) {
videoIdentifier = [((PHAsset *)[fetchResult firstObject]) localIdentifier];
NSArray *array = [videoIdentifier componentsSeparatedByString:@"/"];
NSString *urlAssetString = [NSString stringWithFormat:@"assets-library://asset/asset.MOV?id=%@&ext=MOV", array.firstObject];
FBSDKShareDialog *shareDialog = [[FBSDKShareDialog alloc] init];
NSURL *videoURL = [NSURL URLWithString:urlAssetString];
FBSDKShareVideo *video = [[FBSDKShareVideo alloc] init];
video.videoURL = videoURL;
FBSDKShareVideoContent *content = [[FBSDKShareVideoContent alloc] init];
content.video = video;
shareDialog.shareContent = content;
shareDialog.delegate = self;
[shareDialog show];
}
}
}
问题是:
1) 它不会在应用程序中打开共享对话框,而是打开facebook应用程序
2) 当我确认共享时,一个带有微调器的黑屏出现。当微调器达到100%进度时,它将保留在屏幕上。没有调用任何委托方法
3) 文章结尾未共享/未显示在墙上
我该怎么办?如果我在应用程序中没有Facebook登录来授予在墙上发表文章的权限,这有什么不对吗
据我所知,你不能使用ios内置的漂亮socail功能来共享视频,只能使用图片和文本,你必须使用FBSDK打开应用程序或safari。。。我知道这很糟糕!好的,但是为什么旋转器仍然卡在那里,还有没有共享的帖子呢?