I downloaded the Facebook iPhone demo app recently. I have made several attempts to grasp the authentication process and I'm totally confused. There seems to be a lot of sample code out there that has been rendered obsolete in this version of the API.
In the .m file for my primary view controller, I have the following at the start:
#import "FBConnect.h"
The button that requires information from Facebook uses this line, unchanged from the demo app:
[_facebook requestWithGraphPath:@"me" andDelegate:self];
This calls the following method:
- (void)request:(FBRequest *)request didLoad:(id)result {
I have hacked my functionality into this method. I pull a few things I need from Facebook and send them to my backend in a HTTP POST command. For example, [result objectForKey:@"id"] returns the id and [result objectForKey:@"name"] returns the name. However, [result objectForKey:@"access_token"] returns nothing. This is very frustrating because I need to pass the access token to my Google App Engine user management back end to create a new user. So, hopefully the code I have included makes my authetication strategy clear (whatever it is). Does anyone know how I can get the access token in this context? I would appreciate it if you could help me out with what header files I need to have included etc. ?
Thanks,
John