Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to Upload Photos on facebook using Graph API in iPhone?
    text
    copied!<p>I have made one application, In my application I have integrate Facebook for sharing information. for Facebook integration I have use Graph API in application. now In my application, I want to upload photo on user's wall. I have use this code for upload photo on user's wall.</p> <p>// for upload photo </p> <pre><code>- (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 { // Use when fetching text data NSString *responseString = [request responseString]; NSMutableDictionary *responseJSON = [responseString JSONValue]; NSString *photoId = [responseJSON objectForKey:@"id"]; NSLog(@"Photo id is: %@", photoId); NSString *urlString = [NSString stringWithFormat: @"https://graph.facebook.com/%@?access_token=%@", photoId, [_accessToken stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; NSURL *url = [NSURL URLWithString:urlString]; ASIHTTPRequest *newRequest = [ASIHTTPRequest requestWithURL:url]; [newRequest setDidFinishSelector:@selector(getFacebookPhotoFinished:)]; [newRequest setDelegate:self]; [newRequest startAsynchronous]; } </code></pre> <p>But, here I get responseString is <strong>{"error":{"message":"Error validating application.","type":"OAuthException"}}</strong> and <strong>Photo id is: (null)</strong></p> <p>and Image is not upload on user's wall. so, please tell me how to solve it.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload