cordova-plugins

Cordova / Phonegap get phone number of device (Android & iOS)

送分小仙女□ 提交于 2019-11-30 10:23:12
Is it possible to develop a hybrid mobile app using Phonegap / Cordova and access the device phone number for both Android and iOS? Alon Amir iOS: You can retrieve the phone number using the CoreTelephony framework, you will need to add the following Entitlement: com.apple.coretelephony.Identity.get . However apple might reject your app once you upload it to the AppStore. However, if you plan to distribute using the "Enterprise Distribution" plan, you should have no problem at all, see answers by Igor Fedorchuk and Dylan here , and another elaborated answer here . Android: Yes, you could use

Subsequent callbacks from a Cordova iOS plugin don't fire

泄露秘密 提交于 2019-11-30 09:14:48
I have troubles with firing immediately subsequent callbacks from a cordova plugin (an iOS one). In XCode debugger I clearly see it steps over [self.commandDelegate sendPluginResult:pluginResult callbackId:monitoredRegions.callbackId]; several times (in immediate succession), each time with a slightly different pluginResult . That gets triggered by [locationManager requestStateForRegion:region]; which I don't (and can't) control. The problem is, on the Javascript side, the callback gets fired only once. What's (actually not so) strange is that if I introduce some blocking in that callback,

How to configure Cordova-android 4.0 with white-list

青春壹個敷衍的年華 提交于 2019-11-30 08:25:14
Finally get Android stuido to work with the cordova-android 4.0 but i read that we must install the whitelist plugin but i dont know how to configure this plugin to work with cordova-android 4.0. i got error messasges as below 04-13 16:30:31.291 856-856/com.vs.VSMF W/Web Console﹕ No Content- Security-Policy meta tag found. Please add one when using the cordova-plugin-whitelist plugin. at file:///android_asset/www/plugins/cordova-plugin-whitelist/whitelist.js:25 04-13 16:30:41.290 856-856/com.vs.VSMF D/SystemWebChromeClient﹕ file:///android_asset/www/plugins/cordova-plugin-whitelist/whitelist

Plugin with UIViewController

浪子不回头ぞ 提交于 2019-11-30 07:07:37
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. If you want to present the whole UIViewController (full screen) over the cordova webview, you can do [self.viewController presentViewController:yourViewController

How to get your context in your phonegap plugin

青春壹個敷衍的年華 提交于 2019-11-30 06:04:47
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. method.DoLogic(context,imageByte); } catch (IOException e) { // TODO Auto-generated catch block e

Upgrade Cordova Version of an iOS app

若如初见. 提交于 2019-11-30 06:04:02
问题 How can I transfer a Cordova iOS app from one PC to other? The app is made in some other version of Cordova and I want to upgrade its Cordova version. 回答1: You can follow the steps below: In new PC, install the latest version of cordova using npm install -g cordova command In new PC, create a new cordova project using cordova create PROJECT_NAME command in desired location using terminal Now navigate to the newly create project folder, copy the contents of WWW folder and config.xml file from

Ionic: Check Internet Connection using Cordova

╄→尐↘猪︶ㄣ 提交于 2019-11-30 03:59:07
I am working on Ionic Framework, and facing issues using the Apache Cordova Network API to detect internet connection in Android App. I have referred this tutorial and also created a demo project, which works fine. I have followed the below steps. [from the tutorial] ionic start testApp sidemenu ionic platform add android Open testApp/www/js/app.js Copy paste this code if(window.Connection) { if(navigator.connection.type == Connection.NONE) { alert('There is no internet connection available'); }else{ alert(navigator.connection.type); } }else{ alert('Cannot find Window.Connection'); } Install

Cordova: Modifying *-Info.plist from plugin.xml

女生的网名这么多〃 提交于 2019-11-30 03:16:55
问题 I'm building a plugin to use star printers from an iOS device, with their SDK and everything is working fine except that config-file command to modify the info.plist file is not working properly. Inside my plugin.xml I have: <config-file target="*-Info.plist" parent="Supported external accessory protocols"> <array> <key>item 0</key> <string>jp.star-m.starpro</string> </array> </config-file> With that I should get a Supported external accessory protocols array with 1 item called item 0 , type

How to set up Cordova plugin project with IDE support?

坚强是说给别人听的谎言 提交于 2019-11-29 22:12:38
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, thus I don't have code completion. It's basically impossible to write Java/Objective-C without IDE

Manage cordova plugins with npm + package.json

左心房为你撑大大i 提交于 2019-11-29 21:13:44
We have an Angular + Ionic + Cordova project with multiple devs that we'd like to manage cordova plugin dependencies for. We are using Cordova CLI 5+ , and when manually running the install commands (e.g. cordova plugin add cordova-plugin-camera ), a new line gets added to the cordovaPlugins section of the package.json file. Here's what the finished product looks like: "cordovaPlugins": [ "cordova-plugin-camera", "cordova-plugin-console", "cordova-plugin-contacts", "cordova-plugin-device", "cordova-plugin-dialogs", "cordova-plugin-file", "cordova-plugin-geolocation", "cordova-plugin-media",