面向iOS的Facebook Sdk发布-dark屏幕

我正试图在Facebook上分享。 但每次请求发布权限时,都会显示“您已授权到”AppName“”。 当我点击确定。 它把我带到了黑屏。

这是我的stream程。 1.loginFacebook 2.申请发布权限。 3.发布到Facebook墙上。

[FBSession.activeSession requestNewPublishPermissions:[NSArray arrayWithObject:@"publish_actions"] defaultAudience:FBSessionDefaultAudienceFriends completionHandler:^(FBSession *session, NSError *error) { if (!error) { // Now have the permission [self publishStory]; } else { // Facebook SDK * error handling * // if the operation is not user cancelled if (error.fberrorCategory != FBErrorCategoryUserCancelled) { [self presentAlertForError:error]; } } }]; 

你可以这样做,

同时打开会话指定权限发布post

  NSArray *permissions = [[NSArray alloc] initWithObjects:@"publish_actions",@"publish_stream",nil]; //permissions return [FBSession openActiveSessionWithPermissions:permissions allowLoginUI:allowLoginUI completionHandler:^(FBSession *session,FBSessionState state,NSError *error) 

只要你想发布,就这样做

  NSMutableDictionary *params = [[NSMutableDictionary alloc]initWithObjectsAndKeys:TextView.text, @"message",nil]; // set the formats if([FBSession.activeSession.permissions indexOfObject:@"publish_actions"] != NSNotFound) { [FBRequestConnection startWithGraphPath:@"me/feed" parameters:params HTTPMethod:@"POST" completionHandler:^(FBRequestConnection *connection, id result, NSError *error) { NSString *alertText; if(error) { //if error occurred } else { //successfull } }]; } }