FIRUser.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. * Copyright 2017 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 FIRAuthTokenResult;
  18. @class FIRPhoneAuthCredential;
  19. @class FIRUserProfileChangeRequest;
  20. @class FIRUserMetadata;
  21. @protocol FIRAuthUIDelegate;
  22. NS_ASSUME_NONNULL_BEGIN
  23. /** @typedef FIRAuthTokenCallback
  24. @brief The type of block called when a token is ready for use.
  25. @see `User.getIDToken()`
  26. @see `User.idTokenForcingRefresh(_:)`
  27. @param token Optionally; an access token if the request was successful.
  28. @param error Optionally; the error which occurred - or nil if the request was successful.
  29. @remarks One of `token` or `error` will always be non-nil.
  30. */
  31. typedef void (^FIRAuthTokenCallback)(NSString *_Nullable token, NSError *_Nullable error)
  32. NS_SWIFT_UNAVAILABLE("Use Swift's closure syntax instead.");
  33. /** @typedef FIRAuthTokenResultCallback
  34. @brief The type of block called when a token is ready for use.
  35. @see `User.getIDToken()`
  36. @see `User.idTokenForcingRefresh(_:)`
  37. @param tokenResult Optionally; an object containing the raw access token string as well as other
  38. useful data pertaining to the token.
  39. @param error Optionally; the error which occurred - or nil if the request was successful.
  40. @remarks One of `token` or `error` will always be non-nil.
  41. */
  42. typedef void (^FIRAuthTokenResultCallback)(FIRAuthTokenResult *_Nullable tokenResult,
  43. NSError *_Nullable error)
  44. NS_SWIFT_UNAVAILABLE("Use Swift's closure syntax instead.");
  45. /** @typedef FIRUserProfileChangeCallback
  46. @brief The type of block called when a user profile change has finished.
  47. @param error Optionally; the error which occurred - or nil if the request was successful.
  48. */
  49. typedef void (^FIRUserProfileChangeCallback)(NSError *_Nullable error)
  50. NS_SWIFT_UNAVAILABLE("Use Swift's closure syntax instead.");
  51. /** @typedef FIRSendEmailVerificationCallback
  52. @brief The type of block called when a request to send an email verification has finished.
  53. @param error Optionally; the error which occurred - or nil if the request was successful.
  54. */
  55. typedef void (^FIRSendEmailVerificationCallback)(NSError *_Nullable error)
  56. NS_SWIFT_UNAVAILABLE("Use Swift's closure syntax instead.");
  57. NS_ASSUME_NONNULL_END