Created
November 17, 2011 05:20
-
-
Save pmark/1372428 to your computer and use it in GitHub Desktop.
Post to Facebook wall
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)postMessageOnFacebook:(NSString*)message { | |
message = [NSString stringWithFormat:@"I just posted to %@ from %@.\n\n%@", | |
[AsyncEventHandler getCurrentCultName], | |
[AsyncEventHandler getCurrentMacro], | |
message]; | |
[APP_DELEGATE.facebook requestWithGraphPath:@"me/feed" | |
andParams:[NSMutableDictionary dictionaryWithObjectsAndKeys: | |
message, @"message", | |
@"http://cult.me", @"link", nil] | |
andHttpMethod:@"POST" | |
andDelegate:self]; | |
} | |
/** | |
* Called when an error prevents the request from completing successfully. | |
*/ | |
- (void)request:(FBRequest *)request didFailWithError:(NSError *)error { | |
NSLog(@"FB post failed: %@", [error localizedDescription]); | |
} | |
/** | |
* Called when a request returns and its response has been parsed into | |
* an object. | |
* | |
* The resulting object may be a dictionary, an array, a string, or a number, | |
* depending on thee format of the API response. | |
*/ | |
- (void)request:(FBRequest *)request didLoad:(id)result { | |
NSLog(@"FB post result: %@", result); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment