Skip to content

Firebase UI - Apple Login issue #830

@saalisumer

Description

@saalisumer

I am facing an issue with the new Apple Login using Firebase Auth UI.
My setup:
Target OS: 12.0
Language: Swift
Device: iPhone 6S
OS: 13.3
Crash Frequency: Consistently reproduced
Pod Setup:
pod 'Firebase/Core'
pod 'FirebaseUI', '~> 8.4.0'
pod 'Firebase/Messaging'
pod 'Firebase/Analytics'

When trying to authenticate using Apple Login ONLY on iOS 13 and above, the app crashes with the following trace just after Apple Login is done through Touch ID. When I stepped through line by line in debug mode, the crash doesn't happen. I think there is some issue with accessToken getting cleared after Apple Login. Kindly look into the issue and provide the resolution.
Following the code for Auth UI.

private func getAuthUI()->FUIAuth?{
        if let authUI = self.authUI{
            return authUI
        }
        else{
            if let auth_ui = FUIAuth(uiWith: auth){
                auth_ui.delegate = self
                var providers:[FUIAuthProvider]
                if #available(iOS 13.0, *) {
                    auth_ui.isInteractiveDismissEnabled = false
                    providers = [FUIFacebookAuth(permissions: []), FUIGoogleAuth(), FUIOAuth.appleAuthProvider()]
                } else {
                    providers = [FUIFacebookAuth(permissions: []), FUIGoogleAuth()]
                }
                auth_ui.providers = providers
                self.authUI = auth_ui
            }
            return self.authUI
        }
    }

Crashlytics Logs:
Fatal Exception: NSInvalidArgumentException
One of IDToken, accessToken, pendingToken, or requestURI must be supplied.

Fatal Exception: NSInvalidArgumentException
0 CoreFoundation 0x19c53ea48 __exceptionPreprocess
1 libobjc.A.dylib 0x19c265fa4 objc_exception_throw
2 CoreFoundation 0x19c4341c0 -[NSCache init]
3 Public 0x104bf6538 -[FIRVerifyAssertionRequest unencodedHTTPRequestBodyWithError:] + 138 (FIRVerifyAssertionRequest.m:138)
4 Public 0x104bd7840 -[FIRAuthBackendRPCImplementation postWithRequest:response:callback:] + 833 (FIRAuthBackend.m:833)
5 Public 0x104bd682c -[FIRAuthBackendRPCImplementation verifyAssertion:callback:] + 648 (FIRAuthBackend.m:648)
6 Public 0x104bd5714 +[FIRAuthBackend verifyAssertion:callback:] + 461 (FIRAuthBackend.m:461)
7 Public 0x104bcd504 -[FIRAuth internalSignInAndRetrieveDataWithCredential:isReauthentication:callback:] + 903 (FIRAuth.m:903)
8 Public 0x104bccff8 __58-[FIRAuth signInAndRetrieveDataWithCredential:completion:]_block_invoke + 747 (FIRAuth.m:747)
9 libdispatch.dylib 0x19c20a610 _dispatch_call_block_and_release
10 libdispatch.dylib 0x19c20b184 _dispatch_client_callout
11 libdispatch.dylib 0x19c1b7404 _dispatch_lane_serial_drain$VARIANT$mp
12 libdispatch.dylib 0x19c1b7df8 _dispatch_lane_invoke$VARIANT$mp
13 libdispatch.dylib 0x19c1c1314 _dispatch_workloop_worker_thread
14 libsystem_pthread.dylib 0x19c25ab88 _pthread_wqthread
15 libsystem_pthread.dylib 0x19c25d760 start_wqthread

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions