Can i still use my own jsscript even if I use InAppBrowser plugin?

32 views
Skip to first unread message

StefDelDestino

unread,
Jul 27, 2016, 11:34:13 AM7/27/16
to phonegap
Hi,

We are making an app. We load pages from our responsive website. However I'd like to test the network informationvia the network plugin. If there is connection, no prob. If there is not or phones lose internet connection, i'd like to launch a " custom no connection webpage".

However if I do 
window.open(urlOfRedirection, '_self ', 'location=no');
My script oaded from index.html of Cordova is not in action anymore.

Should I use an Iframe or am I missing something?

Thanks,

Stéphane.

Kerri Shotts

unread,
Jul 28, 2016, 11:54:48 AM7/28/16
to phonegap
My guess is that you're wrapping a web site. Don't do that, because you'll have the problem you're trying to solve: what if the user has no (or a bad) network connection?

Keep your UI code local and let it load your data via XHR. At that point you can determine how to handle the case of a non-existant or bad network connection gracefully (including using cached data, displaying a friendly error message, retrying a few times, etc.)

If you want to update outside of the app store review process, that's fine, but you can do so using code pushes. Microsoft has one that seems to be really good: http://microsoft.github.io/code-push/



On Wednesday, July 27, 2016 at 10:34:13 AM UTC-5, StefDelDestino wrote:
...

jcesarmobile

unread,
Jul 29, 2016, 2:48:28 PM7/29/16
to phonegap
And if you don'tfollow Kerri's advice (you should),if you want to use cordova plugin APIs when you are loading an external website, you have to upload the cordova.js and some other files to your server, and each OS need a different cordova.js

James Henderson

unread,
Nov 9, 2016, 9:25:24 AM11/9/16
to phon...@googlegroups.com
@ jcesarmobile, yes, I achieved this before (by putting various cordova js files on the server), but I am having trouble, please can someone help with a working example?

On 29 July 2016 at 19:48, jcesarmobile <jcesar...@gmail.com> wrote:
And if you don'tfollow Kerri's advice (you should),if you want to use cordova plugin APIs when you are loading an external website, you have to upload the cordova.js and some other files to your server, and each OS need a different cordova.js

--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en

For more info on PhoneGap or to download the code go to www.phonegap.com
---
You received this message because you are subscribed to the Google Groups "phonegap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phonegap+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages