1

我想在我的 iOS 应用上向 Facebook 朋友发送消息。但我无法发送。我的代码是

NSMutableDictionary *postTest = [[NSMutableDictionary alloc]init];
[postTest setObject:@"Your message" forKey:@"message"];
[postTest setObject:@"" forKey:@"picture"];
[postTest setObject:@"" forKey:@"name"];
[postTest setObject:FACEBOOK_APP_ID forKey:@"app_id"];
NSString *userFBID =[NSString stringWithFormat:@"%@",@"1649291866"];

[FBRequestConnection startWithGraphPath:
    [NSString stringWithFormat:
        @"%@/feed?access_token=%@",userFBID,[FBSession activeSession].accessToken]
parameters:postTest
HTTPMethod:@"POST"
completionHandler:^(FBRequestConnection *connection,
NSDictionary * result,
NSError *error) {
    if (error) {
    //[self hideHUD];
    NSLog(@"Error: %@", [error localizedDescription]);
    }
    else
    {// Success}

    }];

[postTest release];

谁能帮帮我吗

4

0 回答 0