Skip to content

Instantly share code, notes, and snippets.

@facebook
Created February 19, 2010 21:24
Show Gist options
  • Save facebook/309234 to your computer and use it in GitHub Desktop.
Save facebook/309234 to your computer and use it in GitHub Desktop.
#import "MyViewController.h"
#import "HelloWorldAppDelegate.h"
#import "FBConnect/FBConnect.h"
static NSString* kApiKey = @"YOUR_API_KEY";
static NSString* kApiSecret = @"YOUR_API_SECRET";
@implementation HelloWorldAppDelegate
@synthesize window;
@synthesize myViewController;
///////////////////////////////////////////////////////////////////////////////////////////////////
// ui app delegate
- (void)applicationDidFinishLaunching:(UIApplication *)application {
_session = [[FBSession sessionForApplication:kApiKey secret:kApiSecret delegate:self] retain];
[_session resume];
MyViewController *aViewController = [[MyViewController alloc] initWithNibName:@"MyViewController" bundle:[NSBundle mainBundle]];
[self setMyViewController:aViewController];
[aViewController release];
UIView *controllersView = [myViewController view];
[window addSubview:controllersView];
[window makeKeyAndVisible];
}
- (void)dealloc {
[myViewController release];
[window release];
[super dealloc];
}
///////////////////////////////////////////////////////////////////////////////////////////////////
// FBSessionDelegate
- (void)session:(FBSession*)session didLogin:(FBUID)uid {
@end