Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FB login dialog default email #43

Closed
PSBT opened this issue Sep 9, 2010 · 2 comments
Closed

FB login dialog default email #43

PSBT opened this issue Sep 9, 2010 · 2 comments

Comments

@PSBT
Copy link

PSBT commented Sep 9, 2010

Hi!

I was wondering if there's a way to set a default email in FB login dialog's textfield.

In the past, calling this code

NSHTTPCookieStorage* cookies = [NSHTTPCookieStorage sharedHTTPCookieStorage];
NSHTTPCookie* testCookie = [NSHTTPCookie cookieWithProperties:
                            [NSDictionary dictionaryWithObjectsAndKeys:
                             [HTTPRequest encodeURLString:email], NSHTTPCookieValue,
                             @"lxe", NSHTTPCookieName,
                             @".facebook.com", NSHTTPCookieDomain,
                             @"/", NSHTTPCookiePath,
                             @"FALSE", NSHTTPCookieDiscard,
                             nil]];
[cookies setCookie:testCookie];

Before this:

FBLoginDialog* dialog = [[[FBLoginDialog alloc] initWithSession:_session] autorelease];
dialog.delegate = delegate;
[dialog show];

Used to work...Any ideas of how can these work with this new sdk?

Thanks!

@yujuan
Copy link

yujuan commented Sep 13, 2010

The email should be handled automatically, i.e., if you did not click logout button but just close the app. next time the app start, the email is filled in. you can try this with DemoApp. If you really want to have a default email set in your code you can add the following lines to FBDialog.m at begining of the function - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request

  • NSHTTPCookieStorage* cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
  • NSArray* theCookies = [cookieStorage cookiesForURL:[NSURL URLWithString:@"http://www.facebook.com"]];

or http://touch.facebook.com
and then use debugger to check which cookie is responsible for set email and do it in similiar way as before.

@PSBT
Copy link
Author

PSBT commented Sep 13, 2010

Great thanks! That worked! In case anyone needs, the cookie name is "m_user".

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants