iFun Engine API  1.0.0-b3776
Great Technology for Great Games
 All Classes Files Functions Variables Typedefs Macros
google_plus_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_GOOGLE_PLUS_AUTHENTICATION_H_
10 #define INCLUDE_FUNAPI_SERVICE_GOOGLE_PLUS_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 
21  GooglePlusError(int64_t code, const string &message);
22 
23  int64_t code;
24  string message;
25 };
26 
27 
29  explicit GooglePlusAuthenticationRequest(const string &access_token);
30 
31  string access_token;
32 };
33 
34 
38 
39  bool success;
40  string client_id;
41  string display_name;
42  string image_url;
43  GooglePlusError error;
44 };
45 
46 
48  GooglePlusPersonalInfoRequest(const string &access_token,
49  const string &client_id);
50 
51  string access_token;
52  string client_id;
53 };
54 
55 
58 
59  bool success;
60  PlayerAccountVector friends;
61  GooglePlusError error;
62 };
63 
64 
65 typedef function<void(const GooglePlusAuthenticationRequest &request,
66  const GooglePlusAuthenticationResponse &response,
67  bool error)> GooglePlusAuthenticationResponseHandler;
68 
69 
70 typedef function<void(const GooglePlusPersonalInfoRequest &request,
71  const GooglePlusPersonalInfoResponse &response,
72  bool error)> GooglePlusPersonalInfoResponseHandler;
73 
74 
75 void Authenticate(const GooglePlusAuthenticationRequest &request,
76  const GooglePlusAuthenticationResponseHandler &handler,
77  size_t timeout_in_ms = 0);
78 
79 bool AuthenticateSync(const GooglePlusAuthenticationRequest &request,
81 
82 void GetPersonalInfo(const GooglePlusPersonalInfoRequest &request,
83  const GooglePlusPersonalInfoResponseHandler &handler,
84  size_t timeout_in_ms = 0);
85 
86 bool GetPersonalInfoSync(const GooglePlusPersonalInfoRequest &request,
88 
89 } // namespace fun
90 
91 #endif // INCLUDE_FUNAPI_SERVICE_GOOGLE_PLUS_AUTHENTICATION_H_
Definition: google_plus_authentication.h:35
Definition: google_plus_authentication.h:28
Definition: google_plus_authentication.h:56
Definition: google_plus_authentication.h:19
Definition: google_plus_authentication.h:47