有时Facebook的共享对话框不会在iOS上加载 [英] Sometimes the Facebook share dialog doesn't load on iOS

查看:123
本文介绍了有时Facebook的共享对话框不会在iOS上加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有时,当我启动Facebook共享对话框时,操作系统切换到Facebook应用程序,但共享对话框不会加载。那么如果再试一次,它通常会起作用。为什么第一次不工作?

Sometimes when I launch the Facebook share dialog, the OS switches to the Facebook app, but the share dialog doesn't load. Then if you try again, it usually works. Why doesn't it work the first time?

NSURL* url = [NSURL URLWithString:@"some URL"];
FBShareDialogParams* params = [[FBShareDialogParams alloc] init];
params.link = url;
 if ([FBDialogs canPresentShareDialogWithParams:params]) {
     [FBDialogs presentShareDialogWithLink:url
                                   handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
                                       if(error) {
                                           NSLog(@"Error posting to FB: %@", error.description);
                                           //do something
                                       } else {
                                           //do something else
                                       }
                                   }];
//    }
 }


推荐答案

该类不再适用于SDK的最新版本。

This class is no longer available in the most recent version of the SDK.

您应该使用FBSDKShareDialog而不是此。最新版本是v4.11.0。

You should use FBSDKShareDialog instead of this.The latest version is v4.11.0.

谢谢。

这篇关于有时Facebook的共享对话框不会在iOS上加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆