I made one application. In my application, I have integration with Facebook to share information. To integrate with Facebook, I use the Graph API in the application. Now in my application I want to upload a photo to the user's wall. I use this code to upload photos to the user's wall.
// to upload a photo
- (void)uploadPhoto:(id)sender { NSString *filePath = [[NSBundle mainBundle] pathForResource:@"Image1" ofType:@"jpg"]; NSString *message = [NSString stringWithFormat:@"I think this is a Great Image!"]; NSURL *url = [NSURL URLWithString:@"https://graph.facebook.com/me/photos"]; ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url]; [request addFile:filePath forKey:@"file"]; [request setPostValue:message forKey:@"message"]; [request setPostValue:_accessToken forKey:@"access_token"]; [request setDidFinishSelector:@selector(sendToPhotosFinished:)]; [request setDelegate:self]; [request startAsynchronous]; } - (void)sendToPhotosFinished:(ASIHTTPRequest *)request {
But here I get responseString {"error": {"message": "Application Validation Error.", "Type": "OAuthException"}} and Photo ID: (null)
and the image does not upload to the user's wall. so please tell me how to solve it.
source share