설명 없음

FIRFederatedAuthProvider.h 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. #if TARGET_OS_IOS
  18. #import "FIRAuthUIDelegate.h"
  19. #endif // TARGET_OS_IOS
  20. @class FIRAuthCredential;
  21. NS_ASSUME_NONNULL_BEGIN
  22. /**
  23. Utility type for constructing federated auth provider credentials.
  24. */
  25. NS_SWIFT_NAME(FederatedAuthProvider)
  26. @protocol FIRFederatedAuthProvider <NSObject>
  27. /** @typedef FIRAuthCredentialCallback
  28. @brief The type of block invoked when obtaining an auth credential.
  29. @param credential The credential obtained.
  30. @param error The error that occurred if any.
  31. */
  32. typedef void(^FIRAuthCredentialCallback)(FIRAuthCredential *_Nullable credential,
  33. NSError *_Nullable error)
  34. NS_SWIFT_NAME(AuthCredentialCallback);
  35. #if TARGET_OS_IOS
  36. /** @fn getCredentialWithUIDelegate:completion:
  37. @brief Used to obtain an auth credential via a mobile web flow.
  38. @param UIDelegate An optional UI delegate used to presenet the mobile web flow.
  39. @param completion Optionally; a block which is invoked asynchronously on the main thread when
  40. the mobile web flow is completed.
  41. */
  42. - (void)getCredentialWithUIDelegate:(nullable id<FIRAuthUIDelegate>)UIDelegate
  43. completion:(nullable FIRAuthCredentialCallback)completion;
  44. #endif // TARGET_OS_IOS
  45. @end
  46. NS_ASSUME_NONNULL_END