GIDUserAuthFlowController.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #import <Foundation/Foundation.h>
  2. @class OIDAuthState;
  3. @class GIDProfileData;
  4. @class GIDSignInInternalOptions;
  5. NS_ASSUME_NONNULL_BEGIN
  6. @interface GIDUserAuthFlowResult : NSObject
  7. @property(nonatomic, readonly) OIDAuthState *authState;
  8. @property(nonatomic, readonly) GIDProfileData *profileData;
  9. @property(nonatomic, readonly, nullable) NSString *serverAuthCode;
  10. - (instancetype)initWithAuthState:(OIDAuthState *)authState
  11. profileData:(GIDProfileData *)profileData
  12. serverAuthCode:(nullable NSString *)serverAuthCode;
  13. @end
  14. typedef void (^GIDUserAuthFlowCompletion)(GIDUserAuthFlowResult *_Nullable result,
  15. NSError *_Nullable error);
  16. @interface GIDUserAuthFlowController: NSObject
  17. /// This method should be called from your `UIApplicationDelegate`'s `application:openURL:options:`
  18. /// method.
  19. ///
  20. /// @param url The URL that was passed to the app.
  21. /// @return `YES` if `GIDSignIn` handled this URL.
  22. - (BOOL)handleURL:(NSURL *)url;
  23. - (void)signInWithOptions:(GIDSignInInternalOptions *)options
  24. completion:(GIDUserAuthFlowCompletion)completion;
  25. @end
  26. NS_ASSUME_NONNULL_END