0

我使用这种方法发布消息 NSLog(@"TOKEN : %@",[[FBSession activeSession]accessTokenData]);

        NSMutableDictionary *birdict=[NSMutableDictionary dictionaryWithObjects:[NSArray arrayWithObjects:Delegate.Namestring,delegate.idstring,delegate.dobstring,@"Happy Birthday", nil] forKeys:[NSArray arrayWithObjects:@"name",@"id",@"birthday",@"Description", nil]];


        FBRequest *request=[FBRequest requestWithGraphPath:[NSString stringWithFormat:@"%@/feed",delegate.idstring]parameters:birdict HTTPMethod:@"POST"];



        NSLog(@"%@",request);

        FBRequestConnection *connection=[[FBRequestConnection alloc]init];


        [connection addRequest:request completionHandler:^(FBRequestConnection *connection,id result,NSError *error)
         {
             if (error)
             {
                 //showing an alert for failure
                 UIAlertView *alertView = [[UIAlertView alloc]
                                           initWithTitle:@"Post Failed"
                                           message:error.localizedDescription
                                           delegate:nil
                                           cancelButtonTitle:@"OK"
                                           otherButtonTitles:nil];
                 [alertView show];
             }
         }];
        [connection start];
    }

但是,只发布了最后一个朋友的详细信息。我想发布完整的朋友列表。请给出解决方案。

4

1 回答 1

0
NSArray *permissions =[NSArray arrayWithObjects:@"publish_actions",@"publish_stream",@"manage_friendlists", nil];

[[FBSession activeSession] reauthorizeWithPublishPermissions:permissions defaultAudience:FBSessionDefaultAudienceFriends
                                           completionHandler:^(FBSession *session, NSError *error) {
                                               /* handle success + failure in block */
                                           }];

来源:参考

于 2013-11-27T05:55:55.563 回答