从Facebook Feed打开原生iOS应用程序

时间:2016-07-12 14:48:34

标签: ios facebook facebook-graph-api fbsdk fbsdksharekit

我正在使用Facebook的SDK与FBSDKShareOpenGraphObject类型“video.watches”共享FBSDKShareOpenGraphAction。一切顺利,帖子出现在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];

结果:

sharing result

但是当我点击电视频道(盒装电视频道)时,我收到了这个错误:

enter image description here

当我点击该文本时,我想打开原生应用程序,就像Instagram在照片上点击“X在Instagram上发布了一张照片”中的名字时打开的方式一样。我在developer.facebook.com上的应用程序设置中配置了Bundle ID和iPhone Store ID,但没有成功。我缺少什么?

1 个答案:

答案 0 :(得分:0)

访问developers.facebook.com并确保您的应用未处于测试模式。 转到“App Review” - >公开? 并将其标记为是。

如果您尚未准备公开,请将您正在使用的Facebook用户添加到“角色”下的应用测试人员。