Deon
Posts: 0
Joined: Sun Jun 30, 2013 6:00 am

Breaking out of App

Hi

I am using inapp browsing. I can break out of the app using window.open but I need to get back in without pressing the backbutton on the phone 200 times.

I know you can do this with the HTML UI component but I need to send parameters from the app to the website I am browsing. It does not seem that the HTML component can receive parameters or can it?

Alternatively, is their a way that I can have the app retain control by having the menu on the screen and the browser session wrapped inside the app or is there anyway I can get back into the app by clicking a button or something in the website of the window.open session that will reopen the app at the page I broke out from?

Thank u
Deon

Deon
Posts: 0
Joined: Sun Jun 30, 2013 6:00 am

Breaking out of App

That is a different issue. Please can you read this question and answer accordingly.

Thank you.

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Breaking out of App

Deon, you can close inAppBrowser window directly, without pressing back button. You can send parameters to the website via GET parameters.

Deon
Posts: 0
Joined: Sun Jun 30, 2013 6:00 am

Breaking out of App

Hi

No you cant close the InAppBrowser. Browser is fullscreen. How?

I have tried to add eventlistner
ref.addEventListener('loadstop', function(event) {
if (event.url.match("returntomobile.aspx")) {
ref.close();
}
});

I am trying to close the window when I hit a certain url. This does not seem to work either. Not sure if my syntax is correct.

I seem to lose control once I am in the Inapp browser.

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Breaking out of App

Deon, you can use system browser: https://devcenter.appery.io/tutorials...
It has close button as you can see.

Deon
Posts: 0
Joined: Sun Jun 30, 2013 6:00 am

Breaking out of App

No. It does not have a close button.
Your picture is an illustration of the phone's back button. It has nothing to do with the app.

In addition, you can see the browser address bar. I dont want the user to see the address bar because the user can change the url and never come back to the app.

I now want to try the HTML UI component. Can I pass parameters to the HTML component from the app to open a url based on parameters?

I have asked this question before and no one could answer it.

Deon
Posts: 0
Joined: Sun Jun 30, 2013 6:00 am

Breaking out of App

Zzzz I will take the radio silence as this cant be done.

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Breaking out of App

Deon,

We passed your request to our developers, they are investigating it at the moment, but you are right, there is a possibility that unfortunately this is impossible.

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Breaking out of App

Deon,

This code works correctly on button click event
precode
var url = "http://appery.io",
exitUrl = "pricing&quot
var ref = window.open(url, '_blank', 'location=no');

ref.addEventListener('loadstart', function(event) {
if (event.url.match(exitUrl)) {
ref.close();
}
}); /code/pre

There are some nuances: if you go to the pricing page for example then inappbrowser closes. If you open it with codelocation=no/code, then users will not see the address and will not be able to change it except by following the links on your page. But as you remember you should test it only on a device and call codewindow.open/code (in our case click on the button) you should only after device ready event (before device ready event inappbrowser isn't loaded and in this case a new window of regular browser will be opened (close it will be problematic.).
Also please check all permissions of your target system http://docs.phonegap.com/en/edge/cord...
Please check that inappbrowser isn't disabled in your application
As for the html element, you can add iframe in it with the correct src (passing desired get parameters to the server)
https://developer.mozilla.org/en/docs...

Return to “Issues”