我想在我的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];
任何人都可以帮助我