Facebook に接続してユーザーのウォールに投稿できるようにしたいアプリがあります。次のコードがあります。
- (void)viewDidLoad {
static NSString* kApiKey = @"PRIVATE";
static NSString* kApiSecret = @"PRIVATE";
_session = [[FBSession sessionForApplication:kApiKey secret:kApiSecret delegate:self] retain];
// Load a previous session from disk if available. Note this will call session:didLogin if a valid session exists.
[_session resume];
// Set these values from your application page on http://www.facebook.com/developers
// Keep in mind that this method is not as secure as using the sessionForApplication:getSessionProxy:delegate method!
// These values are from a dummy facebook app I made called MyGrades - feel free to play around!
[super viewDidLoad];
}
- (IBAction)postGradesTapped:(id)sender {
_posting = YES;
// If we're not logged in, log in first...
if (![_session isConnected]) {
self.loginDialog = nil;
_loginDialog = [[FBLoginDialog alloc] init];
[_loginDialog show];
}
// If we have a session and a name, post to the wall!
else if (_facebookName != nil) {
[self postToWall];
}
// Otherwise, we don't have a name yet, just wait for that to come through.
}
私が抱えている問題は、ユーザーが IBAction に関連付けられたボタンをクリックすると、ログイン ダイアログがポップアップしますが、[ストーリーを壁に公開] ダイアログを表示せずにウィンドウが消えることです。ログインして Publish Story to Wall を表示するにはどうすればよいですか?