2

I want to integrate facebook with my app. I took a sample app from the fb sdk and copied the required code from there. It looked quite easy.

I added the social, adsupport and accounts frameworks as required. i was able to build and link. But while running, it shows up errors, which when i searched on the internet, i got to know that these frameworks are applicable only for ios6.

errors that "social framework referred from app". When I removed this framework, the same for adsupport framework. I tried making these three as optional frameworks, but then it gave errors like this Facebook iOS SDK 3.1 with XCode 4.2 linker errors

So can I use sdk 3.1 for integrating fb with my app or do i use 3.0 or previous version? Or some different way of implementation? If I have to use a previous version, how do I do it?

Edit: there is a readme file with the 'hello facebook" sample app which says its requirement is iOS4.0!

Community
  • 1
  • 1
neeraj
  • 1,191
  • 4
  • 19
  • 47
  • 1
    Go check this out:(There is solution you are looking for.) http://stackoverflow.com/questions/12610078/facebook-sdk-3-1-for-ios-runs-on-ios6-but-crashes-on-ios-5-x – Barty Hyuntae Kim Oct 04 '12 at 01:41
  • sorry i didn't post the solution that worked. I had used the link you gave but it didn't work. the problem was with my plist. I had entered 'fb ' in the plist (URL types/schemes). That 'space' between fb and fb id was causing all the problems :P – neeraj Oct 04 '12 at 04:56

1 Answers1

0

This is just as much to avoid using the functionalities for iOS 6.0 from the Facebook SDK.

Use the Facebook SDK 3.0 and do the opposite steps show in

https://developers.facebook.com/docs/tutorial/iossdk/upgrading-from-3.0-to-3.1/

  • Remove the added Additional Framework Dependencies
  • Changes in Handling Facebook Login Cancel Flow
  • Change the return value of openSessionWithAllowLoginUI:(BOOL)allowLoginUI implementation

//For FaceBookSDK 3.1

[FBSession openActiveSessionWithReadPermissions:nil
                    allowLoginUI:allowLoginUI
               completionHandler:^(FBSession *session,
                                   FBSessionState state,
                                   NSError *error) {
                                      [self sessionStateChanged:session
                                                          state:state
                                                          error:error];
                                   }];   

 //For FaceBookSDK 3.0  use this

[FBSession openActiveSessionWithPermissions:nil 
                               allowLoginUI:allowLoginUI
                          completionHandler:^(FBSession *session,
                                              FBSessionState state,
                                              NSError *error) {
                                [self sessionStateChanged:session 
                                                    state:state 
                                                    error:error];
                                             }];
user317706
  • 2,077
  • 3
  • 19
  • 18