window.open() not working in phonegap build using new cordova and crosswalk plugin? - android-webview

I´m experimenting with the new support for crosswalk webview using Phonegap Build
but run into some problem using window.open()
Info about the new cordova and crosswalk support
http://phonegap.com/blog/2015/06/16/phonegap-updated-on-build/
My config.xml
<preference name='phonegap-version' value='cli-5.1.1' />
<gap:plugin name='org.crosswalk.engine' version='1.3.0' source='pgb' />
<access origin="*" />
I am trying these javascript calls:
var ref = window.open('http://apache.org'); //Loads in the webview
var ref = window.open('http://apache.org', '_blank'); //Loads in the InAppBrowser
Javascript "syntax" from here:
https://wiki.apache.org/cordova/InAppBrowser
Result:
Nothing happens at all..
(It works great when I´m building my project without the new cordova and crosswalk).
When building in Phonegap build with the new cordova/crosswalk:
PhoneGap (iOS / Android / Windows)
cli-5.1.1 (3.8.0 / 4.0.2 / 3.8.1)
When building without:
PhoneGap (iOS / Android / Windows)
3.7.0 / 3.7.0 / 3.7.0
(My test device is an Samsung Galaxy Tab 3 running 4.4.4)

#Mikael,
it appears to be true that people only read what they want to read.
I asked, do you have:
a white-list
the white-list plugin
You said, "yes, I have a white-list". Where is your plugin? Did you read that part?
This is an "official" forum post, not blog, but forum post. Please read.
Notes for upgrading to cli-5.1.1 on PGB
http://community.phonegap.com/nitobi/topics/notes-for-upgrading-to-cli-5-1-1-on-pgb
Best of Luck,
Jesse

Related

Where is the version specified in Ionic app?

I'm using AppVersion.getVersionNumber() to get the version number of my Ionic app. But where does this number come from?
The problem is that when I run the app on a smartphone through devapp, I get a different version number depending on what OS I have…
iOS (on an iPhone 6): 1.0.2
Android (on a Samsung S10): 1.0.4
Searching around for "version" in my source code, I find this in config.xml (in the root):
<widget version="1.0.3" … >
I don't know if this is relevant, but it is the currently delivered version of the app.
I'm using Ionic 4.10.0
AppVersion cordova plugin reads the app details from the native code of the application.
So the version values that you see, are configured in the native IDE's.
Check these files in your respective platform folders..
ios/App/App.xcodeproj/project.pbxproj the key to look for in this MARKETING_VERSION
android/app/build.gradle the key to look for in this versionName

Push plugin - Found item String/google_app_id more than one time

I'm using Ionic2 and I just installed Push plugin into the App, and now its createing a duplicate of #string/google_app_id
Even if i delete one of them, when i run the project, ionic creates another one and I can't compile the app due to this error.
So this is what i get in the strings.xml
<string name="google_app_id">#string/google_app_id</string>
<string name="google_app_id" translatable="false">XXXXXXXXXX</string>
I tried removing the platform and the plugin and add it again to the proyect, but the error keeps showing.
Thank you all!!
You can see here that the firebase plugin does not handle the app id and api key.
In your case you can do this after installing the firebase plugin. Go to plugins folder and open cordova-plugin-firebase\plugin.xml and remove these lines,
<config-file parent="/resources" target="res/values/strings.xml">
<string name="google_app_id">#string/google_app_id</string>
</config-file>
Then add the android platform. Now you can build/run your android app.
This seems to be an issue introduced with version 0.1.24
replaced:
<plugin name="cordova-plugin-firebase" spec="^0.1.24" />
for:
<plugin name="cordova-plugin-firebase" spec="0.1.22" />
removed and readded the platform and is working fine!
No need to touch the plugin code
I used this command bellow:
$ cordova clean android

phonegap 3.0 facebook login

I m using phonegap 3.0 and trying to install the below faceook login plugin:
https://github.com/phonegap/phonegap-facebook-plugin
I have added the following changes in the config.xml file
<gap:plugin name="com.phonegap.plugins.facebookconnect">
<param name="APP_ID" value="[APP_ID]" />
<param name="APP_NAME" value="[APP_NAME]" />
But still when i am trying to install the plugin its giving me the following error:
Error: Variable(s) missing: APP_ID, APP_NAME
Can anyone tell me why this error might be occuring.M i missing adding any changes in some file.
Thanks
It looks like this plugin hasn't been rewritten for phonegap 3.x yet. Here is the issue on the github project where people are discussing it: https://github.com/phonegap/phonegap-facebook-plugin/issues/343
And here is where someone fixed the android part of the code to work with phonegap 3.x: https://github.com/phonegap/phonegap-facebook-plugin/pull/348
Also, here is where someone else was having trouble using it for iOS with phonegap 3.x: Phonegap 3.0.0 - Facebook SDK 3.6 - FB plugin: Facebook connect not found
On the instructions in the plugin readme it says:
6) Replace your appId in the new index.html file. Leave the quotes.
You can look in the examples folder and you'll see something like this:
document.addEventListener('deviceready', function() {
try {
alert('Device is ready! Make sure you set your app_id below this alert.');
FB.init({ appId: "appid", nativeInterface: CDV.FB, useCachedDialogs: false });
document.getElementById('data').innerHTML = "";
} catch (e) {
alert(e);
}
}, false);
Hope this helps
Plugin should be fully CLI compatible now on master branch.
Here is some sample code
cordova create myApp
cd myApp/
cordova platform add ios
cordova -d plugin add /Users/your/path/here/phonegap-facebook-plugin --variable APP_ID="123456789" --variable APP_NAME="myApplication"
Enjoy.
I met this problem too. Here answer https://github.com/phonegap-build/FacebookConnect/issues/21

Error using barcode scanner in iOS PhoneGap

I am working on barcode scanning App. I have download the sample code from GitHub. When I run that project I get an error. Please help me to solve it.
ERROR: Plugin 'NetworkStatus' not found, or is not a CDVPlugin. Check your plugin mapping in Cordova.plist.
2012-11-28 14:12:36.198 BarCodeScannerCDV[942:40b] FAILED pluginJSON = {"className":"NetworkStatus","methodName":"getConnectionInfo","arguments":["NetworkStatus0"]}
Thanks.
I suggest you to used updated phonegap framework (Cordova 2.2.0), because this was a bug in Cordova 1.6.0.
Please see following comment by Shazron Abdullah in Google Phonegap group:
There is a new Cordova.plist because of the unified JS changes. Check
out the "Cordova Upgrade Guide" in your .dmg (Guides subfolder), or:
"Upgrading Cordova 1.5.0 projects to 1.6.0" step 8 of
https://github.com/apache/incubator-cordova-ios/blob/master/guides/Cordova%20Plugin%20Upgrade%20Guide.md#upgrading-older-cordova-plugins-to-16x
The BarcodeScanner plugin for iOS-Phonegap is stable one, please update your phonegap framework to 2.2.0.
In Phonegap 1.6.0 and below, network connection class name is Network Status but for Phonegap 1.6.1 and above, network connection class name is CDVConnection.

Facebook plugin in phonegap has some alerts with cordova 1.8.0

It was working fine with Cordova 1.6.1,but trying with cardova 1.8.0 ,
I get these alerts:
1. Cordova Facebook Connect plugin fail on login!
2. Cordova Facebook Connect plugin fail on auth.status!
What can i do?
I have two phones one with android 2.2.1 and the other with android 2.3.3 and I get the error on the 2.2.1 but not on the 2.3.3 not sure why but maybe you should try installing on another phone. I'm wondering if its timing out as this old HTC is slow.