FIRAppDistributionAppDelegateInterceptor.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // Copyright 2020 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #import <Foundation/Foundation.h>
  15. #import <UIKit/UIKit.h>
  16. NS_ASSUME_NONNULL_BEGIN
  17. @protocol OIDExternalUserAgentSession;
  18. /// An instance of this class is meant to be registered as an AppDelegate interceptor, and
  19. /// implements the logic that my SDK needs to perform when certain app delegate methods are invoked.
  20. @interface FIRAppDistributionAppDelegatorInterceptor : NSObject <UIApplicationDelegate>
  21. /// Returns the MYAppDelegateInterceptor singleton.
  22. /// Always register just this singleton as the app delegate interceptor. This instance is
  23. /// retained. The App Delegate Swizzler only retains weak references and so this is needed.
  24. + (instancetype)sharedInstance;
  25. /*! @brief The authorization flow session which receives the return URL from
  26. \SFSafariViewController.
  27. @discussion We need to store this in the app delegate as it's that delegate which receives the
  28. incoming URL on UIApplicationDelegate.application:openURL:options:. This property will be
  29. nil, except when an authorization flow is in progress.
  30. */
  31. @property(nonatomic, strong, nullable) id<OIDExternalUserAgentSession> currentAuthorizationFlow;
  32. @end
  33. NS_ASSUME_NONNULL_END