baumblatt / capacitor-firebase-auth

Capacitor Firebase Authentication Plugin
MIT License
261 stars 129 forks source link

Trouble to use the plugin with iOS #32

Closed scriptPilot closed 5 years ago

scriptPilot commented 5 years ago

Hey, thanks for the useful plugin :-)

I stuggle to sign in to Google from a Vue app without typescript support. My code:

import Firebase from 'firebase/app'
import {cfaSignIn} from 'capacitor-firebase-auth';
...
Firebase.initializeApp(...)
...
cfaSignIn('google.com').subscribe((user) => {
  this.$f7.dialog.alert('Display Name: ' + user.displayName)
})

I think it's used wrong as in the example the User object is somehow used.

Capacitor config:

Bildschirmfoto 2019-10-20 um 00 07 07

Error in the browser:

Bildschirmfoto 2019-10-19 um 23 49 46

Error in the Xcode logs:

Bildschirmfoto 2019-10-20 um 00 03 36
baumblatt commented 5 years ago

Hi @scriptPilot

You need to properly initialize your Firebase App before using the plugin.

Officials Docs: Add Firebase SDKs and initialize Firebase

Stackoverflow: Where to initialize firebase in Vue js app?

Please let me know if you have any questions, or we can close this issue.

If you like this plugin, please don't forget to put a star the project to help others to find it.

Best regards, Bernardo Baumblatt

scriptPilot commented 5 years ago

Hello Bernado, thanks for your response, in fact I did as shown in the code above. Any other clue, may it be related to Parcel Bundler?

scriptPilot commented 5 years ago

@baumblatt - I tried again with a clean setup and now it works, so seems to be no bug :-)