Facebook sdk 3.0 with iOS 5 and Xcode 4.2

I have been creating iOS apps for a long time, and it’s quite convenient for me. What I did not do was add the ability to connect Facebook to any of my applications.

Today I am looking for a tutorial on integrating Facebook SDK 3.0 with iOS 5.0, working with Xcode 4.2. During my research, I found that 3.0 is compatible with Xcode 4.2. I'm not ready to upgrade to iOS 6.0 and Xcode 4.5 yet.

So my question is, is there any tutorial that can give me step-by-step instructions on how to integrate Facebook skd 3.0 with iOS 5 running on Xcode 4.2?

I was looking for a tutorial for these specifications; all i find is tutorials and instructions for iOS 6 and Facebook SDK 3.1.

What i can do is

  • Download the Facebook SDK 3.0 from this link http://developers.facebook.com/ios/downloads/
  • I signed up for a Facebook developer account and created an example AppID project
  • I tried to compile a new Xcode project with the Facebook SDK, but there I ran into problems.
+4
source share
2 answers

This tutorial shows how to integrate the Facebook SDK 3.0 to upload statutes and post photos to users. Hope this helps: http://xcodenoobies.blogspot.com/2012/09/how-to-upload-photo-and-update-status.html

You can get the birthdays of your Facebook friends (or users) with a single fql query.

You can read about fql here: http://developers.facebook.com/docs/reference/fql/

But here is some code for the link (this code is in the class defined as FBSessionDelegate, and FBRequestDelegate)

- (void)request:(FBRequest *)request didLoad:(id)result { // result is a NSDictionary of your friends and their birthdays! } - (void)fbDidLogin { //some best practice boiler plate code for storing important stuff from fb NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; [defaults setObject:[facebook accessToken] forKey:@"FBAccessTokenKey"]; [defaults setObject:[facebook expirationDate] forKey:@"FBExpirationDateKey"]; [defaults synchronize]; //now load all my friend birthdays NSMutableDictionary * params = [NSMutableDictionary dictionaryWithObjectsAndKeys: @"select birthday, name, uid, pic_square from user where uid in (select uid2 from friend where uid1=me()) order by name", @"query", nil]; [self.facebook requestWithMethodName: @"fql.query" andParams: params andHttpMethod: @"POST" andDelegate: self]; } - (void) loginWithFacebook { self.facebook = [[[Facebook alloc] initWithAppId:@"<your app id here>" andDelegate:self] autorelease]; //IMPORTANT - you need to ask for permission for friend birthdays [facebook authorize:[NSArray arrayWithObject:@"friends_birthday"]]; } 
+2
source

All Articles