I'm developing an ios app with PhoneGap 3.4 which connects to facebook
I used this plugin to connect to facebook: https://github.com/phonegap/phonegap-facebook-plugin
everything works in emulators provided by xcode 5.1.
I tested the app on iphone 3gs and the connection to Facebook still works.
tested also with iphone 4s and facebook connection does not work: FB.login is not called.
the same happens on the iphone 5s.
no error in the xcode console and even in the safari console under developer mode.
the plugin is out of date
Make sure set your config.xml correctly
<access origin="https://m.facebook.com" />
<access origin="https://graph.facebook.com" />
<access origin="https://api.facebook.com" />
<access origin="https://*.fbcdn.net" />
<access origin="https://*.akamaihd.net" />
<feature name="org.apache.cordova.facebook.Connect">
<param name="ios-package" value="FacebookConnectPlugin" />
</feature>
OR
Use this command to install your facebook phonegap plugin
cordova plugin add https://github.com/phonegap/phonegap-facebook-plugin.git --variable APP_ID="XXXXXXXXXXXXXX" --variable APP_NAME=“YOUR_APP_NAME
Don't ever use plugman to install cordova plugin.
Related
I'm using base64-to-gallery to save images for android devices in my ionic app.
Previously it was working fine but now after added <preference name="android-targetSdkVersion" value="29" />to config.xml file, under android platform, it's not working.
Please kindly help me with it.
Finally solved the issue. To anyone who is struggling, I will explain as below.
As mentioned in the git, https://github.com/Nexxa/cordova-base64-to-gallery , ionic Cordova base64togallery plugin has been discontinued.
And also when trying to submit the ionic mobile app for Android production, it's saying that the target SDK version should be more than 29.
But as usual, if we add <preference name="android-targetSdkVersion" value="29" /> to the config.xml file under the Android platform, it will not work the base64togallery plugin (not saving images to your device)
So you have to do like below,
In your ionic project, go to build.gradle file (platforms\android\build.gradle) and change defaultTargetSdkVersion and defaultCompileSdkVersion to 29. (as below)
defaultTargetSdkVersion=29
defaultCompileSdkVersion=29
And then go to AndroidManifest.xml file
(platforms\android\app\src\main\AndroidManifest.xml) and add android:requestLegacyExternalStorage="true" to the application tag, as showing below.
<application android:hardwareAccelerated="true" android:icon="#mipmap/ic_launcher" android:label="#string/app_name" android:networkSecurityConfig="#xml/network_security_config" android:requestLegacyExternalStorage="true" android:supportsRtl="true">
Then try to build your app for debug or release versions.
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
I installed the WKWebview plugin from driftyco Github page and my app runs normally in ios 10. However, when I installed the app on iOS 9, the app freezes at the splash screen.
I read about the ATS and in my info.plist, I have this value
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
Here is my access-origin and allow-navigation tag
<access origin="*" />
<allow-navigation href="*" />
What else do I need to do to make WKWebview work? I have WKWebview v1.1.1 and Cordova iOS 4.1.1.
I also noticed an error "DOM Exception 18: An attempt was made to break through the security policy of the user agent."
Another interesting error is
[Error] module cordova-plugin-nativestorage.NativeStorageError already defined
define (cordova.js:79)
Global Code (NativeStorageError.js:1)
[Error] Failed to load resource: unsupported URL (ready, line 0)
Please help!
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
I am developing an app with phonegap 3.0.0. I need to show the confirm dialog so I added the Notification plugin from phonegap CLI with the following command (as described in CLI Documentation):
$ phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs.git
But now I can't build the project. When I try to build it fails with following error:
** BUILD FAILED **
The following build commands failed:
CompileC build/CamTest.build/Debug-iphonesimulator/CamTest.build/Objects-normal/i386/CDVNotification.o CamTest/Plugins/org.apache.cordova.dialogs/CDVNotification.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
When I remove the Notification plugin everything works fine. I've also tried to add the following in my config.xml (CamTest/www/config.xml) to no effect:
<feature name="Notification">
<param name="ios-package" value="CDVNotification" />
</feature>
Please someone tell me how to work with plugins in Phonegap 3.0.0. I am trying it on iphone simulator. Thanks.
We were facing the same problem, but before we added the required lines in config.xml. So, the following two step process also mentioned in this and this link solved the problem.
On the command line
$ cordova plugin add
https://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs.git
In project's config.xml
<feature name="Notification">
<param name="ios-package" value="CDVNotification" />
</feature>