I would really appreciate some help with the Facebook application I currently work on.
I developing a simple Facebook application, and I need to store the data of the people, who click the “I want to win button”. I’m not sure if I should use plain, old vanilla PHP, or if the Facebook API provides some simple way to do that, so I would be really glad for some ideas about this.
I read about the topic, but I can’t really “see the Matrix” yet, so every answer is appriciated. Also I’m more interested in ideas and not the implementation, as I’m fairly confident in my programming skills.
Thank you everybody!
Richard
You will definitely need to use an external db, coz facebook will not store the data for you. However facebook does store the connection that a user makes with the app, i.e. when a user gives some(even basic) permissions to your app. Hence when an old user comes to your app you can know which, and if it is an old user.
Facebook sends your entry script a
signed_request, which contains data about the user visiting your app, this request will have auser_idfield only if the user has made the connection/authorized your app, hence you know if it’s an old user or new.Once you have the
user_idyou can call the graph api to get info about the user. In the php SDK you can easily call$facebookObject->api('/me','GET');to get user info.You can easily call the functions anytime, so if you want to make a call when a user clicks your button, you can do that.
Check out the links i have included, thoroughly, you’ll get the idea.