So, I have the facebook graph API implemented and it is working just fine. What I am trying to do now is to post a small UIAlertView as soon as the wall post is successful telling the user that their information actually WAS uploaded to facebook. My code connected to the "Post to Facebook" button is:
-(IBAction)pressedPost {
NSString *message = [NSString stringWithFormat:@"%@",_textView.text];
NSString *filePath = nil;
filePath = [[NSBundle mainBundle] pathForResource:@"icon" ofType:@"png"];
NSURL *url = [NSURL URLWithString:@"https://graph.facebook.com/me/feed"];
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
[request addFile:filePath forKey:@"file"];
[request setPostValue:message forKey:@"message"];
[request setPostValue:_accessToken forKey:@"access_token"];
[request setDidFinishSelector:@selector(finishedSendingPost)];
[request setDelegate:self];
[request startAsynchronous];
}
Unfortunately, that 'finishedSendingPost' is called regardless of whether the post was successful or not. If the user is not even logged in, that method is called. How can I determine if the post was successful or not and then relay a message that corresponds to that response?