Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ChromeSafariBrowser requestPostMessageChannel is unimplemented. #2494

Open
1 of 2 tasks
LawrenceStent opened this issue Jan 10, 2025 · 0 comments
Open
1 of 2 tasks

ChromeSafariBrowser requestPostMessageChannel is unimplemented. #2494

LawrenceStent opened this issue Jan 10, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@LawrenceStent
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

The plugin throws an Unimplemented Exception when trying to use the ChromeSafariBrowser (required for using ChromeCustomTabs and needing secure webview), and calling browser.requestPostMessageChannel("www.xyz.com", "www.xyz.com").

The error:
E/flutter (26341): [ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: MissingPluginException(No implementation found for method requestPostMessageChannel on channel com.pichillilorenzo/flutter_chromesafaribrowser_1711081391042471983824345991992081426910332) E/flutter (26341): #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:332:7) E/flutter (26341): <asynchronous suspension> E/flutter (26341): #1 AndroidChromeSafariBrowser.requestPostMessageChannel (package:flutter_inappwebview_android/src/chrome_safari_browser/chrome_safari_browser.dart:335:12) E/flutter (26341): <asynchronous suspension> E/flutter (26341): #2 _ChromeSafariBrowserExampleScreenState.build.<anonymous closure> (package:post_message_test/src/sample_feature/chrome_webview:105:33) E/flutter (26341): <asynchronous suspension> E/flutter (26341):

Due to this we can't utilise web to app communication.

Expected Behavior

Expected behaviour is that requestPostMessageChannel and postMessage are implemented so that ChromeSafariBrowser.

I have a simple example app in this repo, that opens a browser and then calls widget.browser.requestPostMessageChannel(). Found here: https://github.com/TFG-Labs/flutter_post_message_test

I then cloned the library and tried implementing the method myself but ran into issues. I implement it in ChromeSafariBrowser:flutter_inappwebview_android/lib/src/chrome_safari_browser/chrome_safari_browser.dart. Found here: https://github.com/TFG-Labs/flutter_inappwebview_new_fork

*apologies for lack of commits on both repos.

I then also implement it in the ChromeSafariBrowserManager: flutter_inappwebview_android/chrome_custom_tabs/ChromeSafariBrowserManager.java

In ChromeCustomTabsChannelDelegate: flutter_inappwebview_android/chrome_custom_tabs/ChromeCustomTabsChannelDelegate.java

And in ChromeCustomTabsActivity: flutter_inappwebview_android/chrome_custom_tabs/ChromeCustomTabsActivity.java

But regardless nothing I've tried causes the unimplemented error to go away. I can't find another method channel that might need implementing, nor does implementing the method channel directly in the ChromeCustomTabsActivity work.

Steps with code example to reproduce

Steps with code example to reproduce
// Paste your code here

Stacktrace/Logs

Stacktrace/Logs
<Replace this line by pasting your stacktrace or logs here>

Flutter version

3.22.0

Operating System, Device-specific and/or Tool

Android 34

Plugin version

6.1.5

Additional information

No response

Self grab

  • I'm ready to work on this issue!
@LawrenceStent LawrenceStent added the bug Something isn't working label Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant