Apache Cordova InAppBrowser shows keyboard and hides it immediatly - android

I've got an Cordova PhoneGap application, that is loading the Google Authorisation page. If I click on an input field, the keyboard shows up for about 300ms and then closes instantly. What have I done wrong? I open the InAppBrowser in the following way:
this.popup = window.open( c_encode(self.providerURLs[provider]), "_blank",
"EnableViewPortScale=yes,location=yes" );
Best Regards
Daniel Gruber

Do you use the executeScript functionality of the inappbrowser plugin? Maybe even an interval?
This would close the keyboard on older devices, see this bug:
https://issues.apache.org/jira/browse/CB-5449

Related

Trouble getting ng-device-back-button directive to work for OnsenUI v2

I'm attempting to stop a user from abandoning a game by accidentally clicking the device back button on Android devices. I'm using Cordova 6.3.1 and the Onsen UI v2 framework.
By using an Onsen page's ng-device-back-button attribute, I have been able to completely disable the back button, but I would prefer to ask a user if they wanted to leave with a confirm. At this point, I would be happy if I could just write to the console that the user has clicked the device back button, but it seems like nothing is happening other than the ng-device-back-button attribute preventing the default.
<ons-page ng-device-back-button="onBackKeyDown">
...
</ons-page>
$scope.onBackKeyDown = function(e) {
console.log("device back button pressed");
}
With the above code, I'm able to prevent Onsen from the standard popPage() reaction, but nothing is being written to the console.
Any thoughts on what I'm doing incorrectly? Thanks in advance.
try
ng-device-back-button="onBackKeyDown()"
instead of
ng-device-back-button="onBackKeyDown"
Ultimately, I was able to get this to work by getting the latest version of Onsen UI. Who would have thought using an outdated version could cause problems? ;)

Can't copy authorization code when doing oauth for installed apps in phonegap webview

I'm doing the oauth procedure for installed apps, during which I send the user to a screen to copy the authorization code. This happens in a webview (it's a phonegap app).
When I reach the screen with the code I can select the code, but the context menu for copying it doesn't show! I can copy other stuff on the page, but not the code inside the input textarea. BTW the textarea is readonly but I don't think this should matter.
Is this a bug?
EDIT:
Same thing happens in regular chrome browser on android, but I found a way to copy there: long press and then quickly zoom in brings up the context menu.
Seems to be a bug in chrome for android
https://code.google.com/p/chromium/issues/detail?id=251235

Android browser $(window).scroll not working

I have a mobile website using jQuery and it $(window).scroll evenet. This works perfectly in Chrome and Safari Mobile, but Android native browser is showing me the middle finger.
I have this simple code:
$(window).scroll(function() {
alert("Scrolled");
}
But this alert never appears. I've done alerts in other parts of code, so alert are enabled and I extensively use jQuery so it's also loaded.
I am not sure what's going on here, am I missing something or is this a bug?
It's a bug or limitation in the Android browser, the built-in browser in Android is a lightweight version browser, so some features are not compatible
Simply use:
$("html:not(:animated),body:not(:animated)").animate({ scrollTop: 0 }, 400);
this will scroll you page to the top.
you can set "scrollTop: " value to set it to any specific TOP position.
dont forget to vote up.
:)
thanks

Phonegap 2.6 android inappbrowser opens on self despite _blank being passed

I am using PhoneGap 2.6.0 with Sencha Touch 2.2 on Android 4.0.3. I am calling the InAppBrowser to open a share url to facebook like so:
window.open(encodeURI('https://www.facebook.com/sharer/sharer.php?u=http://www.mycoolapp.com/&t=Everyone check this out'), '_blank', 'location=no');
However, instead of opening the InAppBrowser with the UI, it opens on top of my app screen without any 'OK' button like on iOS or any way to close and go back.
I am able to go back with the standard Android OS back button.
Is there any way to get the url bar and the OK button to show on the Android InAppBrowser for PhoneGap?
As per window.open section in docs, you have to give `location=yes' to show location bar. Regarding type of window, do you see any difference when you pass '_self' and '_blank'?
Maybe a problem with your Access-origin in res/xml/config.xml (PhoneGap 2.6.0 Domain Whitelist Guide)...?
As others stated, for android you have to specify location=yes and no you can't get riddle of the location bar and mantain back button.
But if you are on Android why do you have to keep it?
Being able to coming back with physical back button is the preferred behaviour by design in Android.

Phonegap (android) - Enable URL TextView in InAppBrowser

How do I enable the URL field in the InAppBrowser in Phonegap 2.5.0 running on Android? Currently when I tap the field to type a URL, nothing happens (although in Eclipse it is reporting "TextView does not support text selection. Action mode cancelled.").
Yeah, that is by design. The location in that text field is not editable. If you want that type of functionality you may want to go back to using the ChildBrowser or edit the InAppBrowser code yourself.

Categories

Resources