question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to communicate between InappBrowser and my capacitor app?

See original GitHub issue

I want to send message from inappbrowser back to my app.

We can do that with cordova inappbrowser plugin using postMessage. (window.parent.postMessage).

But in Capacitor Browser Plugin there is no doc for that, also there is no api to listen to that messages? So I can’t able to send data back to my app also.

Current Scenario

I was hoisting my website using firebase. And I was loading that website inside of inappbrowser. And After user did some action, I want to send message to my app to run some code.

window.parent.postMessage(JSON.stringify('message', '*')

This is my code to send the message from inappbrowser to app. That is not working at all.

Expected

Kindly advice, If I am doing something wrong. And kindly tell me, how to achieve it.

Also, Kindly advice how to hide url bar in the inappbrowser?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
JoshuvaGeorge03commented, Jan 4, 2020

@digaus I am not talking about cordova-plugin-inappbrowser. I have gone through that documentation and I know how to do using cordova-plugin-inappbrowser.

I am talking about Capacitor Browser Plugin api, And I want to know how to do like that thing in this plugin?

Should we not use this plugin for inappbrowser requirements?

kindly check the link and advice. https://capacitor.ionicframework.com/docs/apis/browser

1reaction
digauscommented, Jan 10, 2020

@digaus I have used cordova-plugin-inappbrowser and it seems to be working fine in android.

But in ios, it throws run time error. when I try to open

Thread 1: EXC_BREAKPOINT (code=1, subcode=0x1039d784c)

Kindly find the image for your reference.

image

What to do? In cordova powered apps, it seems to work.

In android, it work perfectly well even using capacitor as runtime.

Don’t know, it works for me. Maybe create an issue on inappbrowser plugin.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to get events in @capacitor/Browser to send custom ...
I am Using @Capacitor/Browser plugin to open my website on In-AppBrowser. i am getting two events on “.addListnerEvents” as browserLoad and ...
Read more >
Cross Window Communication With Cordova's InAppBrowser
The InAppBrowser Plugin ... Creating an InAppBrowser is as simple as calling window.open() with the URL to open and the string "_blank" ....
Read more >
sirum/cordova-plugin-inappbrowser-capacitor - npm package
This plugin provides a web browser view that displays when calling cordova.InAppBrowser.open() . var ref = cordova.InAppBrowser.open('https://apache.org', ...
Read more >
run InAppBrowser in an Ionic + React + Capacitor environment
I'm completely new to this technology and I can't manage to run the InAppBrowser from @ionic-native/in-app-browser . I've installed the ...
Read more >
InAppBrowser Plugin | Launch an In-App Web Browser on Ionic
If you have not already setup Ionic Enterprise in your app, follow the one-time setup steps. Next, install the plugin: Capacitor; Cordova. npm...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found