Skip to content
Work in Progress. Trying to make the Facebook sharing experience simpler.
Objective-C
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.gitignore
JGAFacebookFriend.h
JGAFacebookFriend.m
JGAFacebookFriendSelectionViewController.h
JGAFacebookFriendSelectionViewController.m
JGAFacebookHelper.h
JGAFacebookHelper.m
README.md

README.md

JGAFacebookHelper

Work in Progress. Trying to make the Facebook sharing experience simpler.

Setup

Follow the instructions on the facebook sdk github page. import "JGAFacebookHelper.h" wherever you need it

Add the following to your app delegate:

 - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
    [[NSNotificationCenter defaultCenter] postNotificationName:kFBHandleOpenUrl object:url];
    return YES;
}

Add the following to the .pch header file

#define kFbId <YOUR_ID_HERE>
#define kFBHandleOpenUrl @"fbHandleOpenUrl" 

Add an instance of JGAFacebookHelper to your view controller:

 @property (nonatomic, strong) JGAFacebookHelper *fbHelper;
 @synthesize fbHelper = _fbHelper;

Make your view controller a delegate of JGAFacebookHelper

 @interface YourViewController : UIViewController <JGAFacebookHelperDelegate>

Set up Login and Callbacks:

 - (IBAction)facebookButtonPressed:(id)sender
    if (!_fbHelper) {
        self.fbHelper = [[JGAFacebookHelper alloc] initWithDelegate:self];
        [_fbHelper login];
    }else {
        // call your sharing method
    }
 }
 - (void)helperDidLogin:(JGAFacebookHelper *)helper
 {
    // call your sharing method
 }
 - (void)helperDidNotLogin:(JGAFacebookHelper *)helper
 {
    // perform any necessary cleanup
 }

Methods

Refer to source code for method calls and delegate reference.

Something went wrong with that request. Please try again.