No Description

FIRSignInWithGameCenterRequest.h 3.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * Copyright 2018 Google
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import <Foundation/Foundation.h>
  17. #import "FIRAuthRPCRequest.h"
  18. #import "FIRIdentityToolkitRequest.h"
  19. NS_ASSUME_NONNULL_BEGIN
  20. /** @class FIRSignInWithGameCenterRequest
  21. @brief The request to sign in with Game Center account
  22. */
  23. @interface FIRSignInWithGameCenterRequest : FIRIdentityToolkitRequest <FIRAuthRPCRequest>
  24. /** @property playerID
  25. @brief The playerID to verify.
  26. */
  27. @property(nonatomic, copy) NSString *playerID;
  28. /** @property publicKeyURL
  29. @brief The URL for the public encryption key.
  30. */
  31. @property(nonatomic, copy) NSURL *publicKeyURL;
  32. /** @property signature
  33. @brief The verification signature data generated by Game Center.
  34. */
  35. @property(nonatomic, copy) NSData *signature;
  36. /** @property salt
  37. @brief A random strong used to compute the hash and keep it randomized.
  38. */
  39. @property(nonatomic, copy) NSData *salt;
  40. /** @property timestamp
  41. @brief The date and time that the signature was created.
  42. */
  43. @property(nonatomic, assign) uint64_t timestamp;
  44. /** @property accessToken
  45. @brief The STS Access Token for the authenticated user, only needed for linking the user.
  46. */
  47. @property(nonatomic, copy, nullable) NSString *accessToken;
  48. /** @property displayName
  49. @brief The display name of the local Game Center player.
  50. */
  51. @property(nonatomic, copy, nullable) NSString *displayName;
  52. /** @fn initWithEndpoint:requestConfiguration:
  53. @brief Please use initWithPlayerID:publicKeyURL:signature:salt:timestamp:requestConfiguration:.
  54. */
  55. - (nullable instancetype)initWithEndpoint:(NSString *)endpoint
  56. requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
  57. NS_UNAVAILABLE;
  58. /** @fn initWithPlayerID:publicKeyURL:signature:salt:timestamp:displayName:requestConfiguration:
  59. @brief Designated initializer.
  60. @param playerID The ID of the Game Center player.
  61. @param publicKeyURL The URL for the public encryption key.
  62. @param signature The verification signature generated.
  63. @param salt A random string used to compute the hash and keep it randomized.
  64. @param timestamp The date and time that the signature was created.
  65. @param displayName The display name of the Game Center player.
  66. */
  67. - (nullable instancetype)initWithPlayerID:(NSString *)playerID
  68. publicKeyURL:(NSURL *)publicKeyURL
  69. signature:(NSData *)signature
  70. salt:(NSData *)salt
  71. timestamp:(uint64_t)timestamp
  72. displayName:(NSString *)displayName
  73. requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
  74. NS_DESIGNATED_INITIALIZER;
  75. @end
  76. NS_ASSUME_NONNULL_END