FIRAuthWebViewController.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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 <UIKit/UIKit.h>
  17. @class FIRAuthWebViewController;
  18. NS_ASSUME_NONNULL_BEGIN
  19. @protocol FIRAuthWebViewDelegate <NSObject>
  20. /** @fn webViewController:canHandleURL:
  21. @brief Determines if a URL should be handled by the delegate.
  22. @param URL The URL to handle.
  23. @return Whether the URL could be handled or not.
  24. */
  25. - (BOOL)webViewController:(FIRAuthWebViewController *)webViewController canHandleURL:(NSURL *)URL;
  26. /** @fn webViewControllerDidCancel:
  27. @brief Notifies the delegate that the web view controller is being cancelled by the user.
  28. @param webViewController The web view controller in question.
  29. */
  30. - (void)webViewControllerDidCancel:(FIRAuthWebViewController *)webViewController;
  31. /** @fn webViewController:didFailWithError:
  32. @brief Notifies the delegate that the web view controller failed to load a page.
  33. @param webViewController The web view controller in question.
  34. @param error The error that has occurred.
  35. */
  36. - (void)webViewController:(FIRAuthWebViewController *)webViewController
  37. didFailWithError:(NSError *)error;
  38. @end
  39. @interface FIRAuthWebViewController : UIViewController
  40. /** @fn initWithNibName:bundle:
  41. * @brief Please call initWithURL:delegate:
  42. */
  43. - (instancetype)initWithNibName:(nullable NSString *)nibNameOrNil
  44. bundle:(nullable NSBundle *)nibBundleOrNil NS_UNAVAILABLE;
  45. /** @fn initWithCoder:
  46. * @brief Please call initWithURL:delegate:
  47. */
  48. - (instancetype)initWithCoder:(NSCoder *)aDecoder NS_UNAVAILABLE;
  49. - (instancetype)initWithURL:(NSURL *)URL
  50. delegate:(__weak id<FIRAuthWebViewDelegate>)delegate
  51. NS_DESIGNATED_INITIALIZER;
  52. @end
  53. NS_ASSUME_NONNULL_END