Open GroupeBEL opened 4 years ago
Same here. Seems like the plugin is not recognized when Android. iOS works fine.
@webteambel found the solution:
When in Android, plugins must be exported: https://capacitor.ionicframework.com/docs/plugins/android/#export-to-capacitor
Following the link above, import the class: import com.teamhive.capacitor.plugin.SingleSignOn;
...and add the plugin: add(SingleSignOn.class);
What files what you add those lines of code in?
MainActivity.java
Sharing mine below:
package com.myapp;
import android.os.Bundle;
import com.getcapacitor.BridgeActivity;
import com.getcapacitor.Plugin;
import java.util.ArrayList;
// Other imports...
import com.teamhive.capacitor.plugin.SingleSignOn;
public class MainActivity extends BridgeActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Initializes the Bridge
this.init(savedInstanceState, new ArrayList<Class<? extends Plugin>>() {{
// Additional plugins you've installed go here
// Ex: add(TotallyAwesomePlugin.class);
add(SingleSignOn.class);
}});
}
}
Hello,
When I run my ionic application in android and I tried to sign in, I got this problem:
Cannot read property 'authenticate' of undefined
I tried to test it with android 10 and android 8.
iOS is showing the authentication.