import io.flutter.embedding.engine.plugins.FlutterPlugin
import io.flutter.embedding.engine.plugins.activity.ActivityAware
@Keep
public class MyPlugin: FlutterPlugin, ActivityAware {
...my custom implementation
}
And registering it in the MainActivity like this:
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
super.configureFlutterEngine(flutterEngine)
flutterEngine.plugins.add(MyPlugin())
}
Accessing MyPlugin from the generated jni bindings returns a new instance of the class that hasn't been initialized by the flutter engine. How can I implement a workflow that allows me to access always the same instance of MyPlugin using jnigen generated bindings that was added to the flutter engine plugins in configureFlutterEngine.
I created a plugin similar to this:
And registering it in the MainActivity like this:
Accessing
MyPlugin
from the generated jni bindings returns a new instance of the class that hasn't been initialized by the flutter engine. How can I implement a workflow that allows me to access always the same instance ofMyPlugin
using jnigen generated bindings that was added to the flutter engine plugins inconfigureFlutterEngine
.