在IOS上发布Facebook时,我收到了错误消息

时间:2015-07-18 11:00:01

标签: ios facebook

我是iPhone应用程序开发的新手。在Facebook上发帖时我收到错误please try again

请帮我解决这个问题

- (void)ToPostOnFB   
{
    NSMutableDictionary *dic=[[NSMutableDictionary alloc]init];   
    NSString *scoreBoard = [[NSString alloc]init];  
    clsChat *cls=[[clsChat alloc] init];   
    cls=[self.aryUserChat objectAtIndex:0];    
      NSString *ch= [(AppObj) removeApostropheFromString:cls.clsChatMsg callingType:@"fetch"];  

    score = [NSString stringWithFormat:@"%@  \n%@ %@  \n%@ %@",self.lblPeriod.text,self.lbl1.text,self.lbl2.text,self.lbl3.text,self.lbl4.text];

    NSString *c = [NSString stringWithFormat:@"Post: \n%@ \nGet the app to follow your favorite teams https://goo.gl....", ch];
    NSString *title = [NSString stringWithFormat:@"Post 2: \n%@ \nGet the app to follow your favorite teams https://goo.gl...\n\n%@", score,c];
    dic= [NSMutableDictionary  dictionaryWithObjectsAndKeys:title,@"message",nil];

    NSLog(@"%@",dic);

    [FBRequestConnection startWithGraphPath:@"/me/feed"
                                 parameters:dic
                                 HTTPMethod:@"POST"
                          completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {

                              if (!error) {
                                  // Link posted successfully to Facebook
                                  NSLog(@"result: %@", result);

                                  UIAlertView *alertShare = [[UIAlertView alloc] initWithTitle:@"" message:@"Shared Successfully" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
                                  [alertShare show];
                              } else {

                                  UIAlertView *alertShare = [[UIAlertView alloc] initWithTitle:@"" message:@"Please try again" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
                                  [alertShare show];

                                  NSLog(@"%@", error.description);
                              }
                          }];
}

1 个答案:

答案 0 :(得分:1)

尝试从字符串中删除链接,看看是否能解决问题。

修改

为用户预填充任何字段是针对Facebook's policies这就是SDK不允许您发布的原因。