September 2019
Beginner
512 pages
12h 52m
English
We pass the PluginRegistrantCallback instance to the Service class in the example project. We create a descendant of the FlutterApplication class, which will serve as our registrant callback to the service:
class Application: FlutterApplication(), PluginRegistry.PluginRegistrantCallback { override fun onCreate() { super.onCreate() Log.w("BACKGROUND", "application") BackgroundProcessService.setPluginRegistrant(this) } override fun registerWith(registry: PluginRegistry?) { GeneratedPluginRegistrant.registerWith(registry) }}
As you can see, we pass the application instance to the Service instance so it will be able to register in the Flutter engine. We also need to set our application class in AndroidManifest.xml ...
Read now
Unlock full access