简体   繁体   English

不错的旧Facebook对话帖子VS iOS6本机对话帖子

[英]Nice old facebook dialog posts VS iOS6 Native dialog posts

I successfully integrated Facebook SDK 3.1 in my app, and I'm trying to propose iOS6+ only features to iOS6+ users. 我已成功将Facebook SDK 3.1集成到我的应用中,并且试图向iOS6 +用户推荐仅iOS6 +的功能。 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). 第一个是从iOS6之前的对话框(Web弹出窗口)中获得的,第二个是从新的iOS6 +本机Facebook对话框(即SLComposeViewController)获得的。

My questions are : 我的问题是:

Is there a way to make the second post look like the first one using FacebookNativeDialog ? 有没有办法使用FacebookNativeDialog使第二篇帖子看起来像第一篇帖子? Is it possible to give a params Dictionary like before so the post will display correctly "via {myAppName}" ? 是否可以像以前一样给定params字典,以便帖子将正确显示“通过{myAppName}”? Or is it simply the new way of showing posts, and the older way is deprecated ? 还是仅仅是显示帖子的新方法而已淘汰旧的方法?

Two things: 两件事情:

1/ "via iOS" attribution - This is currently per design and cannot be customized for your app. 1 /“通过iOS”归因-当前是根据设计,无法针对您的应用进行自定义。

2/ Having the same look - you can get this by providing only the link when setting up the composer (ie don't provide the image): 2 /具有相同的外观-您可以通过在设置作曲家时仅提供链接来获得此外观(即不提供图像):

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. 获得相同外观的关键是链接到的页面具有Facebook可以识别以正确显示数据的Open Graph标签。 You can test if the OG tags are good by entering the link into https://developers.facebook.com/tools/debug 您可以通过在https://developers.facebook.com/tools/debug中输入链接来测试OG标签是否良好

If the page does not have OG tags, the link will simply be displayed. 如果页面没有OG标签,则仅显示链接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM