Skip to content
Facebook SDK for iOS
Pull request Compare This branch is 1 commit behind indigotech:social-facebook.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
SBJson @ 87a8681


This is a Facebook SDK Façade for iOS with Blocks. SFSocialFacebook is a fork of Facebook SDK for iOS with simpler and cleaner way to use.



dependency 'SFSocialFacebook',  '~>1.2'


Copy all files from src/ except .xcodeprojand .pch files to your project.


Configure the URL Scheme in your project's Info.plist as the image below:

Info.plist setup

And your project's AppDelegate.m:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  NSArray *permissions = [[NSArray alloc] initWithObjects:@"create_event", @"user_events", @"rsvp_event", @"publish_stream", nil];
  _socialFacebook = [SFSocialFacebook sharedInstanceWithAppId:@"YOUR_APP_ID" appSecret:@"YOUR_APP_SECRET" urlSchemeSuffix:nil andPermissions:permissions];
  [permissions release];

// Pre 4.2 support
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
  return [_socialFacebook handleOpenURL:url];

// For 4.2+ support
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
  return [_socialFacebook handleOpenURL:url];

Usage Example

Publish example:

SFSimplePost *post = [[SFSimplePost alloc] init]; = @"I'm using the I.ndigo Test App for iOS app";
    post.caption = @"I.ndigo Test App for iOS.";
    post.postDescription = @"Check out I.ndigo Test App for iOS to learn how you can make your iOS apps social using Facebook Platform."; = @"";
    post.picture = @"";
    post.actionName = @"I.ndigo Website";
    post.actionLink = @"";
    post.message = @"Message created by App";

[[SFSocialFacebook sharedInstance] publishPost:post success:^(NSString *postId) {
    // Success callback
} failure:^(NSError *error) {
    // Error callback
} cancel:^{
    // Cancel callback

[post release];

Feed example:

[[SFSocialFacebook sharedInstance] profileFeed:_profileId 
                                       success:^(NSArray *posts, NSString *nextPageUrl) {
                                         // Success callback
                                       failure:^(NSError *error) {
                                         // Error callback
                                         // Cancel callback

Sample Application

There is a sample XCode project using SFSocialFacebook in sample/SFSocialFacebookExample/SFSocialFacebookExample.xcodeproj.


SFSocialFacebook is licensed under the Apache License, Version 2.0.

Copyright 2012 I.ndigo

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Something went wrong with that request. Please try again.