用于ios发布的Facebook Sdk-黑屏

用于ios发布的Facebook Sdk-黑屏,ios,facebook,Ios,Facebook,我正试图在Facebook上分享。 但每次它请求发布许可时,它都会引导一个屏幕 您已授权使用“AppName”。当我点击OK时。它把我带到了空白屏幕 这是我的流程。 1登录Facebook 2请求发布许可。 三。发布到Facebook墙 [FBSession.activeSession requestNewPublishPermissions:[NSArray arrayWithObject:@"publish_actions"]

我正试图在Facebook上分享。 但每次它请求发布许可时,它都会引导一个屏幕 您已授权使用“AppName”。当我点击OK时。它把我带到了空白屏幕

这是我的流程。 1登录Facebook 2请求发布许可。 三。发布到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];
                                            }
                                        }
                                    }];
你可以这样做

打开会话时,请指定发布帖子的权限


  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
         }

     }];

    }

 }
无论何时你想出版,都要这样做


  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
         }

     }];

    }

 }


您是否设置了facebookAppId和URL方案?对。我可以登录facebook。[见此][1],可能会帮助您发布更多代码[1]:
  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
         }

     }];

    }

 }