I am building an app with the functionality to publish
messages to users walls while specific actions runs on
my website.
What I have done is (briefly):
-
Registered my own app on Facebook
-
Added a login button on my website with permission
to publish:
Log in on Facebook
- Downloaded facebook-php-sdk library
It is now I start having problems. I do not know how
to do what I want to do now.
What I want to do:
When a user logs on to facebook via my website. I want
a file on my site to be called, where I can update the
user’s data in my own database as well.
Because that is not what the canvas url is meant to do? How it
is no, seems no file at all is called on my site when
I click on Login.
Since you are using the Facebook PHP-SDK you noticed that there are two options for the users to login:
auth.loginevent will be triggered and based on that the page will get reloadedwindow.location.reload();$session = $facebook->getSession();will actually retrieve a session!$user = $facebook->getUser();will retrieve the current user$loginUrl = $facebook->getLoginUrl();this URL will get you through the same flow and if you noticed there’s anextredirect_uriparameter which will redirect you back after a successful process to that URL (mainly the same URL you are at), where you can change that parameter if you like.