Ei kuvausta

FIRGameCenterAuthProvider.h 2.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. @class FIRAuthCredential;
  18. NS_ASSUME_NONNULL_BEGIN
  19. /**
  20. @brief A string constant identifying the Game Center identity provider.
  21. */
  22. extern NSString *const FIRGameCenterAuthProviderID NS_SWIFT_NAME(GameCenterAuthProviderID);
  23. /**
  24. @brief A string constant identifying the Game Center sign-in method.
  25. */
  26. extern NSString *const _Nonnull FIRGameCenterAuthSignInMethod
  27. NS_SWIFT_NAME(GameCenterAuthSignInMethod);
  28. /** @typedef FIRGameCenterCredentialCallback
  29. @brief The type of block invoked when the Game Center credential code has finished.
  30. @param credential On success, the credential will be provided, nil otherwise.
  31. @param error On error, the error that occurred, nil otherwise.
  32. */
  33. typedef void (^FIRGameCenterCredentialCallback)(FIRAuthCredential *_Nullable credential,
  34. NSError *_Nullable error)
  35. NS_SWIFT_NAME(GameCenterCredentialCallback);
  36. /** @class FIRGameCenterAuthProvider
  37. @brief A concrete implementation of @c FIRAuthProvider for Game Center Sign In.
  38. */
  39. NS_SWIFT_NAME(GameCenterAuthProvider)
  40. @interface FIRGameCenterAuthProvider : NSObject
  41. /** @fn getCredentialWithCompletion:
  42. @brief Creates a @c FIRAuthCredential for a Game Center sign in.
  43. */
  44. + (void)getCredentialWithCompletion:(FIRGameCenterCredentialCallback)completion
  45. NS_SWIFT_NAME(getCredential(completion:));
  46. /** @fn init
  47. @brief This class is not meant to be initialized.
  48. */
  49. - (instancetype)init NS_UNAVAILABLE;
  50. @end
  51. NS_ASSUME_NONNULL_END