iFun Engine API  1.0.0-b2601
Great Technology for Great Games
 All Classes Files Functions Variables Typedefs Macros
facebook_authentication.h
Go to the documentation of this file.
1 // Copyright (C) 2017 iFunFactory Inc. All Rights Reserved.
2 //
3 // This work is confidential and proprietary to iFunFactory Inc. and
4 // must not be used, disclosed, copied, or distributed without the prior
5 // consent of iFunFactory Inc.
6 
9 #ifndef INCLUDE_FUNAPI_SERVICE_FACEBOOK_AUTHENTICATION_H_
10 #define INCLUDE_FUNAPI_SERVICE_FACEBOOK_AUTHENTICATION_H_
11 
12 #include <funapi/common/json.h>
13 #include <funapi/player_account.h>
14 #include <funapi/types.h>
15 
16 
17 namespace fun {
18 
19 struct FacebookError {
20  FacebookError();
21  FacebookError(int64_t code, const string &message);
22 
23  int64_t code;
24  string message;
25 };
26 
27 
29  explicit FacebookAuthenticationRequest(const string &access_token);
30 
31  string access_token;
32 };
33 
34 
37  explicit FacebookAuthenticationResponse(const FacebookError &error);
38 
39  bool success;
40  string client_id;
41  string name;
42  FacebookError error;
43 };
44 
45 
47  explicit FacebookPersonalInfoRequest(const string &access_token);
48 
49  string access_token;
50 };
51 
52 
55 
56  bool success;
57  PlayerAccountVector friends;
58  FacebookError error;
59 };
60 
61 
62 typedef function<void(const FacebookAuthenticationRequest &request,
63  const FacebookAuthenticationResponse &response,
64  bool error)> FacebookAuthenticationResponseHandler;
65 
66 
67 typedef function<void(const FacebookPersonalInfoRequest &request,
68  const FacebookPersonalInfoResponse &response,
69  bool error)> FacebookPersonalInfoResponseHandler;
70 
71 
72 void Authenticate(const FacebookAuthenticationRequest &request,
73  const FacebookAuthenticationResponseHandler &handler,
74  size_t timeout_in_ms = 0);
75 
76 bool AuthenticateSync(const FacebookAuthenticationRequest &request,
78 
79 void GetPersonalInfo(const FacebookPersonalInfoRequest &request,
80  const FacebookPersonalInfoResponseHandler &handler,
81  size_t timeout_in_ms = 0);
82 
83 bool GetPersonalInfoSync(const FacebookPersonalInfoRequest &request,
85 
86 } // namespace fun
87 
88 #endif // INCLUDE_FUNAPI_SERVICE_FACEBOOK_AUTHENTICATION_H_
Definition: facebook_authentication.h:35
Definition: facebook_authentication.h:28
Definition: facebook_authentication.h:46
Definition: facebook_authentication.h:53
Definition: facebook_authentication.h:19