【问题标题】:Facebook App share dialog does not appear sometimesFacebook 应用程序共享对话框有时不会出现
【发布时间】:2015-01-14 05:44:39
【问题描述】:

当我尝试从 iOS 应用程序共享图片时,Facebook 应用程序有时无法加载共享屏幕。当我在很长一段时间后尝试分享图片并且第二次之后分享屏幕完美无瑕时,就会发生这种情况。

发生这种情况时,iOS 应用程序会定向到 Facebook 应用程序,但不会出现共享屏幕。它只是在新闻源上结束。

if ([FBDialogs canPresentShareDialogWithParams:params]) {
         // Present share dialog
        FBAppCall *call = [FBDialogs presentShareDialogWithLink:params.link
                                          name:params.name
                                       caption:params.caption
                                   description:params.linkDescription
                                       picture:params.picture
                                   clientState:nil
                                       handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {

 }]; }

有人知道是什么导致了这种突然的行为吗?

【问题讨论】:

标签: ios iphone facebook


【解决方案1】:

嘿,如果你的设备 dnt hv Facebook 应用程序那么这个块将不会执行..那么你应该将你的代码块处理到 else 部分。使用 Feed 场景.....先检查一下

修改

FBLinkShareParams *params = [[FBLinkShareParams alloc] init];
params.link = YOUR_URL;
params.picture=YOUR_PICTURE_URL;
params.name=NAME;
params.caption =YOUR_CAPTION_OR_DESCRIPTION;
params.linkDescription = DESCRIPTION_LINK;

// If the Facebook app is installed and we can present the share dialog

if ([FBDialogs canPresentShareDialogWithParams:params])
{
    // Present share dialog
    [FBDialogs presentShareDialogWithLink:params.link handler:^(FBAppCall *call, NSDictionary *results, NSError *error)
      {
           //Handle result and error....
      }];
}
else
{
    // FALLBACK: publish just a link using the Feed dialog
}

这会起作用....

【讨论】:

  • Facebook 应用程序安装在设备中,问题是有时第一次没有显示共享屏幕。它只是打开带有新闻提要的应用程序。从第二次开始,它就完美运行了。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-03-04
  • 1970-01-01
相关资源
最近更新 更多