I created a Facebook Application, i set the canvas url domain to the website hosted on some server.
The website worked perfectly inside the facebook page.
The problem is i want to track which user is accessing this application as when it do some activity on this page and then comes back i will show that you are here last time, track his scores etc.
I have App secret etc with me, so how can i achieve this.
Any help is appreciated
Thank You.
These are the steps involved:
1) When a user visits your app first, Facebook asks for user permission to allow your app to access certain user details. These permissions are listed here: https://developers.facebook.com/docs/reference/api/permissions/
2) Your app can access his details if user grants permission. Now, you need to store user info in YOUR database, like his user profile id etc (info which he has made available to your app).
3) On re-visit to your app, you can first check whether his details exists in YOUR database or not. If not, it means he is visiting your app first time, render your page accordingly and save his details.
4) In case he has already visited your app once, you can show his last activities, scores etc.
From db perspective, following is a suggested schema:
UPDATE:
Here are some resources
1) You can use facebook toolkit written in asp.net http://facebooktoolkit.codeplex.com/
2) Steven Trefethen in his blog http://www.stevetrefethen.com/blog/DevelopingFacebookapplicationsinCwithASPNET.aspx has given a primer to fb apps in C#
3) This app https://apps.facebook.com/aspdotnetsample/ is also a good point to start. Code is available from http://fgt.codeplex.com/releases/view/76934
4) http://www.nikhilk.net/FacebookNET.aspx blog by Nikhil Kothari