Created
February 10, 2015 13:48
-
-
Save rock88/ef9ee1936ac47c4b223c to your computer and use it in GitHub Desktop.
This file contains 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
- (void)share:(UIImage *)immagine completion:(void(^)(NSError* error))completion | |
{ | |
[FBRequestConnection startWithGraphPath:@"/me/albums" parameters:nil HTTPMethod:@"GET" completionHandler:^(FBRequestConnection *connection,i d result, NSError *error) | |
{ | |
if (!error) | |
{ | |
NSMutableDictionary* params = [[NSMutableDictionary alloc] init]; | |
[params setObject:UIImagePNGRepresentation(immagine) forKey:@"picture"]; | |
[FBRequestConnection startWithGraphPath:[NSString stringWithFormat:@"/%@/photos", result] parameters:params HTTPMethod:@"POST" completionHandler:^(FBRequestConnection *connection,result,NSError *error) | |
{ | |
if (!error) | |
{ | |
// no error - do some... | |
} | |
completion(error); | |
}]; | |
} | |
completion(error); | |
}]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment