user1673099
user1673099

Reputation: 3299

Facebook integration for ios 5 & ios 6

I want to integrate Facebook both for ios 5 and ios 6.

I have the knowledge of integrating facebook in individual ios(i.e ios 5 or ios 6), but have no idea of how to support facebook for both ios 5 and ios 6.

In the other words, how to integrate facebook both for ios 5 and ios 6 ? or what is the common way to support this in both ios?

Thanks

Upvotes: 5

Views: 11479

Answers (3)

Gajendrasinh Chauhan
Gajendrasinh Chauhan

Reputation: 3397

If you have xcode 4.5 or later. Using social framework,you can implement Facebook on iOS. Also check FB and Twitter integration for iPhone tutorial.Visit http://kmithi.blogspot.co.uk/2012/10/integrating-facebook-and-twitter-in-ios.html

Upvotes: 0

Zen
Zen

Reputation: 3117

Well if you want to use the facebook integration within iOS6, and if the iOS version is lower than 6 , you want to use the Facebook SDK for iOS, you can check for the availability of the integrated Facebook service class in the Social Framework. Also you would have to import the Social Framework for it.

#import<Social/Social.h>

You can check for the availability of the integrated facebook service by something like this in the buttonAction method

- (void)buttonAction:(id)sender
{
    //Check for availability of Facebook integration and use its view controller to share on Facebook
    if(NSClassFromString(@"SLComposeViewController") != nil) {
        SLComposeViewController *fbController=[SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
        if([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) {
            //Use fbController for sharing
        } else {
            // Service not available
        }
    }
    else{
        // Use your code for sharing on iOS versions other than 6.x to authenticate and get an access token.
    }
}

Hope it helped.

Upvotes: 16

user1573321
user1573321

Reputation:

Go through this links for ios 5 and ios 6.

Use the latest sdk for both ios 5 and 6, and follow the link for details.

check this also link.

Upvotes: 1

Related Questions