I am using Graph API to get facebook user information as follows:
[facebook requestWithGraphPath:@"me" andDelegate:self];
How can I do this? I know that server response is in the form of JSON object but don't know how to parse it.
I am using Graph API to get facebook user information as follows:
[facebook requestWithGraphPath:@"me" andDelegate:self];
How can I do this? I know that server response is in the form of JSON object but don't know how to parse it.
I don't find the links that helped me to resolve this issue.
This is the code I used (request:didLoad: is a FBRequestDelegate callback):
- (void)request:(FBRequest *)request didLoad:(id)result {
if ([result isKindOfClass:[NSDictionary class]]) {
NSDictionary* hash = result;
NSString *username = (NSString*)[hash valueForKey:@"name"];
[[NSUserDefaults standardUserDefaults] setObject:username forKey:@"Username"];
}
[self publishStream]; // publishStream is a custom methods of mine to create the post to publish
};
I remember that I read the FB ios api code and maybe this and this
I hope this works for you.
Bye,
Fran
I have answered this question here How to retrieve Facebook response using Facebook iOS SDK