iFun Engine API  1.0.0-b3630
Great Technology for Great Games
 All Classes Files Functions Variables Typedefs Macros
apple_game_center_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_APPLE_GAME_CENTER_AUTHENTICATION_H_
10 #define INCLUDE_FUNAPI_SERVICE_APPLE_GAME_CENTER_AUTHENTICATION_H_
11 
12 #include <funapi/types.h>
13 
14 
15 namespace fun {
16 
17 enum AppleGameCenterAuthErrorCode {
18  kUnknownError,
19  kCertificateVerificationFailure,
20  kCurlError,
21  kInvalidCertificate,
22  kInvalidCertificateIssuer,
23  kInvalidHttpStatus,
24  kInvalidAuthParameter,
25  kInvalidPublicKeyUrl,
26  kAuthenticationSuccess
27 };
28 
29 
32  const string &bundle_id, const string &player_id,
33  const string &public_key_url, const std::vector<uint8_t> &signature,
34  const std::vector<uint8_t> &salt, const uint64_t timestamp);
35 
36  string bundle_id;
37  string player_id;
38  string public_key_url;
39  std::vector<uint8_t> signature;
40  std::vector<uint8_t> salt;
41  uint64_t timestamp;
42 };
43 
44 
47  const string &bundle_id, const string &player_id,
48  const string &public_key_url, const string &b64_signature,
49  const string &b64_salt, const uint64_t timestamp);
50 
51  string bundle_id;
52  string player_id;
53  string public_key_url;
54  string b64_signature;
55  string b64_salt;
56  uint64_t timestamp;
57 };
58 
59 
62 
63  bool success;
64  AppleGameCenterAuthErrorCode error_code;
65  string error_message;
66 };
67 
68 
69 typedef function<
70  void(const AppleGameCenterAuthenticationRequest &request,
72  bool error)> AppleGameCenterAuthenticationResponseHandler;
73 
74 typedef function<
75  void(const AppleGameCenterAuthenticationRequest2 &request,
77  bool error)> AppleGameCenterAuthenticationResponseHandler2;
78 
79 
80 void Authenticate(const AppleGameCenterAuthenticationRequest &request,
81  const AppleGameCenterAuthenticationResponseHandler &handler,
82  size_t timeout_in_ms = 0);
83 
84 
85 void Authenticate(const AppleGameCenterAuthenticationRequest2 &request,
86  const AppleGameCenterAuthenticationResponseHandler2 &handler,
87  size_t timeout_in_ms = 0);
88 
89 } // namespace fun
90 
91 #endif // INCLUDE_FUNAPI_SERVICE_APPLE_GAME_CENTER_AUTHENTICATION_H_
Definition: apple_game_center_authentication.h:60
Definition: apple_game_center_authentication.h:45
Definition: apple_game_center_authentication.h:30