Skip to content

Commit 34a2a69

Browse files
authoredAug 19, 2024
Make sure FUIAuthDelegate methods get called for Firebase 11 (#1203)
1 parent f269cc1 commit 34a2a69

File tree

3 files changed

+38
-3
lines changed

3 files changed

+38
-3
lines changed
 

‎FirebaseAuthUI.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'FirebaseAuthUI'
3-
s.version = '14.2.3'
3+
s.version = '14.2.4'
44
s.summary = 'A prebuilt authentication UI flow for Firebase Auth.'
55
s.homepage = 'https://github.com/firebase/FirebaseUI-iOS'
66
s.license = { :type => 'Apache 2.0', :file => 'LICENSE' }

‎FirebaseAuthUI/Sources/FUIAuth.m

+8
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,7 @@ - (void)invokeResultCallbackWithAuthDataResult:(nullable FIRAuthDataResult *)aut
352352
URL:(nullable NSURL *)url
353353
error:(nullable NSError *)error {
354354
dispatch_async(dispatch_get_main_queue(), ^{
355+
// Firebase 10 signatures.
355356
if ([self.delegate respondsToSelector:@selector(authUI:didSignInWithAuthDataResult:URL:error:)]) {
356357
[self.delegate authUI:self
357358
didSignInWithAuthDataResult:authDataResult
@@ -361,6 +362,13 @@ - (void)invokeResultCallbackWithAuthDataResult:(nullable FIRAuthDataResult *)aut
361362
if ([self.delegate respondsToSelector:@selector(authUI:didSignInWithAuthDataResult:error:)]) {
362363
[self.delegate authUI:self didSignInWithAuthDataResult:authDataResult error:error];
363364
}
365+
// Firebase 11+ signatures.
366+
if ([self.delegate respondsToSelector:@selector(authUI:didSignInWith:URL:error:)]) {
367+
[self.delegate authUI:self didSignInWith:authDataResult URL:url error:error];
368+
}
369+
if ([self.delegate respondsToSelector:@selector(authUI:didSignInWith:error:)]) {
370+
[self.delegate authUI:self didSignInWith:authDataResult error:error];
371+
}
364372
#pragma clang diagnostic push
365373
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
366374
if ([self.delegate respondsToSelector:@selector(authUI:didSignInWithUser:error:)]) {

‎FirebaseAuthUI/Sources/Public/FirebaseAuthUI/FUIAuth.h

+29-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ typedef void (^FUIAuthResultCallback)(FIRUser *_Nullable user, NSError *_Nullabl
4848

4949
/** @fn authUI:didSignInWithAuthDataResult:error:
5050
@brief Message sent after the sign in process has completed to report the signed in user or
51-
error encountered.
51+
error encountered. Use this variation with Firebase 10 and earlier.
5252
@param authUI The @c FUIAuth instance sending the message.
5353
@param authDataResult The data result if the sign in attempt was successful.
5454
@param url pass the deep link associated with an email link sign-in completion. It is useful
@@ -62,7 +62,22 @@ typedef void (^FUIAuthResultCallback)(FIRUser *_Nullable user, NSError *_Nullabl
6262

6363
/** @fn authUI:didSignInWithAuthDataResult:error:
6464
@brief Message sent after the sign in process has completed to report the signed in user or
65-
error encountered.
65+
error encountered. Use this variation with Firebase 11 and later. Swift implementations
66+
should be marked with `@objc`.
67+
@param authUI The @c FUIAuth instance sending the message.
68+
@param authDataResult The data result if the sign in attempt was successful.
69+
@param url pass the deep link associated with an email link sign-in completion. It is useful
70+
for the developer to access the state before the sign-in attempt was triggered.
71+
@param error The error that occurred during sign in, if any.
72+
*/
73+
- (void)authUI:(FUIAuth *)authUI
74+
didSignInWith:(nullable FIRAuthDataResult *)authDataResult
75+
URL:(nullable NSURL *)url
76+
error:(nullable NSError *)error;
77+
78+
/** @fn authUI:didSignInWithAuthDataResult:error:
79+
@brief Message sent after the sign in process has completed to report the signed in user or
80+
error encountered. Use this variation with Firebase 10 and earlier.
6681
@param authUI The @c FUIAuth instance sending the message.
6782
@param authDataResult The data result if the sign in attempt was successful.
6883
@param error The error that occurred during sign in, if any.
@@ -71,6 +86,18 @@ typedef void (^FUIAuthResultCallback)(FIRUser *_Nullable user, NSError *_Nullabl
7186
didSignInWithAuthDataResult:(nullable FIRAuthDataResult *)authDataResult
7287
error:(nullable NSError *)error;
7388

89+
/** @fn authUI:didSignInWithAuthDataResult:error:
90+
@brief Message sent after the sign in process has completed to report the signed in user or
91+
error encountered. Use this variation with Firebase 11 and later. Swift implementations
92+
should be marked with `@objc`.
93+
@param authUI The @c FUIAuth instance sending the message.
94+
@param authDataResult The data result if the sign in attempt was successful.
95+
@param error The error that occurred during sign in, if any.
96+
*/
97+
- (void)authUI:(FUIAuth *)authUI
98+
didSignInWith:(nullable FIRAuthDataResult *)authDataResult
99+
error:(nullable NSError *)error;
100+
74101
/** @fn authUI:didSignInWithUser:error:
75102
@brief This is deprecated API and will be removed in a future release.
76103
Use @c authUI:didSignInWithAuthDataResult:error:

0 commit comments

Comments
 (0)