Closed erlendaksnes-ws closed 2 years ago
Hi! Thank you for using the plugin. The plugin can be registered as follows, by calling add
inside the init function of your MainActivity.java
file:
import android.os.Bundle;
import com.getcapacitor.BridgeActivity;
import com.getcapacitor.Plugin;
import java.util.ArrayList;
import nl.recognize.msauthplugin.MsAuthPlugin;
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>>() {{
add(MsAuthPlugin.class);
}});
}
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.clear();
}
}
Hi @bartwesselink thanks for your work, I'm currently implementing this plugin. I think it would be good idea to add this exemple code in the setup guide for other users
The setup says that the last step for android is: "Register the plugin in the main activity". Do you have an example of how you register it?