简体   繁体   English

如何安装iOS版Facebook SDK?

[英]How do I install the facebook sdk for ios?

How do I install the Facebook SDK for iOS? 如何安装iOS版Facebook SDK?

The download from the facebook developer website is failing, every time. 每次从Facebook开发者网站下载失败。

So, I got it from github: https://github.com/facebook/facebook-ios-sdk 所以,我从github上获得了它: https : //github.com/facebook/facebook-ios-sdk

But, I don't know what script to run, file to execute, thing to build, or...anything, to get to the next step in the process, which is to add the built facebook sdk to my xcode project. 但是,我不知道要运行什么脚本,要执行的文件,要构建的东西或任何东西,否则无法进行下一步,即将已构建的facebook sdk添加到我的xcode项目中。 Anything I try to run (eg sh build_all.sh, etc.) doesn't work. 我尝试运行的所有内容(例如sh build_all.sh等)均无效。

  1. Go here and click download: https://developers.facebook.com/docs/ios 转到此处并单击下载: https : //developers.facebook.com/docs/ios
  2. Install package. 安装软件包。
  3. Find FacebookSDK folder, and in there you have FacebookSDK.framework. 找到FacebookSDK文件夹,然后在其中有FacebookSDK.framework。
  4. Go to your project, open settings, go to Info. 转到您的项目,打开设置,转到“信息”。 Add 2 variables to Custom iOS Target Properties. 将2个变量添加到“自定义iOS目标属性”。
    a) FacebookAppID (String), with your app id from the facebook: eg 543523965389292 a)FacebookAppID(字符串),其中包含来自Facebook的应用程序ID:例如543523965389292
    b) FacebookDisplayName (String) with your name you want to display. b)具有您要显示的名称的FacebookDisplayName(字符串)。
  5. In the same Info tab expand URL Types and add new one. 在同一“信息”选项卡中,展开“ URL类型”并添加新的。 Paste in the URL Scheme fb_APP_ID_, eg fb543523965389292. 粘贴URL方案fb_APP_ID_,例如fb543523965389292。
  6. Go to Build Phases, expand Link Binary With Libraries. 转到“构建阶段”,展开“链接二进制文件与库”。 Add the FacebookSDK.framework from the point 2. 从第2点开始添加FacebookSDK.framework。
  7. In your AppDelegate.m add: #import <FacebookSDK/FacebookSDK.h> . 在您的AppDelegate.m中添加: #import <FacebookSDK/FacebookSDK.h> And replace function in your AppDelegate.m. 并替换AppDelegate.m中的函数。

     - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { // Call FBAppCall's handleOpenURL:sourceApplication to handle Facebook app responses BOOL wasHandled = [FBAppCall handleOpenURL:url sourceApplication:sourceApplication]; // You can add your app-specific url handling code here if needed return wasHandled; } 

Slightly older thread but to provide a clue: there's a bug report on Facebook DEV as more people are facing the same issue. 线程稍旧,但提供了一个线索:随着越来越多的人面临相同的问题,Facebook DEV上出现了一个错误报告。 Let's hope they'll fix it asap. 希望他们能尽快修复它。

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

相关问题 如何在反应原生应用程序中安装facebook sdk? - How do I install the facebook sdk in a react native application? 如何使用 cocoapods 为 iOS 安装 facebook sdk? - How to install facebook sdk for iOS using cocoapods? 如何使用Facebook SDK 4.6 for iOS登录? - How do I use the login in Facebook SDK 4.6 for iOS? 如何为 iOS Swift 项目安装 Azure SDK? - How do I install the Azure SDK for an iOS Swift project? Facebook IOS SDK:如何进行静默登录? - Facebook IOS SDK : how to do silent sign in? 当我下载 Facebook iOS SDK 时得到了 .zip 文件。 如何安装? - Got .zip file when I downloaded Facebook iOS SDK. How to install it? 如何允许用户使用iOS版Facebook SDK来“赞”我们的Facebook公司资料? - How do I allow users to “Like” our Facebook company profile using the Facebook SDK for iOS? 如何使同一个Facebook对象可用于我的iOS Facebook SDK项目中的所有代码? - How do I make the same Facebook object available to all my code in my iOS Facebook SDK project? 如何使用Facebook Graph API和facebook ios sdk获取完整的User对象? - How do I get the full User object using Facebook Graph API and facebook ios sdk? 如何从iOS SDK中的Facebook对象获取Facebook用户ID? - How do I get the Facebook user Id from the Facebook object in the iOS SDK?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM