421
Views
6
Comments
[InAppBrowser Plugin] can you notify up to container app from event in web browser?
Question
inappbrowser-plugin
Mobile icon
Forge asset by OutSystems

Is there any way I can have an event thrown in a webpage in the in app browser to notify the app containing the browser that it needs to do something?  I will be doing another outsystems "web" application page within the browser, but I would like for something done within the browser to notify the parent "mobile" app that it needs to perform some action.

2019-01-09 06-13-28
Peter Gladysek

I would like to know too. Doing a payment gate and need to check for a success or fail URL in the the in App Browser to complete a client action.

2017-08-09 12-12-29
Jason Herrington

Peter, thanks to Rui with Outsystems we were able to get it working.  As he made it I will leave it to Rui if he wants to make it a forge item but basically here is what you do:

- start an in app browser using the forge item and start event listeners, specifically the "exit" event is what we look at and in the listener you can see what url the browser is exiting to

- forward the in app browser to where you want it to go to, what we did was for CAS authentication so we forwarded it to the CAS authentication page with a return url to another "web" OutSystems app that we had made that receives the CAS token, checks the token and then forwards itself to a false url like "https://donewithmystuff.com"

- on the exit event listener for the in app browser in your mobile app if you see an "exit" event you check the url returned from the listener against what you know it should be (the false url above) and if so you close the browser and run an action to do what you need to check.  For us it was checking back with our OutSystems page database to see if the token supplied to the CAS page has someone logged in associated with it.

Let me know if that helps

UserImage.jpg
Mohammad Modallal

Hello,


Could you please explain how could we start event listener, in my case i want to listen to 'loadstart' event


Thanks


2017-08-09 12-12-29
Jason Herrington

Mohammad Modallal wrote:

Hello,


Could you please explain how could we start event listener, in my case i want to listen to 'loadstart' event


Thanks


Here you go: https://www.outsystems.com/forge/component/1674/inappbrowserevents/


2018-03-05 03-47-24
Anggun Nurani

Jason Herrington wrote:

Mohammad Modallal wrote:

Hello,


Could you please explain how could we start event listener, in my case i want to listen to 'loadstart' event


Thanks


Here you go: https://www.outsystems.com/forge/component/1674/inappbrowserevents/


Hi Jason, 

I want to add exit events, but i don't know how to use InAppBrowserEvents.
Please give me step by step use the plugin.
Would be great if you include a screenshot :D


Thanks, Regrads

Anggun Nurani


2017-08-09 12-12-29
Jason Herrington

Mohammad, there is a good bit involved with getting that working.  I think Rui may have made a forge item and I sent him a message this morning.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.