楼主是通过cocoapod接入ShareSDK, 后来发现无论是使用fb分享还是登录, 都是跳出了网页认证(即使我的手机有安装了fb)

后来mob的技术客服小哥告诉我在构造分享参数的时候, 执行参数字典的SSDKEnableUseClientShare方法, 也就是

NSMutableDictionary *shareParams = [NSMutableDictionary dictionary];
[shareParams SSDKSetupShareParamsByText:@"Rinpe"
images:nil
url:[NSURL URLWithString:@"http://www.baidu.com"]
title:@"Rinpe"
type:SSDKContentTypeAuto];
[shareParams SSDKEnableUseClientShare];

然后登录呢?由于一开始我在初始化ShareSDK的时候(也就是下面的方法)

+ (void)registerApp:(NSString *)appKey
activePlatforms:(NSArray *)activePlatforms
onImport:(SSDKImportHandler)importHandler
onConfiguration:(SSDKConfigurationHandler)configurationHandler;

在onImport这个block里面需要连接到fb的SDK, 但是我找了半天没找到类似下面这样的方法

[ShareSDKConnector connectFacebook:[xxxx class]];

然后Mob客服的小哥说要用

[ShareSDKConnector connectFacebookMessenger:[FBSDKMessengerSharer class]];

然后我又找了半天没有找到包含FBSDKMessengerSharer这个类的文件, 小哥就说使用pod 'ShareSDK3/ShareSDKPlatforms/FacebookMessengerSDK'

来集成这个SDK, 然而我不知道是我的原因还是他们的原因, pod update老是报错...

迫于无奈, 我自己找到了FBSDKMessengerShareKit, 也就是使用pod 'FBSDKMessengerShareKit'来集成这个SDK...

好吧, 上面的问题解决了..结果一运行...

-canOpenURL: failed for URL: "fbauth2://authorize?client_id=xxxxx 出现了这个错误...

好吧..最后我找到了一个网站...

http://discoverpioneer.com/blog/2015/09/18/updating-facebook-integration-for-ios-9/

按上面的步骤给info.plist添加相应的参数...

问题终于解决了...

原文如下:

Updating Facebook Integration for iOS 9

 

So with iOS 9 out, there are a few enhancements in security. With that being said, the way your app integrates Facebook may be acting strange, or not working at all.

More than likely this is because you are being affected by App Transport Security. ‘App Transport Security is a feature that improves the security of connections between an app and web services. The feature consists of default connection requirements that conform to best practices for secure connections. Apps can override this default behavior and turn off transport security. ‘ -Apple

With all this being said, this is definitely something that you want to keep inside of your app. But now…. how do you make it work!?!

There are two solutions

1.

First: Whitelist Facebook Servers for Network Requests.
To do this add the following to your info.plist file:

<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>facebook.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
<key>fbcdn.net</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
<key>akamaihd.net</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
</dict>
</dict>

Then, Whitelist Facebook Apps by adding this to your info.plist as well:

<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbapi</string>
<string>fbapi20130214</string>
<string>fbapi20130410</string>
<string>fbapi20130702</string>
<string>fbapi20131010</string>
<string>fbapi20131219</string>
<string>fbapi20140410</string>
<string>fbapi20140116</string>
<string>fbapi20150313</string>
<string>fbapi20150629</string>
<string>fbauth</string>
<string>fbauth2</string>
<string>fb-messenger-api20140430</string>
</array>

There you go, that should do the trick 

2.

If this seems to be too much of a hassle for you, the second option is to turn off App Transport Security. You can do that by adding the following to your info.plist file:

<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>

使用ShareSDK完成Facebook第三方登录和Facebook分享时没办法跳转到Facebook应用的更多相关文章

  1. android开发学习——facebook第三方登录,看了你不会后悔

    给APP用原生android进行facebook第三方登录. 我们做一件事情,首先得了解其原理,这样才不会迷茫,才知道自己做到什么程度了,心里才会有底. 所以,第一步,了解第三方登录的原理:下面贴一些 ...

  2. java网站如何集成facebook第三方登录

    第一次接触Facebook第三方登录,可能有些地方做的并不全面,只是尝试着做了一个小demo,因为国内接入Facebook的项目并不多,并且多数都是Android或iOS的实现,所以资料也特别少,在此 ...

  3. 用 Flask 来写个轻博客 (23) — 应用 OAuth 来实现 Facebook 第三方登录

    目录 目录 前文列表 扩展阅读 第三方登录流程 OAuth 应用 OAuth 实现 Facebook 第三方登录 实现效果 前文列表 用 Flask 来写个轻博客 (1) - 创建项目 用 Flask ...

  4. swift-sharesdk集成微信、Facebook第三方登录

    好久没有写博客了.最近忙得没有时间更新博客,很忙很忙. 今天就把自己做过的第三方集成和大家分享一下,请大家多多指教. 第一步: 一.获取AppKey(去官方平台注册) 二.下载SDK 三.快速集成 第 ...

  5. 关于Google+以及Facebook第三方登录实现的一点总结

    简述 最近项目中有关于第三方登陆的需求,第三方Facebook以及Google +登录. 正好这几天把这个需求做得差不多了,收个尾,作为一个这方面之前基本从未涉及的小白,总结下开发流程以及过程中遇到的 ...

  6. facebook第三方登录

    一:创建和配置开发者应用 https://developers.facebook.com 登录开发者(可能要手机验证,身份证严重)->创建应用(web )->填写配置,网站网址和应用域名需 ...

  7. shareSDK实现QQ第三方登录

    // QQ登录 case R.id.login_share_qq: Platform qq = ShareSDK.getPlatform(QQ.NAME); qq.SSOSetting(false); ...

  8. QF——iOS第三方登录和社会化分享

    QQ登录的流程: 1.下载SDK,并添加到项目中: 2.添加SDK需要的依赖库,以及配置文件: 3.重写APPDelegate的方法handleOpenURL和openURL: 4.实现Tencent ...

  9. 分享前端Facebook及Twitter第三方登录

    最近公司要求做海外的第三方登录:目前只做了Facebook和Twitter;国内百度到的信息太少VPN FQ百度+Google了很久终于弄好了.但是做第三方登录基本上都有个特点就是引入必须的js,设置 ...

随机推荐

  1. 水仙花 AC 杭电

    水仙花数 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submi ...

  2. 腾讯QQ、新浪微博等知名社交网络图标素材

    腾讯QQ.新浪微博.QQ空间.淘宝.知乎.支付宝.大众点评等设计网络图标矢量素材. 注意是矢量素材,AI格式.放大缩小不变形. 社交网络图标几乎在网页制作中都会用到.一个好看的图标,完全可以提升整体网 ...

  3. C语言学习--可变数组

    #ifndef _ARRAY_ #define _ARRAY_ typedef struct { int *array; int size; } Array; //此处定义结构数据类型 Array,虽 ...

  4. centos7 jsoup java.net.UnknownHostException

    [root@localhost ~]# vi /etc/hosts127.0.0.1 localhost localhost.localdomain localhost4 localhost4.loc ...

  5. Windows提供了两种将DLL映像到进程地址空间的方法(隐式和显式)

    调用DLL,首先需要将DLL文件映像到用户进程的地址空间中,然后才能进行函数调用,这个函数和进程内部一般函数的调用方法相同.Windows提供了两种将DLL映像到进程地址空间的方法: 1. 隐式的加载 ...

  6. [Delphi]检查URL是否有效的函数

    function CheckUrl(url: string): boolean; var hSession, hfile, hRequest: hInternet; dwindex, dwcodele ...

  7. activitie用户手册

    最近公司开发流程,学习流程开发,不停看api学习.这是做软件的额...不停的学习学习!!!天天进步中! 用户手册地址:http://www.mossle.com/docs/activiti/#acti ...

  8. Linux&shell之显示数据

    写在前面:案例.常用.归类.解释说明.(By Jim) 2>将STDEER输入到一个文件1>将STDOUT输入到一个文件&>将STDEER和STDOUT输入到同一个文件 在脚 ...

  9. COJ 0018 移动盒子

    20605移动盒子 难度级别:B: 运行时间限制:1000ms: 运行空间限制:51200KB: 代码长度限制:2000000B 试题描述 你有一行盒子,从左到右依次编号为1,2,3,……,n.可以执 ...

  10. Number of Islands——LeetCode

    Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surro ...