I had the same problem. Here is how I got around it...might not be
ideal, but it worked for me.
So the latest FBConnect-iOS has an option to take the login
credentials from (i) the native FB app session, (ii) a logged in
session of FB via Safari, or (iii) a UIWebView based dialog window.
The defaults are (i) and (ii), which both require the code:
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
return [[controller facebook] handleOpenURL:url];
}
as you pointed out. However, you can force the dialog ( option (iii) )
to appear in your app, if you modify Facebook.m:
From:
[self authorizeWithFBAppAuth:YES safariAuth:YES];
To:
[self authorizeWithFBAppAuth:NO safariAuth:NO];
This completely bypasses the need for
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {}
and Three20 is able to use the function as it does.
Hope this helps.
Cheers,
Brett
> --
> You received this message because you are subscribed to the Google
> Groups "Three20" group.
> To post to this group, send email to thr...@googlegroups.com
> To unsubscribe from this group, send email to
> three20+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/three20?hl=en
>
> To learn more about Three20, check out
> http://Three20.info/
>
Sent from my iPhone
-Brett
On Wed, Nov 17, 2010 at 8:03 AM, Rob McClellan <roba...@gmail.com> wrote:
> That is perfect! Thank you
>
> Sent from my iPhone
>
> On Nov 17, 2010, at 10:59 AM, Brett Spurrier <brett.s...@gmail.com> wrote:
>
>> Hi Rob,
>>
>> I had the same problem. Here is how I got around it...might not beNo pro
Would
[_facebook requestWithGraphPath:@"me" andDelegage:self];
work?
Sent from my iPhone
I'm pretty sure that would work, yes.
However, I am more adept at using ASIHTTPRequest for my web calls, so
I used the following code. Plus this is more extensible for all the
Graph API calls...just change the url to the appropriate Graph url.
//Post login called from the FB Connect delegate methods
- (void)fbDidLogin {
fbAccessToken = [_facebook accessToken]; //iVar
[self requestFacebookNameWithGraphAPI:fbAccessToken];
}
-(void)requestFacebookNameWithGraphAPI:(NSString *)token {
NSString *urlString = [NSString
stringWithFormat:@"https://graph.facebook.com/me?access_token=%@",
[token
stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
//Call thr Facebook Graph API to grab the profile information
NSURL *url = [NSURL URLWithString:urlString];
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
[request setDidFinishSelector:@selector(getFacebookProfileFinished:)];
[request setDelegate:self];
[request startAsynchronous];
}
- (void)getFacebookProfileFinished:(ASIHTTPRequest *)request {
//Grab the relevant FB information
NSString *responseString = [request responseString];
NSMutableDictionary *responseJSON = [responseString JSONValue];
[fbProfileDictionary setObject:[responseJSON
objectForKey:@"first_name"] forKey:@"FirstName"];
[fbProfileDictionary setObject:[responseJSON
objectForKey:@"last_name"] forKey:@"LastName"];
//Whatever else you want to grab
}
Make sure to retain the access_token somewhere. That way the user (a)
won't have to login past the first time, and (b) you can make any
graph call at any point.
Cheers,
Brett