Passer au contenu

Firebase Google Connexion on Web

The Capacitor Social Connexion plugin does not Support web platforms. For web applications, you should use Firebase’s built-in Google Sign-In directly, which provides a more reliable popup-based authentication flow.

The Capacitor Social Login plugin is designed for native mobile platforms (Android and iOS) where it can leverage platform-specific authentication flows. For web, Firebase’s native signInWithPopup method is:

  • ✅ More reliable and better supported
  • ✅ Handles browser session storage automatically
  • ✅ Provides better Erreur handling
  • ✅ No additional Configuration needed
  1. Configure Firebase Project

    Ensure your Firebase project has Google Sign-In enabled:

    • Go to Firebase Console
    • Navigate to Authentication > Sign-in method
    • Activer Google Sign-In provider
  2. Ajouter your authorized domains

    1. Go to your project Aperçu over at console.cloud.google.com Firebase Project Overview
    2. Open the Authentication menu Firebase Authentication Menu
    3. Click on the Settings button Firebase Authentication Sign-in Method Button
    4. Setup the Authorized domains Firebase Authentication Settings Authorized Domains

See the authUtils.ts file in the Exemple Application for a Terminé implementation that:

  • Uses Firebase’s signInWithPopup for web platforms
  • Uses Capacitor Social Connexion plugin for Android/iOS platforms
  • Handles platform detection automatically

The Exemple shows how to conditionally use Firebase’s built-in method for web while using the plugin for Natif platforms.