cordova-plugins

Open Camera or Gallery from “ inappbrowser ” in Apache Cordova

不打扰是莪最后的温柔 提交于 2019-12-06 03:19:40
问题 I have a hybrid application developed using Apache Cordova, within that application I am using " inappbrowser ". Now the requirement is to open Camera or Gallery from the inappbrowser, I am not able to figure out how to achieve this. For developing this application I am using backbone.js, JQuery, bootstrap.js. Here is the code snippet of Backbone's View : var mainScreenView = Backbone.View.extend({ el: $('.panel'), templateMainScreen: _.template($('#templateOne').html()), events: { "click

How to download a file using Cordova File Transfer plugin in iOS

China☆狼群 提交于 2019-12-06 01:47:23
I have used the following code to download file: $scope.onDownloadMusic = function( live ) { var downloadUrl = offlineUrl + fileName; var hostUrl = encodeURI(live.url); var fileTransfer = new FileTransfer(); fileTransfer.download( hostUrl, downloadUrl, function(entry) { alert('Your download has completed.'); }, function(error) { alert(error.source); }, false, { headers: { "Authorization": "Basic dGVzdHVzZXJuYW1lOnRlc3RwYXNzd29yZA==" } } ); }; It works fine on Android. However, when I tried the same code on iOS, I always got an error. I didn't know what went wrong. Any help is really

InAppBrowser (Apache cordova plugin) does not open in Windows 8.1

别说谁变了你拦得住时间么 提交于 2019-12-05 23:03:50
I am developing an app using visual studio tools for apache Cordova (Cordova CLI : 4.3.1) and AngularJS. It uses InAppBrowser plugin via ngcordova library. Here is my code: var url = "http://myurl.com"; var target = "_blank"; var options = { location: 'no', toolbar:'no', hidden: 'no' }; document.addEventListener('deviceready', function () { var browserRef = $cordovaInAppBrowser.open(url, target, options).then(function (event) { }, function (error) { console.log("Error: " + error.message); }); }, false); When i deploy the app on windows 8.1 (on my local machine), i can see on debugger that a

$cordovaFile.checkDir says folder does not exist but $cordovaFile.createDir says folder already exists

南楼画角 提交于 2019-12-05 22:44:04
I am trying to work with the ngCordova File plugin as documented here: http://ngcordova.com/docs/plugins/file/ , but am getting strange behaviour. I am trying to create a folder if it does not already exist. I am testing for its existence using: $cordovaFile.checkDir(cordova.file.dataDirectory, 'inbound') Now this returns NOT_FOUND_ERR so i try to create the folder subsequently by calling: $cordovaFile.createDir(cordova.file.dataDirectory, 'inbound', false); But this then returns PATH_EXISTS_ERR Why would checkDir tell me it does not exist, but then createDir tell me it DOES exist? NOTE: This

Taking panorama image using the Cordova plugin?

江枫思渺然 提交于 2019-12-05 21:27:09
Is possible to take panorama image using the some cordova plugin (in X and Y axiss) ? Thanks for any advice. The camera plugin starts the device's camera app, so I guess that on a phone with a camera app that does panorama you can take panorama from a cordova app (the user would have to select the function manually). Otherwise you would have to either build a plugin in native code to start a different app that does panorama or build a plugin with it's own camera view and you would have to code yourself the panorama function or try to use the HTML5 api that allow access to the camera to do the

How can I draw a line between two google map native markers? (Ionic 3, cordova)

不问归期 提交于 2019-12-05 20:48:15
How can I draw a line between two google maps native markers? In my project, I need one dynamic marker and one fixed marker. addMarker() { this.map.addMarker({ title: 'My Marker', icon: 'blue', animation: 'DROP', position: { lat: this.place.lat, lng: this.place.lng } }) .then(marker => { marker.on(GoogleMapsEvent.MARKER_CLICK).subscribe(() => { alert('Marker Clicked'); }); }); } 2nd marker: addMarker2() { this.map.addMarker({ title: 'My Marker', icon: 'blue', animation: 'DROP', position: { lat: -33, lng: 773231 } }) .then(marker => { marker.on(GoogleMapsEvent.MARKER_CLICK).subscribe(() => {

cordova-plugin-file in Chrome: cordova is not defined

对着背影说爱祢 提交于 2019-12-05 19:35:26
问题 I use cordova-plugin-file in my ionic app to download images and save to local. When I run it in emulator or iphone, there is no error, but when I test it in Chrome, it says, cordova is not defined when I try to access cordova.file.dataDirectory How can I run cordova-plugin-file in chrome? 回答1: Cordova will not be available in the browser; only on your device. In your index.html you should have this script reference: <!-- cordova script (this will be a 404 during development) --> <script src=

Google Maps Native cordova plugin with Ionic 3 only showing a grey box

假如想象 提交于 2019-12-05 18:57:08
I'm trying to get a map showing and alls I get is a grey box with the google logo at the bottom of it. I've looked at the other posts on this website, and tried them all and none of them seem to fix it. I'm using ionic 3.12.0 with cordova plugin googlemaps 2.0.7 I've made sure the API key is correct and enabled in the dashboard. I've tried using the tutorials https://ionicframework.com/docs/native/google-maps/ below is the code import { GoogleMaps, GoogleMap, GoogleMapsEvent, GoogleMapOptions, CameraPosition, MarkerOptions, Marker } from '@ionic-native/google-maps'; import { Component, Input,

How to create a separate directory for cordova app and storing data in it?

半世苍凉 提交于 2019-12-05 14:17:09
I want to create a specific directory for my cordova project. I have no idea what to do for that. I refered so may links like, How to move file to app directory cordova cordova, android app how to create subfolder and someother links. But it is not clear whether they are using any cordova plugins for this or we can do with pure javascript. These are not working for me. Please suggest if any plugins or functions are available. Thanks. You need to use this plugin: https://www.npmjs.com/package/cordova-plugin-file I don't know what version of cordova do you use and if this plugin was updated, but

IONIC Android Apk File size Way Too Big ! how to decrease the size of app for android?

早过忘川 提交于 2019-12-05 14:15:25
I have developed the app using ionic 3 and now while generating android apk file it 's size getting way too big. before the API integration The File Size Was 4.8MB once I Started API Interation I just Modified 10 Pages Then The APK File Size became 71 MB Cordova Plugins I have Used cordova-plugin-console cordova-plugin-datepicker cordova-plugin-device cordova-plugin-network-information cordova-plugin-splashscreen cordova-plugin-statusbar cordova-plugin-whitelist cordova-plugin-x-socialsharing cordova-sqlite-storage es6-promise-plugin ionic-plugin-keyboard I unziped the APK file to know what's