fluttercommunity / fluttercommunity/flutter_webview_plugin

window.Print.postMessage is undefined

Open
#775 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1.5k
Forks
938
PR merge metrics
No merged PRs in 30d

Description

## System info

Issue occurs on: both
Plugin version: 0.3.11
Flutter doctor output:

```
[✓] Flutter (Channel unknown, v1.12.13+hotfix.9, on Linux, locale en_US.UTF-8)
• Flutter version 1.12.13+hotfix.9 at /media/user/disk3/Applications/flutter
• Framework revision f139b11009 (3 months ago), 2020-03-30 13:57:30 -0700
• Engine revision af51afceb8
• Dart version 2.7.2

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /media/user/disk3/Android/Sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 28.0.3
• ANDROID_HOME = /media/user/disk3/Android/Sdk
• ANDROID_SDK_ROOT = /media/user/disk3/Android/Sdk
• Java binary at: /snap/android-studio/90/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
• All Android licenses accepted.

[✓] Android Studio (version 4.0)
• Android Studio at /snap/android-studio/90/android-studio
• Flutter plugin version 45.1.1
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] Android Studio (version 3.6)
• Android Studio at /snap/android-studio/88/android-studio
• Flutter plugin version 44.0.2
• Dart plugin version 192.7761
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)

[✓] Connected device (1 available)
• Redmi 5 Plus • 0d559abd9905 • android-arm64 • Android 8.1.0 (API 27)
```

Hi,

I have a problem at loaded html page. My javascript code is here

```js
if (window.Print !== undefined) {
window.Print.postMessage(JSON.stringify({
event: 'polygonCreated',
coordinates: currentCoordinates.map(function (currentCoordinate) {
return [currentCoordinate.lat, currentCoordinate.lng];
}),
}));
} else {
alert('Error');
}
```

type of window.Print is object but I cant access Print.postMessage at release mode. It's working in debug mode but at release mode doesn't work

## Logs

I dont have any logs because no error

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the loaded HTML page in release mode with the reported window.Print.postMessage call, then compare it with debug mode using the Flutter plugin version and Android environment described above. Done means identifying why the bridge differs in release mode and confirming that postMessage works there or documenting the limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, java, javascript
Domain
mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.