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

PostMessage Run time error in Ios #613

Open
JoshuvaGeorge03 opened this issue Jan 20, 2020 · 4 comments
Open

PostMessage Run time error in Ios #613

JoshuvaGeorge03 opened this issue Jan 20, 2020 · 4 comments

Comments

@JoshuvaGeorge03
Copy link

JoshuvaGeorge03 commented Jan 20, 2020

Bug Report

I got an type error, when I try to do post message using

webkit.messageHandlers.cordova_iab.postMessage and the error was Type error: webkit is undefined and not an object. This only occurs in ios and not in android.

Problem

I can't able to send data back to my ionic/capacitor application.
After investigating, I have found out that this issue only present in cordova-plugin-inappbrowser v3.2.0... And this version not rise any issue with android, but cause issues with ios as I mentioned above.

So, kindly fix this issue.

What is expected to happen?

I want to communicate with my main app when i using inappbrowser.

What does actually happen?

I got an type error, when I try to do post message using

webkit.messageHandlers.cordova_iab.postMessage and the error was Type error: webkit is undefined and not an object. This only occurs in ios and not in android.

Command or Code

Kindly check this git hub repo https://github.com/JoshuvaGeorge03/cordova-inappbrowser-tes
and do npm install and run npm run release-ios Open the cordova inappbrowser and try to do post message using window.webkit.messageHandlers.cordova_iab.postMessage(JSON.stringify({data: 'test'}))

and check.

Environment, Platform, Device

Ionic:

Ionic CLI : 5.4.13 (C:\Users\Joshuva\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : @ionic/angular 4.11.8
@angular-devkit/build-angular : 0.803.23
@angular-devkit/schematics : 8.3.23
@angular/cli : 8.3.23
@ionic/angular-toolkit : 2.0.0

Capacitor:

Capacitor CLI : 1.4.0
@capacitor/core : 1.4.0

Utility:

cordova-res (update available: 0.8.1) : 0.3.0
native-run (update available: 0.3.0) : 0.2.2

System:

NodeJS : v10.11.0 (C:\Program Files\nodejs\node.exe)
npm : 6.13.6
OS : Windows 10

Version information

"cordova-plugin-inappbrowser": "3.2.0",

Checklist

  • [ *] I searched for existing GitHub issues
  • [* ] I updated all Cordova tooling to most recent version
  • [* ] I included all the necessary information above
@dpa99c
Copy link
Contributor

dpa99c commented Jan 20, 2020

@JoshuvaGeorge03 you appear to be using this plugin in a Capacitor project not a Cordova project which I would suspect is the cause of your project since the plugin code is designed to work in the Cordova runtime environment.

@JoshuvaGeorge03
Copy link
Author

@dpa99c

@JoshuvaGeorge03 you appear to be using this plugin in a Capacitor project not a Cordova project which I would suspect is the cause of your project since the plugin code is designed to work in the Cordova runtime environment.

if that is the reason, then it should not work in my android project which is also capacitor project. and In ios also, cordova-plugin-inappbrowser v3.1.0 works.

Only cordova-plugin-inappbrowser v3.2.0 throws error in runtime when doing postmessage

@xmetalmw
Copy link

I am hitting this issue in a Cordova project, built with PhoneGap Build. On iOS you do get an error saying that webkit is not defined when using the additional cordova-plugin-wkwebview-engine plugin for display of web content within my iOS app.

This same routine works in Android successfully using the standard InAppBrowser.

Both platforms are using the 3.2.0 version of the InAppBrowser.

@skle
Copy link

skle commented Feb 4, 2020

Having the same issue on iOS. After reverting to 3.1.0, this works fine.

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

No branches or pull requests

4 participants