Skip to content

bug: cannot find provider 'google' when adding apple: {} #197

Description

@rbalet

Bug Report

Capacitor Version

  @capacitor/cli: 7.2.0
  @capacitor/core: 7.2.0
  @capacitor/android: 7.2.0
  @capacitor/ios: 7.2.0

Plugin Version

 @capgo/cli: 7.5.0│
 @capgo/capacitor-social-login: 7.5.9

context(s)

ManualModel: false
AutoMode: false
CapgoCloud: false
OnPremise: false

Platform(s)

Android

Current Behavior

When fiering SoialLogin.login, I do get the following issue

{message: "Cannot find provider 'google'"}

Expected Behavior

Returning the token and other information

Code Reproduction

    SocialLogin.initialize({
      google: {
        webClientId: environment.google_web_cient_id, // Use Web Client ID for all platforms
        iOSClientId: environment.google_ios_cient_id, // for iOS
        mode: 'online' // replaces grantOfflineAccess
      },
      apple: {}
    });

Other Technical Details

npm --version output: 11.3.0

node --version output: 22.14.0

pod --version output (iOS issues only): 1.16.2

Additional Context

The following fix the issue, so either

  1. We enhance the doc to wrap example around their targeted platform
  2. This is a bug and is required to be fixed

What makes it works as commented here

  if (Capacitor.getPlatform() === 'android') {
    SocialLogin.initialize({
      google: {
        webClientId: environment.google_web_cient_id, // Use Web Client ID for all platforms
        iOSClientId: environment.google_ios_cient_id, // for iOS
        mode: 'online' // replaces grantOfflineAccess
      }
    });
  }
  if (Capacitor.getPlatform() === 'ios') {
    SocialLogin.initialize({
      google: {
        webClientId: environment.google_web_cient_id, // Use Web Client ID for all platforms
        iOSClientId: environment.google_ios_cient_id, // for iOS
        mode: 'online' // replaces grantOfflineAccess
      },
      apple: {}
    });
  }

Metadata

Metadata

Assignees

No one assigned

    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