我正在使用 Facebook 的 SDKFBSDKShareOpenGraphObject
与FBSDKShareOpenGraphAction
“video.watches”类型共享一个。一切正常,帖子出现在 Facebook 提要上,但如果我点击应用程序的名称,我会收到错误消息。这是我用来分享的代码:
FBSDKShareOpenGraphObject *object = [FBSDKShareOpenGraphObject objectWithProperties:@{@"og:type": @"video.other",
@"og:title": @"TV Show",
@"og:image": @"http://cdn1.tnwcdn.com/wp-content/blogs.dir/1/files/2013/02/tv-set.jpg",
@"og:url": show_url}];
FBSDKShareOpenGraphAction *action = [[FBSDKShareOpenGraphAction alloc] init];
[action setActionType:@"video.watches"];
[action setObject:object forKey:@"video"];
[action setNumber:@(7200000) forKey:@"expires_in"];
FBSDKShareOpenGraphContent *content = [[FBSDKShareOpenGraphContent alloc] init];
[content setPreviewPropertyName:@"video"];
[content setAction:action];
_shareDialog = [[FBSDKShareDialog alloc] init];
_shareDialog.fromViewController = [self.delegate collectionViewControllerForCell:self];
_shareDialog.shareContent = content;
_shareDialog.delegate = self;
if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"fbauth2://"]]){
_shareDialog.mode = FBSDKShareDialogModeNative;
} else {
_shareDialog.mode = FBSDKShareDialogModeAutomatic;
}
[_shareDialog show];
结果:
但是当我点击电视频道(盒装的)时,我收到了这个错误:
我想在点击该文本时打开本机应用程序,就像在照片上的“X 在 Instagram 上发布照片”中点击它的名称时打开 Instagram 一样。我在 developer.facebook.com 上的应用程序设置中配置了 Bundle ID 和 iPhone Store ID,但没有成功。我错过了什么?