ngcordova

Timeout about geolocation always reached when position mode is set to “Device only”

不问归期 提交于 2019-12-14 04:16:36
问题 I own a Ionic application (Cordova). I have this JS code aiming to get the position of the Android's device: $cordovaGeolocation.getCurrentPosition({ enableHighAccuracy: true, timeout: 15000 }) $cordovaGeolocation comes from ng-cordova lib. I successfully checked that the plugin org.apache.cordova.geolocation is updated with the last current version. Some users complain about more 15 seconds for the first query! Note that the timeout is set to 15000 ms => 15 seconds. Meaning that the device

Ionic - Upload file to FTP server

僤鯓⒐⒋嵵緔 提交于 2019-12-13 23:31:05
问题 I am working on an Ionic application and I need to upload a file to a FTP server. Please note that I am new to mobile dev in general and Ionic in particular. The target is iOs. I found a lot of information regarding this cordova plugin but I am still unable to push my file to my FTP server. And I am wondering if it is even possible with Ionic... Do you guys have a solution for this? Do you think it is possible? Here is my code: .controller("CsvCtrl", function($scope, $cordovaFileTransfer,

Cloudinary - Upload preset must be in whitelist for unsigned uploads

允我心安 提交于 2019-12-13 19:27:17
问题 I want to upload image, to Cloudinary, taken directly from camera in Ionic using cordova camera plugin. I am getting an error of code 1, having message "upload preset must be in whitelist for unsigned uploads." How to solve this error.Please help. my edited js code is: $scope.cameraopen = function(){ var options = { quality : 100, destinationType : Camera.DestinationType.FILE_URI,//FILE_URI sourceType : Camera.PictureSourceType.CAMERA, allowEdit : false, encodingType: Camera.EncodingType.JPEG

Cordova build android only displays paths and does not build the project itself

我是研究僧i 提交于 2019-12-12 17:15:29
问题 I am trying to build a Cordova app with few plugins (InAppBrowser, Barcode Scanner, File Transfer, Text-to-Speech, Document Viewer, GeoLocation). When I run cordova build android it only shows the ANDROID_HOME and JAVA_HOME paths but does not build the Android Studio project. I am using Cordova version 8.0.0 and Android cordova-android@~7.0.0 Building in the verbose mode gives the following messages 来源: https://stackoverflow.com/questions/48075005/cordova-build-android-only-displays-paths-and

Cordova geolocation still works after geolocation plugin is removed

痴心易碎 提交于 2019-12-12 06:54:06
问题 On Android, Cordova's geolocation plugin consistently takes about 6s to fix a location when other apps return a location instantly most of the time and almost never take more than 2s. I came across this post Phonegap geolocation sometimes not working on android and removed the geolocation plugin while following the instructions: cordova plugin rm cordova-plugin-geolocation To verify that the plugin was removed I ran the app again using ionic run android expecting the following call to fail

PushNotification is undefined (ng-cordova)

試著忘記壹切 提交于 2019-12-12 04:24:50
问题 In my ionic application when running the application in browser i get following error ng-cordova.js:6378 Uncaught ReferenceError: PushNotification is not defined in my console, as well as when i build the application for android and run in my phone it doesnot work there as well i.e there is no popup for registration Id : alert(data.registrationId); . app.run(function($ionicPlatform, $cordovaPushV5) { $ionicPlatform.ready(function() { // For Push Notification var options = { android: {

ngCordova capture not working on device

巧了我就是萌 提交于 2019-12-11 08:35:09
问题 I'm am attempting to record audio using Ionic and ngCordova. Here is my code: $scope.captureAudio = function() { var options = { limit: 3, duration: 10 }; $cordovaCapture.captureAudio(options).then(function(audioData) { // Success! Audio data is here alert(audioData); console.log(audioData); }, function(err) { // An error occurred. Show a message to the user alert(err); }); }; When I run this in the emulator it works fine and brings up the voice recorder and when the recording is done it logs

www/index.html would like to use your current location - Ionic Framework

不羁岁月 提交于 2019-12-11 03:58:40
问题 I searched various forums and posts related to GeoLocation based alert issue; For some reason no technique worked in my case. Added "cordova-plugin-geolocation" plugin to my Ionic Framework Project. Added to my base Controller under $ionicPlatform.ready(...) navigator.geolocation.getCurrentPosition(function(position) { var coords = {}; coords.updated = new Date(); coords.latitude = position.coords.latitude.toFixed(6); coords.longitude = position.coords.longitude.toFixed(6); coords.altitude =

Add extra params to $cordovaFileTransfer.upload

可紊 提交于 2019-12-11 03:46:58
问题 I am using $cordovaFileTransfer.upload() to upload a picture from a device to my server. In documentation it says that it excepts these params: server, filePath, options . I need to pass in some extra custom params: like user_id , for example. Does anyone know if it's possible to do? Thank you. 回答1: You can send those custom parameters in the options object, doing something like this: var options = {}; options.headers = { Connection: "close" } options.chunkedMode = false; options.userName =

Cannot open files with FileOpener2, but not getting an error in Android

人盡茶涼 提交于 2019-12-11 03:25:48
问题 I am attempting to open a PDF file with FileOpener2 (through ng-cordova) with the following code: $cordovaFile.checkFile(cordova.file.dataDirectory, attachmentPath) .then((fileEntry) => { // success fileEntry.getMetadata((metadata) => { // metadata.size is in bytes var megabyteSize = metadata.size / 1048576; if (megabyteSize > 5) { var path = cordova.file.dataDirectory + attachmentPath; console.log(path); // prints: file:///data/data/com.ionicframework.enhatch146189/files/attachments/CS-353ES