@@ -385,14 +385,16 @@ NS_SWIFT_NAME(Auth)
385
385
@param completion Optionally; a block invoked after the user of the calling Auth instance has
386
386
been updated or an error was encountered.
387
387
*/
388
- - (void )updateCurrentUser:(FIRUser *)user completion:(nullable FIRUserUpdateCallback)completion;
388
+ - (void )updateCurrentUser:(FIRUser *)user
389
+ completion:(nullable void (^)(NSError *_Nullable error))completion;
389
390
390
391
/* * @fn fetchProvidersForEmail:completion:
391
392
@brief Please use fetchSignInMethodsForEmail:completion: for Objective-C or
392
393
fetchSignInMethods(forEmail:completion:) for Swift instead.
393
394
*/
394
395
- (void )fetchProvidersForEmail:(NSString *)email
395
- completion:(nullable FIRProviderQueryCallback)completion
396
+ completion:(nullable void (^)(NSArray <NSString *> *_Nullable providers,
397
+ NSError *_Nullable error))completion
396
398
DEPRECATED_MSG_ATTRIBUTE(" Please use fetchSignInMethodsForEmail:completion: for Objective-C or "
397
399
" fetchSignInMethods(forEmail:completion:) for Swift instead." );
398
400
@@ -412,7 +414,8 @@ NS_SWIFT_NAME(Auth)
412
414
*/
413
415
414
416
- (void )fetchSignInMethodsForEmail:(NSString *)email
415
- completion:(nullable FIRSignInMethodQueryCallback)completion;
417
+ completion:(nullable void (^)(NSArray <NSString *> *_Nullable,
418
+ NSError *_Nullable))completion;
416
419
417
420
/* * @fn signInWithEmail:password:completion:
418
421
@brief Signs in using an email address and password.
@@ -437,7 +440,8 @@ NS_SWIFT_NAME(Auth)
437
440
*/
438
441
- (void )signInWithEmail:(NSString *)email
439
442
password:(NSString *)password
440
- completion:(nullable FIRAuthDataResultCallback)completion;
443
+ completion:(nullable void (^)(FIRAuthDataResult *_Nullable authResult,
444
+ NSError *_Nullable error))completion;
441
445
442
446
/* * @fn signInWithEmail:link:completion:
443
447
@brief Signs in using an email address and email sign-in link.
@@ -461,7 +465,9 @@ NS_SWIFT_NAME(Auth)
461
465
462
466
- (void )signInWithEmail:(NSString *)email
463
467
link:(NSString *)link
464
- completion:(nullable FIRAuthDataResultCallback)completion API_UNAVAILABLE (watchos);
468
+ completion:(nullable void (^)(FIRAuthDataResult *_Nullable authResult,
469
+ NSError *_Nullable error))completion
470
+ API_UNAVAILABLE(watchos);
465
471
466
472
/* * @fn signInWithProvider:UIDelegate:completion:
467
473
@brief Signs in using the provided auth provider instance.
@@ -509,14 +515,18 @@ NS_SWIFT_NAME(Auth)
509
515
*/
510
516
- (void )signInWithProvider:(id <FIRFederatedAuthProvider>)provider
511
517
UIDelegate:(nullable id <FIRAuthUIDelegate>)UIDelegate
512
- completion:(nullable FIRAuthDataResultCallback)completion API_UNAVAILABLE (watchos);
518
+ completion:(nullable void (^)(FIRAuthDataResult *_Nullable authResult,
519
+ NSError *_Nullable error))completion
520
+ API_UNAVAILABLE(watchos);
513
521
514
522
/* * @fn signInAndRetrieveDataWithCredential:completion:
515
523
@brief Please use signInWithCredential:completion: for Objective-C or "
516
524
"signIn(with:completion:) for Swift instead.
517
525
*/
518
526
- (void )signInAndRetrieveDataWithCredential:(FIRAuthCredential *)credential
519
- completion:(nullable FIRAuthDataResultCallback)completion
527
+ completion:
528
+ (nullable void (^)(FIRAuthDataResult *_Nullable authResult,
529
+ NSError *_Nullable error))completion
520
530
DEPRECATED_MSG_ATTRIBUTE(" Please use signInWithCredential:completion: for Objective-C or "
521
531
" signIn(with:completion:) for Swift instead." );
522
532
@@ -559,7 +569,8 @@ NS_SWIFT_NAME(Auth)
559
569
@remarks See `FIRAuthErrors` for a list of error codes that are common to all API methods
560
570
*/
561
571
- (void )signInWithCredential:(FIRAuthCredential *)credential
562
- completion:(nullable FIRAuthDataResultCallback)completion;
572
+ completion:(nullable void (^)(FIRAuthDataResult *_Nullable authResult,
573
+ NSError *_Nullable error))completion;
563
574
564
575
/* * @fn signInAnonymouslyWithCompletion:
565
576
@brief Asynchronously creates and becomes an anonymous user.
@@ -576,7 +587,8 @@ NS_SWIFT_NAME(Auth)
576
587
577
588
@remarks See `FIRAuthErrors` for a list of error codes that are common to all API methods.
578
589
*/
579
- - (void )signInAnonymouslyWithCompletion:(nullable FIRAuthDataResultCallback)completion;
590
+ - (void )signInAnonymouslyWithCompletion:(nullable void (^)(FIRAuthDataResult *_Nullable authResult,
591
+ NSError *_Nullable error))completion;
580
592
581
593
/* * @fn signInWithCustomToken:completion:
582
594
@brief Asynchronously signs in to Firebase with the given Auth token.
@@ -595,7 +607,8 @@ NS_SWIFT_NAME(Auth)
595
607
@remarks See `FIRAuthErrors` for a list of error codes that are common to all API methods.
596
608
*/
597
609
- (void )signInWithCustomToken:(NSString *)token
598
- completion:(nullable FIRAuthDataResultCallback)completion;
610
+ completion:(nullable void (^)(FIRAuthDataResult *_Nullable authResult,
611
+ NSError *_Nullable error))completion;
599
612
600
613
/* * @fn createUserWithEmail:password:completion:
601
614
@brief Creates and, on success, signs in a user with the given email address and password.
@@ -621,7 +634,8 @@ NS_SWIFT_NAME(Auth)
621
634
*/
622
635
- (void )createUserWithEmail:(NSString *)email
623
636
password:(NSString *)password
624
- completion:(nullable FIRAuthDataResultCallback)completion;
637
+ completion:(nullable void (^)(FIRAuthDataResult *_Nullable authResult,
638
+ NSError *_Nullable error))completion;
625
639
626
640
/* * @fn confirmPasswordResetWithCode:newPassword:completion:
627
641
@brief Resets the password given a code sent to the user outside of the app and a new password
@@ -644,7 +658,7 @@ NS_SWIFT_NAME(Auth)
644
658
*/
645
659
- (void )confirmPasswordResetWithCode:(NSString *)code
646
660
newPassword:(NSString *)newPassword
647
- completion:(FIRConfirmPasswordResetCallback )completion;
661
+ completion:(void (^)( NSError *_Nullable error) )completion;
648
662
649
663
/* * @fn checkActionCode:completion:
650
664
@brief Checks the validity of an out of band code.
@@ -663,7 +677,8 @@ NS_SWIFT_NAME(Auth)
663
677
asynchronously on the main thread in the future.
664
678
*/
665
679
- (void )verifyPasswordResetCode:(NSString *)code
666
- completion:(FIRVerifyPasswordResetCodeCallback)completion;
680
+ completion:
681
+ (void (^)(NSString *_Nullable email, NSError *_Nullable error))completion;
667
682
668
683
/* * @fn applyActionCode:completion:
669
684
@brief Applies out of band code.
@@ -675,7 +690,7 @@ NS_SWIFT_NAME(Auth)
675
690
@remarks This method will not work for out of band codes which require an additional parameter,
676
691
such as password reset code.
677
692
*/
678
- - (void )applyActionCode:(NSString *)code completion:(FIRApplyActionCodeCallback )completion;
693
+ - (void )applyActionCode:(NSString *)code completion:(void (^)( NSError *_Nullable error) )completion;
679
694
680
695
/* * @fn sendPasswordResetWithEmail:completion:
681
696
@brief Initiates a password reset for the given email address.
@@ -696,7 +711,7 @@ NS_SWIFT_NAME(Auth)
696
711
697
712
*/
698
713
- (void )sendPasswordResetWithEmail:(NSString *)email
699
- completion:(nullable FIRSendPasswordResetCallback )completion;
714
+ completion:(nullable void (^)( NSError *_Nullable error) )completion;
700
715
701
716
/* * @fn sendPasswordResetWithEmail:actionCodeSetting:completion:
702
717
@brief Initiates a password reset for the given email address and @FIRActionCodeSettings object.
@@ -728,7 +743,7 @@ NS_SWIFT_NAME(Auth)
728
743
*/
729
744
- (void )sendPasswordResetWithEmail:(NSString *)email
730
745
actionCodeSettings:(FIRActionCodeSettings *)actionCodeSettings
731
- completion:(nullable FIRSendPasswordResetCallback )completion;
746
+ completion:(nullable void (^)( NSError *_Nullable error) )completion;
732
747
733
748
/* * @fn sendSignInLinkToEmail:actionCodeSettings:completion:
734
749
@brief Sends a sign in with email link to provided email address.
@@ -741,7 +756,7 @@ NS_SWIFT_NAME(Auth)
741
756
*/
742
757
- (void )sendSignInLinkToEmail:(NSString *)email
743
758
actionCodeSettings:(FIRActionCodeSettings *)actionCodeSettings
744
- completion:(nullable FIRSendSignInLinkToEmailCallback )completion
759
+ completion:(nullable void (^)( NSError *_Nullable error) )completion
745
760
API_UNAVAILABLE(watchos);
746
761
747
762
/* * @fn signOut:
@@ -757,8 +772,6 @@ NS_SWIFT_NAME(Auth)
757
772
keychain. The `NSLocalizedFailureReasonErrorKey` field in the `NSError.userInfo`
758
773
dictionary will contain more information about the error encountered.
759
774
760
-
761
-
762
775
*/
763
776
- (BOOL )signOut:(NSError *_Nullable *_Nullable)error;
764
777
@@ -788,8 +801,9 @@ NS_SWIFT_NAME(Auth)
788
801
789
802
@return A handle useful for manually unregistering the block as a listener.
790
803
*/
804
+
791
805
- (FIRAuthStateDidChangeListenerHandle)addAuthStateDidChangeListener:
792
- (FIRAuthStateDidChangeListenerBlock )listener;
806
+ (void (^)(FIRAuth *auth, FIRUser *_Nullable user) )listener;
793
807
794
808
/* * @fn removeAuthStateDidChangeListener:
795
809
@brief Unregisters a block as an "auth state did change" listener.
@@ -818,7 +832,7 @@ NS_SWIFT_NAME(Auth)
818
832
@return A handle useful for manually unregistering the block as a listener.
819
833
*/
820
834
- (FIRIDTokenDidChangeListenerHandle)addIDTokenDidChangeListener:
821
- (FIRIDTokenDidChangeListenerBlock )listener;
835
+ (void (^)(FIRAuth *auth, FIRUser *_Nullable user) )listener;
822
836
823
837
/* * @fn removeIDTokenDidChangeListener:
824
838
@brief Unregisters a block as an "ID token did change" listener.
0 commit comments