1
votes

I successfully integrated Facebook SDK 3.1 in my app, and I'm trying to propose iOS6+ only features to iOS6+ users. I was able to show the share sheet, but I was quite disapointed when I saw what the post on my wall looked like. Here is an image to describe what I mean :

The first one is what is got from a pre-iOS6 dialog (the web popup), and the second one is got from the new iOS6+ Native Facebook Dialog (SLComposeViewController, in other words).

My questions are :

Is there a way to make the second post look like the first one using FacebookNativeDialog ? Is it possible to give a params Dictionary like before so the post will display correctly "via {myAppName}" ? Or is it simply the new way of showing posts, and the older way is deprecated ?

1

1 Answers

1
votes

Two things:

1/ "via iOS" attribution - This is currently per design and cannot be customized for your app.

2/ Having the same look - you can get this by providing only the link when setting up the composer (i.e. don't provide the image):

SLComposeViewController *fbVC = [SLComposeViewController
                                 composeViewControllerForServiceType:SLServiceTypeFacebook];

[fbVC setCompletionHandler:^(SLComposeViewControllerResult result) {
    if (result == SLComposeViewControllerResultCancelled) {
        NSLog(@"Canceled");
    } else if (result == SLComposeViewControllerResultDone) {
        NSLog(@"Posted");
    }
}];
[fbVC addURL:[NSURL URLWithString:@"https://developers.facebook.com/ios"]];
[self presentViewController:fbVC animated:YES completion:nil];

The key to getting the same look is that the page linked to has Open Graph tags that Facebook can recognize to properly display the data. You can test if the OG tags are good by entering the link into https://developers.facebook.com/tools/debug

If the page does not have OG tags, the link will simply be displayed.