Talk:Connect.registerUsers
From Facebook Developer Wiki
I'm confused at what this gives me - if I can just get their Facebook ID from them authenticating via the fbConnect login button, why do I need to register their account? Can't I just store their Facebook ID in my database and associate the two that way? Does this give me a little more information about the user when they're not the authenticated user? Perhaps a little more explanation on why I'd want to use this. JesseStay 02:00, 17 August 2008 (PDT)
- Registering your users with this API is a critical part of using facebook's Friend_Linking tool 776158039 13:16, 2 October 2008 (PDT)
- I'm confused as well. In TheRunAround sample app this function is only called when you want to register a *native* user of the site as a facebook user. Does that mean a user who logs in using Facebook Connect does not need to be registered with this method? If not how does Facebook know that this user is also associated with TheRunAround? Or doesn't that matter for friend linking? If it is necessary how can I avoid having to get the user to type in his/her email address twice - once for the login and a second time for this conncet.registerUsers() call? I tried retrieving the email_hash of a facebook user once he was logged in thinking I could then submit this to the registerUsers() method but all I get is an empty array. Indeed, your documentation says that the email_hash will only work for users who have been registered with this method. Having to ask the user to submit the email address twice seems very clunky. Am I missing something here? --551551925 16:29, 8 October 2008 (PDT)
It looks like this function isn't supported by the current release of the PHP API. Is that correct? 776158039 13:16, 2 October 2008 (PDT)
- It's supported, a wrapper function just hasn't been added to the client. You can modify your local version of facebookapi_php5_restlib.php with the following (which applies to connect.registerUsers as well as connect.unregisterUsers. Someone should be adding these to the client libraries and they ought to appear in the next weekly push (next Tuesday). -- Pete (User:563683308)
- Looks like the first method needs a json_encode(). Not sure about the second 776158039 18:42, 2 October 2008 (PDT)
Here's a quick implementation of the hash algorithm in PHP:
Works right for the test case. 776158039 18:34, 2 October 2008 (PDT)
Note: The above hash is not quite right. The md5 should be calculated on the normalized address, not the original (see connect.registerUsers). Here is the code:
BlakeSchwendiman 16:34, 5 December 2008 (MDT)
- Good catch, Blake. I'm stripping the code from my original comment, as it doesn't make sense to leave my original, erroneous version laying around. To better test compatibility with the algorithm, you might also add a second case to testHash() (this test catches my original error):
419214 21:59, 8 December 2008 (PST): One of the purposes of an identity management system like Facebook Connect or OpenID is to prevent third-party sites (us) from having to collect a lot of information from users--especially their email address. But strangely, you have to already know the user's facebook email to call Connect.registerUsers. What am I missing here? The user's email is hashed, so there shouldn't be any privacy concerns for giving it out. Why not provide the email hash through Users.getInfo or the "user" FQL table?
- Hey Travis, you're right that we want you to use Connect to simplify user registration for your site. But the purpose of this call is for the case of a site that already has a base of registered users and thus, identity information about those users (like email addresses). When one of your existing users goes to Connect your site to their Facebook account, you'd hash that existing address and send it to us to confirm that it's the same user. You wouldn't make this call for a user who's never registered for your site. Does that help? Also, I'll clarify things on the wiki here now. Thanks! -- Pete (563683308 12:35, 9 December 2008 (PST))
- Thank you for the helpful response. After reading your message and Account Linking a few times, this is becoming clearer, I think. Here's my understanding: connect.registerUsers is really intended to help you find other users of your site (e.g., with fb:connect-form) who also have facebook accounts but who have not yet authorized your site and connected the accounts. Since you would only be looking for users who haven't connected their accounts, there's no reason to call connect.registerUsers for users who have already connected, and therefore no reason for the api to provide email hashes for already-connected users. An email is the best way for third-party sites to uniquely identify possible facebook users without knowing their facebook uid, and it's hashed so we don't have to worry about giving information about our users to facebook that facebook doesn't already have. Thanks again. -- 419214 21:40, 9 December 2008 (PST)
- If that were true it'd be great. But it doesn't work that way. connect.registerUsers is completely useless. You send over the hashes to it, but when you use users.getInfo, users.getInfo will only return *blank* email_hashes because those users have not connected to your site yet. In other words it's a catch 22. In order to find out what facebook users haven't connected to your site, they need to connect first. -- FozzTexx 1254606666 16:49, 21 July 2009 (PST)
- That is not quite true. The hashes are returned with getInfo, but ONLY for those users that are VERIFIED. (users.isVerified) That is strange and needs explanation... -- Eddie 20:19, 4 September 2009
- Hi Eddie. Thats not quite true. I Have just performed a test whereby the user is verified (via: $fb->api_client->users_isVerified() ) and yet 'email_hashes' from both FQL query to 'user' table and getInfo() is returned blank. Surely email hashes should just be returned here because I would then like to check the email hash against existing emails in my websites user database.
[edit] Issues with batching calls to registerUsers
We had a lot of issues with our batch calls to registerUsers, to get our entire userbase registered with Facebook.
See this thread: http://forum.developers.facebook.com/viewtopic.php?pid=166367
Funny enough (?), the solution was to NOT follow the Facebook recommendations of sending 1000 users per request, but instead send as few as 10 users per request (we iterated our way down, via 500 to 100 and then 10).
