8

I'm sharing a FBSDKShareOpenGraphObject with an FBSDKShareOpenGraphAction of type "video.watches" using the Facebook's SDK. Everything goes fine, the post appears on the Facebook feed but if I tap on the application's name I get an error. This is the code I'm using for sharing:

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];

The result:

sharing result

But when I tap on TV Channel (the boxed one) I get this error:

enter image description here

I'd like to open the native application when I tap on that text, in the same way Instagram opens when you tap on it's name in the "X posted a photo on Instagram" on a photo. I configured the Bundle ID and the iPhone Store ID in application's settings, on developer.facebook.com, but no success. What I am missing?

ov1d1u
  • 958
  • 1
  • 17
  • 38
  • Can you show the value of the URL that it attempts to open when you click 'TV Channel' ? – Eric Murphey Jul 15 '16 at 14:35
  • When I click it in a desktop browser it goes to the "Site URL" configured in the app's settings. When I click it in a mobile browser (Safari on iOS) it goes to http://m.facebook.com/appcenter/fb_id_of_the_app. Unfortunately I don't see any way to get the URL when opening the link in the Facebook app (as it opens inside the app). – ov1d1u Jul 19 '16 at 14:12

1 Answers1

0

Go to developers.facebook.com and make sure your app is not in test mode. Go to "App Review" -> Make public? And mark it as yes.

If you are not ready to make it public, add the facebook user you are using to the testers of the app under "Roles".

mesh
  • 113
  • 5