about 11 years ago
Below is the code for sharing photo on facebook using ASIHTTPRequest.
- (void)publishStoryWithImage:(UIImage*)image andMessage:(NSString*)message { NSURL *url = [NSURL URLWithString:@"https://graph.facebook.com/me/photos"]; ASIFormDataRequest *newRequest = [ASIFormDataRequest requestWithURL:url]; [newRequest setPostValue:message forKey:@"message"]; NSData *imageData = UIImageJPEGRepresentation(image, 0.2f); [newRequest addData:imageData withFileName:@"testPicture" andContentType:@"multipart/form-data" forKey:@"source"]; [newRequest setPostValue:yourAccessToken forKey:@"access_token"]; [newRequest setRequestMethod:@"POST"]; [newRequest setDidFinishSelector:@selector(postImageOnFacebookFinished:)]; [newRequest setDidFailSelector:@selector(postImageOnFacebookfailed:)]; [newRequest setDelegate:self]; [newRequest startAsynchronous]; }
Starting with Chrome version 45, NPAPI is no longer supported for Google Chrome. For more information, see Chrome and NPAPI (blog.chromium.org).
Firefox and Microsoft Internet Explorer are recommended browsers for websites using java applets.
Chrome Version Support
Are you sure, you want to delete this comment?
Sign up using
0 Comment(s)