@@ -187,8 +187,8 @@ - (BOOL)hasPreviousSignIn {
187187 return [authState isAuthorized ];
188188}
189189
190- - (void )restorePreviousSignInWithCallback : (nullable GIDSignInCallback) callback {
191- [self signInWithOptions: [GIDSignInInternalOptions silentOptionsWithCallback: callback ]];
190+ - (void )restorePreviousSignInWithCompletion : (nullable GIDSignInCompletion) completion {
191+ [self signInWithOptions: [GIDSignInInternalOptions silentOptionsWithCompletion: completion ]];
192192}
193193
194194- (BOOL )restorePreviousSignInNoRefresh {
@@ -217,52 +217,52 @@ - (BOOL)restorePreviousSignInNoRefresh {
217217- (void )signInWithConfiguration : (GIDConfiguration *)configuration
218218 presentingViewController : (UIViewController *)presentingViewController
219219 hint : (nullable NSString *)hint
220- callback : (nullable GIDSignInCallback) callback {
220+ completion : (nullable GIDSignInCompletion) completion {
221221 GIDSignInInternalOptions *options =
222222 [GIDSignInInternalOptions defaultOptionsWithConfiguration: configuration
223223 presentingViewController: presentingViewController
224224 loginHint: hint
225- addScopesFlow: NO
226- callback: callback ];
225+ addScopesFlow: NO
226+ completion: completion ];
227227 [self signInWithOptions: options];
228228}
229229
230230- (void )signInWithConfiguration : (GIDConfiguration *)configuration
231231 presentingViewController : (UIViewController *)presentingViewController
232232 hint : (nullable NSString *)hint
233233 additionalScopes : (nullable NSArray <NSString *> *)additionalScopes
234- callback : (nullable GIDSignInCallback) callback {
234+ completion : (nullable GIDSignInCompletion) completion {
235235 GIDSignInInternalOptions *options =
236236 [GIDSignInInternalOptions defaultOptionsWithConfiguration: configuration
237237 presentingViewController: presentingViewController
238238 loginHint: hint
239239 addScopesFlow: NO
240240 scopes: additionalScopes
241- callback: callback ];
241+ completion: completion ];
242242 [self signInWithOptions: options];
243243}
244244
245245- (void )signInWithConfiguration : (GIDConfiguration *)configuration
246246 presentingViewController : (UIViewController *)presentingViewController
247- callback : (nullable GIDSignInCallback) callback {
247+ completion : (nullable GIDSignInCompletion) completion {
248248 [self signInWithConfiguration: configuration
249249 presentingViewController: presentingViewController
250250 hint: nil
251- callback: callback ];
251+ completion: completion ];
252252}
253253
254254- (void )addScopes : (NSArray <NSString *> *)scopes
255255 presentingViewController : (UIViewController *)presentingViewController
256- callback : (nullable GIDSignInCallback) callback {
256+ completion : (nullable GIDSignInCompletion) completion {
257257 // A currentUser must be available in order to complete this flow.
258258 if (!self.currentUser ) {
259259 // No currentUser is set, notify callback of failure.
260260 NSError *error = [NSError errorWithDomain: kGIDSignInErrorDomain
261261 code: kGIDSignInErrorCodeNoCurrentUser
262262 userInfo: nil ];
263- if (callback ) {
263+ if (completion ) {
264264 dispatch_async (dispatch_get_main_queue (), ^{
265- callback (nil , error);
265+ completion (nil , error);
266266 });
267267 }
268268 return ;
@@ -278,7 +278,7 @@ - (void)addScopes:(NSArray<NSString *> *)scopes
278278 presentingViewController: presentingViewController
279279 loginHint: self .currentUser.profile.email
280280 addScopesFlow: YES
281- callback: callback ];
281+ completion: completion ];
282282
283283 NSSet <NSString *> *requestedScopes = [NSSet setWithArray: scopes];
284284 NSMutableSet <NSString *> *grantedScopes =
@@ -290,9 +290,9 @@ - (void)addScopes:(NSArray<NSString *> *)scopes
290290 NSError *error = [NSError errorWithDomain: kGIDSignInErrorDomain
291291 code: kGIDSignInErrorCodeScopesAlreadyGranted
292292 userInfo: nil ];
293- if (callback ) {
293+ if (completion ) {
294294 dispatch_async (dispatch_get_main_queue (), ^{
295- callback (nil , error);
295+ completion (nil , error);
296296 });
297297 }
298298 return ;
@@ -310,52 +310,52 @@ - (void)addScopes:(NSArray<NSString *> *)scopes
310310- (void )signInWithConfiguration : (GIDConfiguration *)configuration
311311 presentingWindow : (NSWindow *)presentingWindow
312312 hint : (nullable NSString *)hint
313- callback : (nullable GIDSignInCallback) callback {
313+ completion : (nullable GIDSignInCompletion) completion {
314314 GIDSignInInternalOptions *options =
315315 [GIDSignInInternalOptions defaultOptionsWithConfiguration: configuration
316316 presentingWindow: presentingWindow
317317 loginHint: hint
318- addScopesFlow: NO
319- callback: callback ];
318+ addScopesFlow: NO
319+ completion: completion ];
320320 [self signInWithOptions: options];
321321}
322322
323323- (void )signInWithConfiguration : (GIDConfiguration *)configuration
324324 presentingWindow : (NSWindow *)presentingWindow
325- callback : (nullable GIDSignInCallback) callback {
325+ completion : (nullable GIDSignInCompletion) completion {
326326 [self signInWithConfiguration: configuration
327327 presentingWindow: presentingWindow
328328 hint: nil
329- callback: callback ];
329+ completion: completion ];
330330}
331331
332332- (void )signInWithConfiguration : (GIDConfiguration *)configuration
333333 presentingWindow : (NSWindow *)presentingWindow
334334 hint : (nullable NSString *)hint
335335 additionalScopes : (nullable NSArray <NSString *> *)additionalScopes
336- callback : (nullable GIDSignInCallback) callback {
336+ completion : (nullable GIDSignInCompletion) completion {
337337 GIDSignInInternalOptions *options =
338338 [GIDSignInInternalOptions defaultOptionsWithConfiguration: configuration
339339 presentingWindow: presentingWindow
340340 loginHint: hint
341341 addScopesFlow: NO
342342 scopes: additionalScopes
343- callback: callback ];
343+ completion: completion ];
344344 [self signInWithOptions: options];
345345}
346346
347347- (void )addScopes : (NSArray <NSString *> *)scopes
348- presentingWindow : (NSWindow *)presentingWindow
349- callback : (nullable GIDSignInCallback) callback {
348+ presentingWindow : (NSWindow *)presentingWindow
349+ completion : (nullable GIDSignInCompletion) completion {
350350 // A currentUser must be available in order to complete this flow.
351351 if (!self.currentUser ) {
352352 // No currentUser is set, notify callback of failure.
353353 NSError *error = [NSError errorWithDomain: kGIDSignInErrorDomain
354354 code: kGIDSignInErrorCodeNoCurrentUser
355355 userInfo: nil ];
356- if (callback ) {
356+ if (completion ) {
357357 dispatch_async (dispatch_get_main_queue (), ^{
358- callback (nil , error);
358+ completion (nil , error);
359359 });
360360 }
361361 return ;
@@ -371,7 +371,7 @@ - (void)addScopes:(NSArray<NSString *> *)scopes
371371 presentingWindow: presentingWindow
372372 loginHint: self .currentUser.profile.email
373373 addScopesFlow: YES
374- callback: callback ];
374+ completion: completion ];
375375
376376 NSSet <NSString *> *requestedScopes = [NSSet setWithArray: scopes];
377377 NSMutableSet <NSString *> *grantedScopes =
@@ -383,9 +383,9 @@ - (void)addScopes:(NSArray<NSString *> *)scopes
383383 NSError *error = [NSError errorWithDomain: kGIDSignInErrorDomain
384384 code: kGIDSignInErrorCodeScopesAlreadyGranted
385385 userInfo: nil ];
386- if (callback ) {
386+ if (completion ) {
387387 dispatch_async (dispatch_get_main_queue (), ^{
388- callback (nil , error);
388+ completion (nil , error);
389389 });
390390 }
391391 return ;
@@ -411,7 +411,7 @@ - (void)signOut {
411411 [self removeAllKeychainEntries ];
412412}
413413
414- - (void )disconnectWithCallback : (nullable GIDDisconnectCallback) callback {
414+ - (void )disconnectWithCompletion : (nullable GIDDisconnectCompletion) completion {
415415 GIDGoogleUser *user = _currentUser;
416416 OIDAuthState *authState = user.authentication .authState ;
417417 if (!authState) {
@@ -428,9 +428,9 @@ - (void)disconnectWithCallback:(nullable GIDDisconnectCallback)callback {
428428 if (!token) {
429429 [self signOut ];
430430 // Nothing to do here, consider the operation successful.
431- if (callback ) {
431+ if (completion ) {
432432 dispatch_async (dispatch_get_main_queue (), ^{
433- callback (nil );
433+ completion (nil );
434434 });
435435 }
436436 return ;
@@ -453,9 +453,9 @@ - (void)disconnectWithCallback:(nullable GIDDisconnectCallback)callback {
453453 if (!error) {
454454 [self signOut ];
455455 }
456- if (callback ) {
456+ if (completion ) {
457457 dispatch_async (dispatch_get_main_queue (), ^{
458- callback (error);
458+ completion (error);
459459 });
460460 }
461461 }];
@@ -538,10 +538,10 @@ - (void)signInWithOptions:(GIDSignInInternalOptions *)options {
538538 if (error) {
539539 [self authenticateWithOptions: options];
540540 } else {
541- if (options.callback ) {
541+ if (options.completion ) {
542542 self->_currentOptions = nil ;
543543 dispatch_async (dispatch_get_main_queue (), ^{
544- options.callback (self->_currentUser , nil );
544+ options.completion (self->_currentUser , nil );
545545 });
546546 }
547547 }
@@ -707,10 +707,10 @@ - (void)authenticateWithOptions:(GIDSignInInternalOptions *)options {
707707 NSError *error = [NSError errorWithDomain: kGIDSignInErrorDomain
708708 code: kGIDSignInErrorCodeHasNoAuthInKeychain
709709 userInfo: nil ];
710- if (options.callback ) {
710+ if (options.completion ) {
711711 _currentOptions = nil ;
712712 dispatch_async (dispatch_get_main_queue (), ^{
713- options.callback (nil , error);
713+ options.completion (nil , error);
714714 });
715715 }
716716 return ;
@@ -881,11 +881,11 @@ - (void)addCompletionCallback:(GIDAuthFlow *)authFlow {
881881 __weak GIDAuthFlow *weakAuthFlow = authFlow;
882882 [authFlow addCallback: ^() {
883883 GIDAuthFlow *handlerAuthFlow = weakAuthFlow;
884- if (self->_currentOptions .callback ) {
885- GIDSignInCallback callback = self->_currentOptions .callback ;
884+ if (self->_currentOptions .completion ) {
885+ GIDSignInCompletion completion = self->_currentOptions .completion ;
886886 self->_currentOptions = nil ;
887887 dispatch_async (dispatch_get_main_queue (), ^{
888- callback (self->_currentUser , handlerAuthFlow.error );
888+ completion (self->_currentUser , handlerAuthFlow.error );
889889 });
890890 }
891891 }];
0 commit comments