1.建立view-based app:假設叫做facebooktest
抓取facebook官方製作的facebook for iphone 的sdk
3.打開src目錄裡頭的facebook_iphone_sdk.xcodeproj
把FBconnect目錄抓到你的app之中。
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
if (self = [super initWithNibName:@"facebooktestViewController" bundle:nibBundleOrNil]) {
if (kGetSessionProxy) {
_session = [[FBSession sessionForApplication:kApiKey getSessionProxy:kGetSessionProxy
delegate:self] retain];
} else {
_session = [[FBSession sessionForApplication:kApiKey secret:kAppSecret delegate:self] retain];
}
}
return self;
}
