楼主是通过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. 使用Qt编写模块化插件式应用程序

    动态链接库技术使软件工程师们兽血沸腾,它使得应用系统(程序)可以以二进制模块的形式灵活地组建起来.比起源码级别的模块化,二进制级别的模块划分使得各模块更加独立,各模块可以分别编译和链接,模块的升级不会 ...

  2. 使用getGenericSuperclass()和getActualTypeArguments()将DAO做成泛型

    一.getGenericSuperclass()和getActualTypeArguments()基本用法: import java.lang.reflect.ParameterizedType; p ...

  3. HDU1565 方格取数(1)(状态压缩dp)

    题目链接. 分析: 说这题是状态压缩dp,其实不是,怎么说呢,题目数据太水了,所以就过了.手动输入n=20的情况,超时.正解是网络流,不太会. A这题时有个细节错了,是dp[i][j]还是dp[i][ ...

  4. 【转】ubuntu打包压缩命令总结

    原文网址:http://blog.csdn.net/renero/article/details/6428523 .tar解包:tar xvf FileName.tar打包:tar cvf FileN ...

  5. 【转】Android 使用Scroller实现绚丽的ListView左右滑动删除Item效果

    原文网址:http://blog.csdn.net/xiaanming/article/details/17539199 转帖请注明本文出自xiaanming的博客(http://blog.csdn. ...

  6. yui--datatable基础和常用知识总结

    1.namespace 用于创建一个全局的命名空间,使用YUI时,首先会自动创建widget,util,example三个命名空间,使用时也可以自定义命名空间.类似于在程序中建了了一个static变量 ...

  7. 调用test case集,并生成测试报告

    结构是 test_all.py 进行配置,执行所有测试用例集,并合并测试报告到同一个文件 #test_all.py 进行配置,执行所有测试用例集 # coding = utf-8 from time ...

  8. Symmetric Tree——LeetCode

    Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For e ...

  9. linux chgrp命令【转载】

    在lunix系统里,文件或目录的权限的掌控以拥有者及所诉群组来管理.可以使用chgrp指令取变更文件与目录所属群组,这种方式采用群组名称或群组识别码都可以.Chgrp命令就是change group的 ...

  10. Scala 编程(四)内建控制结构

    if 表达式 Scala 的 if 如同许多其它语言中的一样工作.它测试一个状态并据其是否为真,执行两个分支中的一个: var filename = "default.txt" i ...