This following article shows you how to upload the image from CameraCaptureTask to Facebook in less than 10 steps. The following Assembly/DLL will take care of all the Facebook Security (OAuth) code for you. With this DLL, you will not need to learn about Facebook Graph API.
To start with this, you need to download the following
- ExifLib.dll (for more information about ExifLib.dll, can refer Tim Heuer’s blog)
1. Add reference to this 2 files and Microsoft.Phone.Controls.Toolkit
2. Get your Facebook App ID/API Key from http://developers.facebook.com/apps. You will need the information in order to allow users to upload image to Facebook.
3. Open the WMAppManifest.xml and make sure the application allows Camera and WebBrowser capabilites
4. In order to call the API, you need to enter the following code into your application.
Dim facebook As GainSecure.WindowsPhone.Facebook
facebook = New GainSecure.WindowsPhone.Facebook(Me.NavigationService)
‘Your AppID/API key come here’
.AppID = “1234567890”
‘In order to allow uploading photo to Facebook, the following scope is compulsory’
.Scope = “publish_stream,user_photos”
facebook.Message = “Hello World”
4. The DLL will popup all the following screens as well as Login screen if user is not authenticated.
5. After that the photo will be uploaded to Facebook