I have been able to backtrack the issue. Despite installing PhoneGap 3.0.0, I was at first confused why the phoneGap website will ask to include the <script src="cordova.js"></script>
, I took it out and it worked perfectly and I also had to manually install the InAppBrowser plugin into my app dir using the phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser.git
command after creating my app using create MyiPadApp com.example.MyiPadApp myApp
and then all works perfectly.
Next is finding how to close the InAppBrowser from the child website. I have successfully injected a few lines of javascript code to monitor touch and click activities
var IDLE_TIMEOUT = 10;
var _idleSecondsCounter = 0;
document.ontouchstart = function() {
_idleSecondsCounter = 0;
};
document.ontouchmove = function() {
_idleSecondsCounter = 0;
};
window.setInterval(CheckIdleTime, 1000);
function CheckIdleTime() {_idleSecondsCounter++;
var oPanel = document.getElementById('SecondsUntilExpire');
if (oPanel)oPanel.innerHTML = (IDLE_TIMEOUT - _idleSecondsCounter) + '';
if (_idleSecondsCounter >= IDLE_TIMEOUT) {
alert('InAppBrowser will now close!');
//I will need to add the ref.close() but it's not working.
}
}
Alert comes up but .close()
isn't working cos its not returning value to the InAppBrowser Any help please