iFun Engine API  1.0.0-b6053
Great Technology for Great Games
google_plus_authentication.h
Go to the documentation of this file.
1 // Copyright (C) 2013-2020 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 
19 struct FUNAPI_DLL_VISIBILITY GooglePlusError {
21  GooglePlusError(int64_t code, const string &message);
22 
23  int64_t code;
24  string message;
25 };
26 
27 
28 struct FUNAPI_DLL_VISIBILITY GooglePlusAuthenticationRequest {
29  explicit GooglePlusAuthenticationRequest(const string &access_token);
30 
31  string access_token;
32 };
33 
34 
35 struct FUNAPI_DLL_VISIBILITY GooglePlusAuthenticationResponse {
37  explicit GooglePlusAuthenticationResponse(const GooglePlusError &error);
38 
39  bool success;
40  string client_id;
41  string display_name;
42  string image_url;
43  GooglePlusError error;
44 };
45 
46 
47 struct FUNAPI_DLL_VISIBILITY GooglePlusPersonalInfoRequest {
48  GooglePlusPersonalInfoRequest(const string &access_token,
49  const string &client_id);
50 
51  string access_token;
52  string client_id;
53 };
54 
55 
56 struct FUNAPI_DLL_VISIBILITY GooglePlusPersonalInfoResponse {
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 FUNAPI_DLL_VISIBILITY
75 void Authenticate(const GooglePlusAuthenticationRequest &request,
76  const GooglePlusAuthenticationResponseHandler &handler,
77  size_t timeout_in_ms = 0);
78 
79 FUNAPI_DLL_VISIBILITY
80 bool AuthenticateSync(const GooglePlusAuthenticationRequest &request,
82 
83 FUNAPI_DLL_VISIBILITY
84 void GetPersonalInfo(const GooglePlusPersonalInfoRequest &request,
85  const GooglePlusPersonalInfoResponseHandler &handler,
86  size_t timeout_in_ms = 0);
87 
88 FUNAPI_DLL_VISIBILITY
89 bool GetPersonalInfoSync(const GooglePlusPersonalInfoRequest &request,
91 
92 } // namespace fun
93 
94 #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: json.h:18
Definition: google_plus_authentication.h:47