Skip to content

Conversation

@alexmercerind
Copy link

@alexmercerind alexmercerind commented Dec 19, 2025

Summary

If a AndroidNotificationAction with showsUserInterface: false is clicked, a new Flutter engine is created by the plugin internally. I have some platform channels inside my MainActivity, which I want to be accessible inside this newly created engine as well. #2338 describes a similar situation.

Thus, something similar to following can be used to configure the newly created Flutter engine e.g. registering a new platform channel:

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    FlutterLocalNotificationsPlugin.setConfigureFlutterEngineCallback {
        configureFlutterEngine(it)
    }
}
override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    FlutterLocalNotificationsPlugin.setConfigureFlutterEngineCallback(::configureFlutterEngine)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant