Hi, this is Andy Rich from the C++ QA team. Previously, I showed you how you can use the C++ REST API to connect to Live services, but this is just one of many web services that you can use the REST API with. In this blog post, I will walk you through creating a Windows 8 Store App that will log a user into Facebook and download and display their photo albums.
Setting up a Facebook Developer Account
In order to develop apps for Facebook, you will need to have a real Facebook account, and sign up to be a developer on their platform, which you can accomplish by visiting http://developers.facebook.com.
Once you are enrolled as a developer, you will need to create an app identity by clicking “Apps” in the top bar and choosing “Create New App”. Give your app a name, but don’t worry about setting any of the other parameters for now. Click “Save Changes” and your app will be created.
You should also set your app to a “Desktop” app, which will reduce how often your users need to log in. To do this, select “Advanced” under your application settings, change App Type to “Native/Desktop” and set “App Secret in Client” to “No” and click the “Save Changes” button.
Finally, go your basic settings page and make note of your app’s App ID/API key (later referred to as
For the purposes of this post, we will be creating an abstraction to deal with communication with Facebook, a facebook_client class:
// Facebook.h
#pragma once
#include
#include
#include