Page 1 of 2

Breaking out of App

Posted: Mon Jun 22, 2015 9:43 am
by Deon

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


Breaking out of App

Posted: Tue Jun 23, 2015 10:43 am
by Serhii Kulibaba

Breaking out of App

Posted: Sun Jun 28, 2015 11:51 pm
by Deon

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

Thank you.


Breaking out of App

Posted: Wed Jul 01, 2015 6:52 pm
by Serhii Kulibaba

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


Breaking out of App

Posted: Thu Jul 02, 2015 8:29 am
by Deon

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.


Breaking out of App

Posted: Thu Jul 02, 2015 3:07 pm
by Serhii Kulibaba

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


Breaking out of App

Posted: Sat Jul 04, 2015 4:19 am
by Deon

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.


Breaking out of App

Posted: Tue Jul 07, 2015 1:12 pm
by Deon

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


Breaking out of App

Posted: Tue Jul 07, 2015 4:36 pm
by Evgene Karachevtsev

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.


Breaking out of App

Posted: Tue Jul 07, 2015 5:50 pm
by Evgene Karachevtsev

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...