Facebook iOS SDK 3.1 with XCode 4.2 linker errors

孤街浪徒 提交于 2019-11-30 06:45:01

Those frameworks are part of iOS 6 (well, except for Accounts, which is from iOS 5). You won't be able to use them without upgrading to Xcode 4.5, and consequently, iOS 6 SDK.

You can still set your deployment target down to iOS 4.3, if that's your concern.

I think your options are:

  1. Upgrade to Xcode 4.5, or
  2. Use Facebook SDK 3.0.

To make things clear:

For XCode 4.5:

If you use FB SDK3.0, you only need to add Accounts and FacebookSDK frameworks.

If you use FB SDK3.1, you need to add Accounts, FacebookSDK, Social, and AdSupport frameworks.

If you use FB SDK3.2++, check by yourself what other frameworks you may or may not need. ;)

Hope that sums it up nicely for everyone.

The SDK relies on three other frameworks (AdSupport, Accounts and Social).

To add these, go to the 'Linked Frameworks and Libraries' section of the target's Summary pane, and add them.

Sobri is right. Either upgrade to Xcode 4.5 or use SDK 3.0 or If you want to use 3.1 then download the source from github, modify the build file(basically remove the references to frameworks provided by iOS 6.0 ) and rebuild the SDK. That ways you can use the SDK 3.1 as well as run it on older XCode versions.

The following steps may be helpful to resolve this issue

  1. Download Facebook iOS SDK 3.0 from links present in the URL http://developers.facebook.com/ios/features/whats-new-ios-sdk-3/
  2. Add the FacebookSDK framework from Mac Documents directory
  3. Add sqlite3 to project

Then, I've tried the code in http://developers.facebook.com/docs/howtos/login-with-facebook-using-ios-sdk/ with the following changes (as it is for Facebook iOS SDK 3.1)

  1. Replace openActiveSessionWithReadPermissions with openActiveSessionWithPermissions
  2. Replace [FBSession.activeSession handleDidBecomeActive]; with [FBSession activeSession];

This worked for me. Try it once.

Thanks, prodeveloper.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!