From ed8c12dffcc3948e0196ede4e6270ef4714ea268 Mon Sep 17 00:00:00 2001 From: Peter Andrews Date: Thu, 8 Dec 2022 10:14:00 -0800 Subject: [PATCH 1/2] Use a consistent approach to the extension availability of methods. --- .../Sources/Public/GoogleSignIn/GIDGoogleUser.h | 3 ++- GoogleSignIn/Sources/Public/GoogleSignIn/GIDSignIn.h | 12 ++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/GoogleSignIn/Sources/Public/GoogleSignIn/GIDGoogleUser.h b/GoogleSignIn/Sources/Public/GoogleSignIn/GIDGoogleUser.h index 342c0ab4..ba5b1dd7 100644 --- a/GoogleSignIn/Sources/Public/GoogleSignIn/GIDGoogleUser.h +++ b/GoogleSignIn/Sources/Public/GoogleSignIn/GIDGoogleUser.h @@ -112,7 +112,8 @@ NS_ASSUME_NONNULL_BEGIN - (void)addScopes:(NSArray *)scopes presentingWindow:(NSWindow *)presentingWindow completion:(nullable void (^)(GIDUserAuth *_Nullable userAuth, - NSError *_Nullable error))completion; + NSError *_Nullable error))completion + NS_EXTENSION_UNAVAILABLE("The add scopes flow is not supported in App Extensions."); #endif diff --git a/GoogleSignIn/Sources/Public/GoogleSignIn/GIDSignIn.h b/GoogleSignIn/Sources/Public/GoogleSignIn/GIDSignIn.h index c25442af..cfc6dc73 100644 --- a/GoogleSignIn/Sources/Public/GoogleSignIn/GIDSignIn.h +++ b/GoogleSignIn/Sources/Public/GoogleSignIn/GIDSignIn.h @@ -160,7 +160,8 @@ typedef NS_ERROR_ENUM(kGIDSignInErrorDomain, GIDSignInErrorCode) { hint:(nullable NSString *)hint additionalScopes:(nullable NSArray *)additionalScopes completion:(nullable void (^)(GIDUserAuth *_Nullable userAuth, - NSError *_Nullable error))completion; + NSError *_Nullable error))completion + NS_EXTENSION_UNAVAILABLE("The sign-in flow is not supported in App Extensions."); #elif TARGET_OS_OSX /// Starts an interactive sign-in flow on macOS. @@ -175,7 +176,8 @@ typedef NS_ERROR_ENUM(kGIDSignInErrorDomain, GIDSignInErrorCode) { /// be called asynchronously on the main queue. - (void)signInWithPresentingWindow:(NSWindow *)presentingWindow completion:(nullable void (^)(GIDUserAuth *_Nullable userAuth, - NSError *_Nullable error))completion; + NSError *_Nullable error))completion + NS_EXTENSION_UNAVAILABLE("The sign-in flow is not supported in App Extensions."); /// Starts an interactive sign-in flow on macOS using the provided hint. /// @@ -192,7 +194,8 @@ typedef NS_ERROR_ENUM(kGIDSignInErrorDomain, GIDSignInErrorCode) { - (void)signInWithPresentingWindow:(NSWindow *)presentingWindow hint:(nullable NSString *)hint completion:(nullable void (^)(GIDUserAuth *_Nullable userAuth, - NSError *_Nullable error))completion; + NSError *_Nullable error))completion + NS_EXTENSION_UNAVAILABLE("The sign-in flow is not supported in App Extensions."); /// Starts an interactive sign-in flow on macOS using the provided hint. /// @@ -211,7 +214,8 @@ typedef NS_ERROR_ENUM(kGIDSignInErrorDomain, GIDSignInErrorCode) { hint:(nullable NSString *)hint additionalScopes:(nullable NSArray *)additionalScopes completion:(nullable void (^)(GIDUserAuth *_Nullable userAuth, - NSError *_Nullable error))completion; + NSError *_Nullable error))completion + NS_EXTENSION_UNAVAILABLE("The sign-in flow is not supported in App Extensions."); #endif From 77ca42c74d93e482bc7ff861366d93fccb760ac0 Mon Sep 17 00:00:00 2001 From: Peter Andrews Date: Thu, 8 Dec 2022 10:22:14 -0800 Subject: [PATCH 2/2] Revert macOS unavailability. --- GoogleSignIn/Sources/Public/GoogleSignIn/GIDGoogleUser.h | 3 +-- GoogleSignIn/Sources/Public/GoogleSignIn/GIDSignIn.h | 9 +++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/GoogleSignIn/Sources/Public/GoogleSignIn/GIDGoogleUser.h b/GoogleSignIn/Sources/Public/GoogleSignIn/GIDGoogleUser.h index ba5b1dd7..342c0ab4 100644 --- a/GoogleSignIn/Sources/Public/GoogleSignIn/GIDGoogleUser.h +++ b/GoogleSignIn/Sources/Public/GoogleSignIn/GIDGoogleUser.h @@ -112,8 +112,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)addScopes:(NSArray *)scopes presentingWindow:(NSWindow *)presentingWindow completion:(nullable void (^)(GIDUserAuth *_Nullable userAuth, - NSError *_Nullable error))completion - NS_EXTENSION_UNAVAILABLE("The add scopes flow is not supported in App Extensions."); + NSError *_Nullable error))completion; #endif diff --git a/GoogleSignIn/Sources/Public/GoogleSignIn/GIDSignIn.h b/GoogleSignIn/Sources/Public/GoogleSignIn/GIDSignIn.h index cfc6dc73..29453cda 100644 --- a/GoogleSignIn/Sources/Public/GoogleSignIn/GIDSignIn.h +++ b/GoogleSignIn/Sources/Public/GoogleSignIn/GIDSignIn.h @@ -176,8 +176,7 @@ typedef NS_ERROR_ENUM(kGIDSignInErrorDomain, GIDSignInErrorCode) { /// be called asynchronously on the main queue. - (void)signInWithPresentingWindow:(NSWindow *)presentingWindow completion:(nullable void (^)(GIDUserAuth *_Nullable userAuth, - NSError *_Nullable error))completion - NS_EXTENSION_UNAVAILABLE("The sign-in flow is not supported in App Extensions."); + NSError *_Nullable error))completion; /// Starts an interactive sign-in flow on macOS using the provided hint. /// @@ -194,8 +193,7 @@ typedef NS_ERROR_ENUM(kGIDSignInErrorDomain, GIDSignInErrorCode) { - (void)signInWithPresentingWindow:(NSWindow *)presentingWindow hint:(nullable NSString *)hint completion:(nullable void (^)(GIDUserAuth *_Nullable userAuth, - NSError *_Nullable error))completion - NS_EXTENSION_UNAVAILABLE("The sign-in flow is not supported in App Extensions."); + NSError *_Nullable error))completion; /// Starts an interactive sign-in flow on macOS using the provided hint. /// @@ -214,8 +212,7 @@ typedef NS_ERROR_ENUM(kGIDSignInErrorDomain, GIDSignInErrorCode) { hint:(nullable NSString *)hint additionalScopes:(nullable NSArray *)additionalScopes completion:(nullable void (^)(GIDUserAuth *_Nullable userAuth, - NSError *_Nullable error))completion - NS_EXTENSION_UNAVAILABLE("The sign-in flow is not supported in App Extensions."); + NSError *_Nullable error))completion; #endif