Created
September 26, 2013 07:54
-
-
Save vincent-efwuhn/6711103 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| NSMutableDictionary* params = [[NSMutableDictionary alloc] init]; | |
| [params setObject:@"your custom message" forKey:@"message"]; | |
| [params setObject:UIImagePNGRepresentation(_image) forKey:@"picture"]; | |
| _shareToFbBtn.enabled = NO; //for not allowing multiple hits | |
| [FBRequestConnection startWithGraphPath:@"me/photos" | |
| parameters:params | |
| HTTPMethod:@"POST" | |
| completionHandler:^(FBRequestConnection *connection, | |
| id result, | |
| NSError *error) | |
| { | |
| if (error) | |
| { | |
| //showing an alert for failure | |
| [self alertWithTitle:@"Facebook" message:@"Unable to share the photo please try later."]; | |
| } | |
| else | |
| { | |
| //showing an alert for success | |
| [UIUtils alertWithTitle:@"Facebook" message:@"Shared the photo successfully"]; | |
| } | |
| _shareToFbBtn.enabled = YES; | |
| }]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment