Well, I have to admit. It was a nightmare. Not only that Facebook is so messy, more than that – trying to programmatically connect to Facebook and write to the wall was a difficult experience.
Lets start by saying that the Facebook literature is not helping, even confusing. Trying to follow their steps just did not get me anywhere. So after struggling for a week, I decided to write a tutorial for dot net developers that are screaming (yes, I can hear…) – HELP!!!
There are 2 main stages:
1. Creating your application on the Facebook platform.
2. Creating your application in Visual Studio – Get Required Info.
3. Creating your application in Visual Studio – Write to the Wall.
Creating Application on the Facebook Platform
A word of warning: Facebook are constantly changing their interface, so what is right for today might change tomorrow. But the principle will remain the same.
1. If you don’t have a Facebook account – that’s the time!
2. Log into your account. Role down to the bottom of the page and click on Developers. You’ll see that the logo changed from Facebook to Facebook Developers. You are in the right place.
3. In the title menu click on Apps. Allow Developer to access your basic info. Click on Create New App. A lite-box will be opened. Enter the name of your application to be created and agree to the terms. Pass the security process - prove that you are a developer and not a robot (yet…).
4. We are on the right track. Now, fill in the required fields. I will not write them down in order not to confuse, because, as I said before – Facebook is updating these frequently. Finally, open NotePad and copy the App ID and the App Secret.
5. Since this explanation will walk you through creating a desktop application to write on the wall, then click on Advanced and click on the radio button that says – App Type: Desktop. Role down and click on Save Changes.
6. Now you’ll need to grant your app permission to be used with your account. Go to this url: https://www.facebook.com/dialog/oauth?client_id=**************&redirect_uri= https://www.facebook.com/connect/login_success.html&scope= offline_access,manage_pages,publish_stream
Replace all * with the App ID that you took from stage 4.
*** Note: The url contains spaces after each “=”. Delete them! ***
7. Fill in the fields – click the button. The app will ask for your permission – give it to him!
8. You are all set. Go and eat something, because the next part will be real coding…