cordova-plugins

Cannot read a file using cordova file plugin in an Ionic 2 project

我们两清 提交于 2019-11-29 08:58:26
I'm trying to use the Cordova file plugin to read an image saved in a mobile device so I can then get the base64 encoding of it, which I need to store remotely. The problem is that the resolveLocalFilesystemUrl() method, which is supposed to provide a File Entry object, instead seems to be returning an Entry object, which means I can't call file on it. Here is the code that should be getting the File Entry object so I can use the file method to read the file itself. MediaCapture.captureImage().then((images)=>{ self.image = images[0].localURL; File.resolveLocalFilesystemUrl(self.image).then(

Plugin with UIViewController

送分小仙女□ 提交于 2019-11-29 08:41:32
问题 Can somebody explain to me the life-cycle of a Cordova iOS plugin? Particularly, I have a plugin I am trying to develop which contains a UIView (and associated UIViewController ). How do I obtain the Cordova UIView from my extended CDVPlugin class, so I can add my plugin as a sub-view to it (is this how it works?). I would like to temporarily show my UIView on top of my Cordova app, then dismiss it, returning to my JS/HTML app. 回答1: If you want to present the whole UIViewController (full

How to get your context in your phonegap plugin

只谈情不闲聊 提交于 2019-11-29 04:38:44
问题 This is my plugin for android and one of my method requires a context, Is there a way how can I get this context? public class GaziruPlugin extends CordovaPlugin{ @Override public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException { String value = args.getString(0); BASE64Decoder decoder = new BASE64Decoder(); try { byte[] imageByte = decoder.decodeBuffer(value); Classlogic method = new Classlogic(); //this method requires a context type.

Running Ionic 3 app on iPhone throws error: 2 duplicate symbols for architecture arm64

我的未来我决定 提交于 2019-11-29 01:17:39
I am opening .xcworkspace of my Ionic 3 project and trying to run it on my device but I suddenly get the following error in Xcode: Ld /Users/manuel/Library/Developer/Xcode/DerivedData/MyApp-awaxbzztsgokklgptpuoufwcwmkt/Build/Products/Debug-iphoneos/MyApp.app/MyApp normal arm64 cd /Users/manuel/Documents/MyApp/dev/copernic4-ion2/galilei/platforms/ios export IPHONEOS_DEPLOYMENT_TARGET=9.0 export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"

How to set up Cordova plugin project with IDE support?

 ̄綄美尐妖づ 提交于 2019-11-28 18:31:36
问题 I've been struggling to set up my cordova plugin project. Mainly due the facts that: Plugins need to be in a separate folder away from the main project When I use, for example, cordova build android to build the project, cordova copies the java file from my plugin folder and put it into platforms/android/src folder. Thus I should not modify my plugin's .java file in the Android project manually, I have to write my code in my plugin folder. But I can't import plugin folder into the IDE project

Start android activity from cordova plugin

北战南征 提交于 2019-11-28 17:40:54
I know this may is a duplicate question, i have tried all answers from stack, but non has a complete answer. Most answers just give how to start an activity but no hints how to configure activity in Android Manifest file and where to save activity layout and manifest file. Can anyone please give a complete code structure to start an activity from cordova plugin. Ijas Ahamed N Here is the complete steps to start an activity from a cordova plugin 1. Install Plugman to create plugin npm install -g plugman 2. Create cordova plugin using plugman plugman create --name PluginName --plugin_id com

Update cordova plugins in one command

荒凉一梦 提交于 2019-11-28 15:14:17
I am wondering is there an easier way to update cordova plugin? I googled, found a hook (@ year 2013), but this is not 100% what I want. I know I can do this by two steps: rm, then add but I am looking for a better (official) way to help me which plugins have newer version? and I can update ALL of them in one command. (just like: npm update) for example: $ cordova plugin list /* list all installed plugins, their dependencies, and newer versions */ $ cordova plugin update /* update all of them for me */ if there is no official way, is there some other helper? yo? I got tired of manually

Error: more than one library with package name 'com.google.android.gms' using cordova plugin admob along with google plus for android

丶灬走出姿态 提交于 2019-11-28 13:12:41
When using google+ cordova plugin https://github.com/EddyVerbruggen/cordova-plugin-googleplus along with admob plugin https://github.com/appfeel/admob-google-cordova Encounter this error in Cordova CLI: Error: more than one library with package name 'com.google.android.gms' You can temporarily disable this error with android.enforceUniquePackageName=false Looks like one of the plugin is using deprecated references to google play services. While executing gradle build google play services is referenced to same app twice and gradle build fails. As an alternative I tried skipping gradle build to

HTTP.post to FCM Server not working

南笙酒味 提交于 2019-11-28 12:51:49
问题 I am using Ionic 2 with HTTP native module to make a post request to FCM server for push notifications. The code I am using is: HTTP.post( "https://fcm.googleapis.com/fcm/send", { "notification": { "title": "Notification title", "body": "Notification body", "sound": "default", "click_action": "FCM_PLUGIN_ACTIVITY", "icon": "fcm_push_icon" }, "data": { "hello": "This is a Firebase Cloud Messagin hbhj g Device Gr new v Message!", }, "to": "device token", }, { Authorization: { key:

Setting NSLocationWhenInUseUsageDescription value when using cordova-plugin-geolocation

一世执手 提交于 2019-11-28 07:59:29
问题 I'm building a mobile app using Cordova. I use cordova-plugin-geolocation to get the user's current location. To customize the location permission request on iOS it's needed to set the NSLocationWhenInUseUsageDescription plist value. Generally, to set an iOS plist option it's needed to manually set the option value in the platforms/ios/<app-name>/<app-name>-Info.plist . The problem is that on each build the cordova-plugin-geolocation overwrites the custom value with it's default empty string.