iFun Engine API  1.0.0-b5770
Great Technology for Great Games
google_play_game_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_PLAY_GAME_AUTHENTICATION_H_
10 #define INCLUDE_FUNAPI_SERVICE_GOOGLE_PLAY_GAME_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 GooglePlayGameAuthenticationRequest {
20  GooglePlayGameAuthenticationRequest(const string &app_id,
21  const string &id_token);
22 
23  // app_id: deprecated, do not use this variable.
24  string app_id;
25  // app_provider_client_id=xxxxxxx.apps.googleusercontent.com
26  // xxxxxxx = provider(your game)'s client id (not user's client_id)
27  string app_provider_client_id;
28  // id_token: JWT ID token
29  string id_token;
30 };
31 
32 
33 struct FUNAPI_DLL_VISIBILITY GooglePlayGameAuthenticationResponse {
35  explicit GooglePlayGameAuthenticationResponse(
36  const int64_t error_code, const string &error_message);
37 
38  bool success;
39  int64_t error_code;
40  string error_message;
41 
42  // google_id: user's Google ID
43  string google_id;
44  // app_id: deprecated, do not use this variable.
45  string app_id;
46  // app_provider_client_id=xxxxxxx.apps.googleusercontent.com
47  // xxxxxxx = provider(your game)'s client id (not user's client_id)
48  string app_provider_client_id;
49  string name;
50  string picture;
51 };
52 
53 
54 typedef function<void(const GooglePlayGameAuthenticationRequest &request,
56  bool error)> GooglePlayGameAuthenticationResponseHandler;
57 
58 
59 FUNAPI_DLL_VISIBILITY
60 void Authenticate(const GooglePlayGameAuthenticationRequest &request,
61  const GooglePlayGameAuthenticationResponseHandler &handler,
62  size_t timeout_in_ms = 0);
63 
64 } // namespace fun
65 
66 #endif // INCLUDE_FUNAPI_SERVICE_GOOGLE_PLAY_GAME_AUTHENTICATION_H_
Definition: google_play_game_authentication.h:19
Definition: json.h:18
Definition: google_play_game_authentication.h:33