FBConnectを使ってFacebookに画像を投稿しています。私のコードは次のとおりです。
- (void) postOnPage
{
[self saveAccessTokenKeyInfo];
//post image on wall
UIImage *img = [UIImage imageNamed:@"image1.png"];
NSData *data = UIImagePNGRepresentation(img);
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"My hat image", @"message", data, @"source", nil];
[facebook requestWithGraphPath:@"/me/photos" andParams:params andHttpMethod:@"POST" andDelegate:self];
}
と
-(void)request:(FBRequest *)request didFailWithError:(NSError *)error{
NSLog(@"%@", [error localizedDescription]);
NSLog(@"Err details: %@", [error description]);
// Stop the activity just in case there is a failure and the activity view is animating.
}
私のコンソールは次のエラーログを出力します
The operation couldn’t be completed. (facebookErrDomain error 10000.)
2012-12-10 19:53:56.153 HatApplication[5724:c07] Err details: Error Domain=facebookErrDomain Code=10000 "The operation couldn’t be completed. (facebookErrDomain error 10000.)" UserInfo=0x7fc4da0 {error=<CFBasicHash 0x7fc1120 [0x1b57b48]>{type = mutable dict, count = 3,
entries =>
2 : <CFString 0x7fc0930 [0x1b57b48]>{contents = "type"} = <CFString 0x7fc30f0 [0x1b57b48]>{contents = "OAuthException"}
3 : <CFString 0x7fc0d10 [0x1b57b48]>{contents = "message"} = <CFString 0x7fc0cf0 [0x1b57b48]>{contents = "An active access token must be used to query information about the current user."}
6 : <CFString 0x7f76390 [0x1b57b48]>{contents = "code"} = 2500
}
}
私のコードには何が欠けていますか?