| 1 |
/*** |
| 2 |
* Copyright (C) Microsoft. All rights reserved. |
| 3 |
* Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. |
| 4 |
* |
| 5 |
* =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ |
| 6 |
* |
| 7 |
* Facebook.h - Simple client for connecting to facebook. See blog post |
| 8 |
* at http://aka.ms/FacebookCppRest for a detailed walkthrough of this sample |
| 9 |
* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- |
| 10 |
****/ |
| 11 |
|
| 12 |
#pragma once |
| 13 |
#include <cpprest/http_client.h> |
| 14 |
#include <string> |
| 15 |
|
| 16 |
class facebook_client |
| 17 |
{ |
| 18 |
public: |
| 19 |
static facebook_client& instance(); // Singleton |
| 20 |
pplx::task<void> login(std::wstring scopes); |
| 21 |
pplx::task<web::json::value> get(std::wstring path); |
| 22 |
web::http::uri_builder base_uri(bool absolute = false); |
| 23 |
|
| 24 |
private: |
| 25 |
facebook_client() : raw_client(L"https://graph.facebook.com/"), signed_in(false) {} |
| 26 |
|
| 27 |
pplx::task<void> full_login(std::wstring scopes); |
| 28 |
|
| 29 |
std::wstring token_; |
| 30 |
bool signed_in; |
| 31 |
web::http::client::http_client raw_client; |
| 32 |
}; |