FIRFederatedAuthProvider.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. #import "FIRAuthUIDelegate.h"
  18. @class FIRAuthCredential;
  19. NS_ASSUME_NONNULL_BEGIN
  20. /**
  21. Utility type for constructing federated auth provider credentials.
  22. */
  23. NS_SWIFT_NAME(FederatedAuthProvider)
  24. @protocol FIRFederatedAuthProvider <NSObject>
  25. /** @typedef FIRAuthCredentialCallback
  26. @brief The type of block invoked when obtaining an auth credential.
  27. @param credential The credential obtained.
  28. @param error The error that occurred if any.
  29. */
  30. typedef void (^FIRAuthCredentialCallback)(FIRAuthCredential *_Nullable credential,
  31. NSError *_Nullable error)
  32. NS_SWIFT_UNAVAILABLE("Use Swift's closure syntax instead.");
  33. /** @fn getCredentialWithUIDelegate:completion:
  34. @brief Used to obtain an auth credential via a mobile web flow.
  35. This method is available on iOS only.
  36. @param UIDelegate An optional UI delegate used to present the mobile web flow.
  37. @param completion Optionally; a block which is invoked asynchronously on the main thread when
  38. the mobile web flow is completed.
  39. */
  40. - (void)getCredentialWithUIDelegate:(nullable id<FIRAuthUIDelegate>)UIDelegate
  41. completion:(nullable void (^)(FIRAuthCredential *_Nullable credential,
  42. NSError *_Nullable error))completion
  43. API_UNAVAILABLE(macos,
  44. tvos,
  45. watchos
  46. #if defined(TARGET_OS_VISION)
  47. ,
  48. visionos
  49. #endif // defined(TARGET_OS_VISION)
  50. );
  51. @end
  52. NS_ASSUME_NONNULL_END