diff --git a/GoogleSignIn/Sources/GIDAuthentication.m b/GoogleSignIn/Sources/GIDAuthentication.m index ed4f5154..7965db1e 100644 --- a/GoogleSignIn/Sources/GIDAuthentication.m +++ b/GoogleSignIn/Sources/GIDAuthentication.m @@ -127,15 +127,21 @@ @interface GTMAppAuthFetcherAuthorizationWithEMMSupport : GTMAppAuthFetcherAutho @implementation GTMAppAuthFetcherAuthorizationWithEMMSupport +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-implementations" - (void)authorizeRequest:(nullable NSMutableURLRequest *)request delegate:(id)delegate didFinishSelector:(SEL)sel { +#pragma clang diagnostic pop GTMAppAuthFetcherAuthorizationEMMChainedDelegate *chainedDelegate = [[GTMAppAuthFetcherAuthorizationEMMChainedDelegate alloc] initWithDelegate:delegate selector:sel]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" [super authorizeRequest:request delegate:chainedDelegate didFinishSelector:@selector(authentication:request:finishedWithError:)]; +#pragma clang diagnostic pop } - (void)authorizeRequest:(nullable NSMutableURLRequest *)request @@ -206,7 +212,10 @@ - (NSString *)emmSupport { #pragma mark - Public methods +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" - (id)fetcherAuthorizer { +#pragma clang diagnostic pop #if TARGET_OS_IOS && !TARGET_OS_MACCATALYST GTMAppAuthFetcherAuthorization *authorization = self.emmSupport ? [[GTMAppAuthFetcherAuthorizationWithEMMSupport alloc] initWithAuthState:_authState] : diff --git a/GoogleSignIn/Sources/Public/GoogleSignIn/GIDAuthentication.h b/GoogleSignIn/Sources/Public/GoogleSignIn/GIDAuthentication.h index 976412a1..13ae1920 100644 --- a/GoogleSignIn/Sources/Public/GoogleSignIn/GIDAuthentication.h +++ b/GoogleSignIn/Sources/Public/GoogleSignIn/GIDAuthentication.h @@ -59,7 +59,10 @@ typedef void (^GIDAuthenticationCompletion)(GIDAuthentication *_Nullable authent /// Gets a new authorizer for `GTLService`, `GTMSessionFetcher`, or `GTMHTTPFetcher`. /// /// @return A new authorizer +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" - (id)fetcherAuthorizer; +#pragma clang diagnostic pop /// Get a valid access token and a valid ID token, refreshing them first if they have expired or are /// about to expire. diff --git a/GoogleSignIn/Tests/Unit/GIDAuthenticationTest.m b/GoogleSignIn/Tests/Unit/GIDAuthenticationTest.m index 2e9df65a..ad57bead 100644 --- a/GoogleSignIn/Tests/Unit/GIDAuthenticationTest.m +++ b/GoogleSignIn/Tests/Unit/GIDAuthenticationTest.m @@ -245,7 +245,10 @@ - (void)testFetcherAuthorizer { // internally, so let's just take the shortcut here by asserting we get a // GTMAppAuthFetcherAuthorization object. GIDAuthentication *auth = [self auth]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" id fetcherAuthroizer = auth.fetcherAuthorizer; +#pragma clang diagnostic pop XCTAssertTrue([fetcherAuthroizer isKindOfClass:[GTMAppAuthFetcherAuthorization class]]); XCTAssertTrue([fetcherAuthroizer canAuthorize]); }