Hello,
in my app I am trying to log user via phone, but every time I send the request, screen goes black and the app crashes.
Request looks like this:
.login({
type: firebase.LoginType.PHONE,
phoneOptions: {
phoneNumber: this.customerPhone
}
})
.then(result => console.log(JSON.stringify(result)))
.catch(err => console.error(err))
Additional info:
Is there a way to get additional info on the crash report?
Is phone auth enabled in the Firebase console?
Yes, Firebase console has phone auth enabled.
OK, please share the repo (or one I can clone) so I can reproduce it.
I'm having the same problem. The app crash without any error message. I've tracked down and found that it crashed in file firebase.ios.ts at line 799: verifyPhoneNumberUIDelegateCompletion
@EddyVerbruggen please test with my repo below. I've uploaded my repo at:
https://github.com/phamhuy/huyapp.git
It's working for android, but not ios. The description of this plugin says it's only working for physical devices but not simulator/emulator, but I found that it's been working for android emulators. I've been struggling to get it to work with ios for a few weeks now.
@phamhuy When I run your repo it crashes for me as well, but just below that logged message about verifyPhoneNumberUIDelegateCompletion there's this:
* Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Please register custom URL scheme 'com.googleusercontent.apps.422739635229-ibefj7fnji9lhuo00k9t08qoskf6egjd' in the app's Info.plist file.'
So I copied over my config of the demo app in this repo and the crash was gone.
I figured out my problem: I missed the reCAPTCHA step in the instruction in firebase console. The step is to add custom URL schemes. So, I've fixed the issue by adding the following to Info.plist:
<!-- Info.plist -->
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>CLIENT_REVERSED_ID</string>
</array>
</dict>
</array>
where CLIENT_REVERSED_ID value is copied over from GoogleService-Info.plist.
@EddyVerbruggen I think you should update the installation instruction to include this step.
@phamhuy I think you're pretty qualified to do that actually ;)
Here's an example: https://github.com/EddyVerbruggen/nativescript-plugin-firebase/blob/06de110c628489de1da5c6034b112c1ed92df3d3/docs/AUTHENTICATION.md#ios-1