views:

160

answers:

2

I use the PHP library for Facebook Connect.

The library is used as follows:

$facebook->api_client->METHOD

Here's the documentation for how to unregister users from one's Connect page: Connect.unregisterUsers

So, actually, I have everything I need, haven't I? But I can't manage to unregister users, though. How must I do this?

$facebook->api_client->unregisterUsers()

Which parameters? What are the email hashes?

+2  A: 

Email hashes are MD5 signatures computed from an email address, used to avoid exposing the user's plain email address and still allow identity matching.

The idea of registerUsers is that you can pass a collection of email hashes to Facebook (from users registered on your site) and it will create an association between existing users on your site and those users Facebook accounts.

unregisterUsers will remove that association for the users you select (by passing also an array of email hashes of those users). It should be called when a user deletes your account on your site.

Alejandro Bologna
Thanks! So should this work? $facebook->api_client->unregisterUsers(array('202cb962ac59075b964b07152d234b70'))
Yes it should work as long as you have previously registered that email hash calling registerUsers with an array containing it
Alejandro Bologna
Is the syntax also correct? And if I didn't call registerUsers it wouldn't work? "You should call this method if the user deletes his or her account on your site" A user could do this even if I didn't call registerUsers, right?
+1  A: 

You might also want to take a look at the auth_revokeAuthorization function in the PHP library. The method takes a facebook user id as the parameter and removes them from your application.

$fbObj->api_client->auth_revokeAuthorization($fbId)
alex
Thanks, another method for another purpose, but interesting :)