baumblatt / capacitor-firebase-auth

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

CapacitorFirebaseAuth configuration not loaded on Android #196

Open xinfengmich opened 2 years ago

xinfengmich commented 2 years ago

Version 3.0.0, Configuration for 'CapacitorFirebaseAuth' in capacitor.config.json is not loaded for GoogleProviderHandler on Android platform.

in CapacitorFirebaseAuth, public PluginConfig getConfig() { return this.config.getPluginConfiguration("plugins.CapacitorFirebaseAuth"); }

Should be return this.config.getPluginConfiguration("CapacitorFirebaseAuth");

Since this.config.getPluginConfiguration(String pluginId) already deserialize PluginsConfig.

In GoogleProviderHandler, should NOT include CONFIG_KEY_PREFIX to get 'permissions' and 'hostedDomain'.

// String[] permissions = this.plugin.getConfig().getArray(CONFIG_KEY_PREFIX + "permissions.google", new String[0]); String[] permissions = this.plugin.getConfig().getArray( "permissions.google", new String[0]);

// String hostedDomain = this.plugin.getConfig().getString(CONFIG_KEY_PREFIX + "properties.google.hostedDomain"); String hostedDomain = this.plugin.getConfig().getString("properties.google.hostedDomain");

Not tested 'Apple' and 'Twitter' Providers, not sure if its config is loaded on Android properly as both use String languageCode = this.plugin.getConfig().getString(CapacitorFirebaseAuth.CONFIG_KEY_PREFIX +"languageCode", "en");

ghost commented 2 years ago

I'm getting an error for trying to import the plugin. Is this related?:

image

xinfengmich commented 2 years ago

No, your error is not related to this. Please check your Capacitor version and if it is installed properly on Android . You need make sure to use the right version of capacitor-firebase-auth with Capacitor 2 or Capacitor 3 ... ...