-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] iOS crashes when Google sign in is not enabled #1004
Comments
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight. |
So, for an explanation on why this happens. The important part is that any of the OAuthProviders (like the Microsoft one) require adding the custom URL scheme to your XCode project's Info.plist, as documented here: https://firebase.google.com/docs/auth/ios/microsoft-oauth#handle_the_sign-in_flow_with_the_firebase_sdk The Unity SDK tries to automate that step, by copying it from the REVERSED_CLIENT_ID in your GoogleServices-Info.plist, which is happening here:
Now I'm not sure why the REVERSED_CLIENT_ID seems to only be present in the GoogleServices-Info.plist when Google Sign-In is turned on, I can reach out to folks on my end about that part. I think there is also a CLIENT_ID, that one can derive the reversed version from if needed, so I can see if that is more likely to be present, and if so add some logic for that. At the very least, I can improve that error message, cause it is definitely missing that other things depend on that field as well. |
Description
Summary
Our project is using Firebase Auth to only support logging into our game with Microsoft. However we were seeing a crash on iOS that was fixed by turning on Google Sign In even though we're not using it. Specifically, I needed to include the
REVERSED_CLIENT_ID
property in theGoogleService-Info.plist
, which is only added after enabling Google Sign In.Detailed description
Tracking down this dependency was a bit obtuse (admittedly I didn't have a Mac handy to actually debug the crash). Since the crash was occurring without any user facing error, I initially assumed there was something wrong with our initialization code. After a few hours with no success, I submitted a crash report from my test device and pulled it from Testflight (didn't learn about this handy feature until today). In the crash report I found the exception originating from Firebase's iOS plugin, specifically
getCredentialWithUIDelegate
:Thankfully the source for the plugin is available, so I was able to look up the relevant line which has some extra info:
Then it was just a couple of Google searches to figure out that "registering a custom URL" scheme meant
REVERSED_CLIENT_ID
was missing from myGoogleService-Info.plist
.While I'm still pretty sure requiring Google Sign In is a bug, I think this would have been a lot easier to catch if some validation was added either when the plist is imported, or during a build step. Granted there is this log I saw at build time:
GoogleService-Info.plist file missing REVERSED_CLIENT_ID, Google Sign-In will fail to initialize
. However I ignored it since we aren't using Google Sign In 😵Reproducing the issue
No response
Firebase Unity SDK Version
11.7.0
Unity editor version
2022.3.10
Installation Method
.unitypackage
Problematic Firebase Component(s)
Authentication
Other Firebase Component(s) in use
No response
Additional SDKs you are using
No response
Targeted Platform(s)
Apple Platforms, Android
Unity editor platform
Windows
Scripting Runtime
IL2CPP
Release Distribution Type
Pre-built SDK from https://firebase.google.com/download/unity
Relevant Log Output
No response
If using CocoaPods for Apple platforms, the project's Podfile.lock
Expand
Podfile.lock
snippet👀 Replace this line with the contents of your Podfile.lock!
The text was updated successfully, but these errors were encountered: