Skip to content

InAppBrowser does not allow Flutter to receive activity results on android #2797

@PropFault

Description

@PropFault

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When using InAppBrowser on Android, plugins that also use native Android Functions and require to receive activity result callbacks do not work anymore.
For example, in the permission_handler plugin, when requesting a permission, the Future never completes since the plugin is waiting for the activity result internally, which is instead delivered to the browser.

I am currently working around this by temporarily reordering my backstack so that flutter is in the foreground briefly while I use certain plugins.

Expected Behavior

The browser should make an effort to forward activity results to other plugins registered/to the main flutter activity.

Steps with code example to reproduce

  1. Get permission_handler
  2. Open any webpage in InAppBrowser
  3. After the page has loaded, attempt to request a permission. e.g. await Permission.Camera.request()
  4. The function will never complete

Stacktrace/Logs


Flutter version

v3.41.2

Operating System, Device-specific and/or Tool

Android 16

Plugin version

6.1.5

Additional information

No response

Self grab

  • I'm ready to work on this issue!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions