Search Posts

Category: cordova

Cordova Camera plugin gives error ‘object’ has no method "getPicture"

I am working on ionic v1 Camera app after setting up everything correctly (as done many times before). after building app and debugging it i got this error. Plugin installed correctly, ng-cordova.min included. $CordovaCamera injected. Here is my Code: $scope.takePhoto = function () { var options = { quality: 100, destinationType: Camera.DestinationType.DATA_URL, sourceType: Camera.PictureSourceType.CAMERA, allowEdit: true, encodingType: Camera.EncodingType.JPEG, targetWidth: 300, targetHeight: 300, popoverOptions: CameraPopoverOptions, saveToPhotoAlbum: true }; $cordovaCamera.getPicture(options).then(function (imageData) { $rootScope.imgURI = “data:image/jpeg;base64,” + imageData; […]

Execute code in background app

I have an application made in cordova and angular. I make some custom url schemes and I make one application to be executed in background and one app in foreground. What I want to achieve: the application in foreground executes code from the background one without the user notices. App1 (Visible) calls deeplink to App2 App2 execute a service and calls deeplink to App1 ( this service calls a library in a cordova plugin gives […]

Launch Navigator Error – After Build Phonegap, IOS Version

I work in some project, the source angularsjs, css with native app and build on phonegap. Plugin instaled: spec=”3.2.2″ source=”npm” Android: Fine, open with google maps. IOS: Open maps default iphone but not directions option. The idea os open with google maps app to on IOS . Details: $rootScope.getDirection = function() { $scope.onSuccess = function(){ alert(“Successfully launched navigator”); } $scope.onError = function(errMsg){ alert(“Error launching navigator: “+errMsg); } launchnavigator.navigate([$scope.requestDetail[0].markers_lat,$scope.requestDetail[0].markers_lng], [$rootScope.latitude,$rootScope.longitude], $scope.onSuccess, $scope.onError); } The idea […]

Unhandled promise rejection & Deprecation warning-Mobile app- Android studio ionic cordova

I’m a complete beginner & started building mobile apps a couple days back. I’m building it on- -Ionic Cordova -on Mac Terminal -& Android Studio with SDK installed. When I write : ionic cordova run android it stops with errors. This is the complete stack: Jays-MacBook-Air:Finder jaydoshi$ ionic cordova run android Running app-scripts build: –platform android –target cordova [09:20:13] build dev started … [09:20:13] clean started … [09:20:13] clean finished in 4 ms [09:20:13] copy […]

Ionic is throwing error after uploading build file to Firebase host

i am trying to upload ionic web app on browser. i used ionic build browser –prod –release the code successfully build. then i deployed app using firebase deploy the app also successfully uploaded. now when i try to login it shows error in browser console ERROR Error: Uncaught (in promise): TypeError: Cannot read property ‘call’ of undefined TypeError: Cannot read property ‘call’ of undefined at __webpack_require__ (main.js:50) at eval (C:/Users/allud/Code/webApp/src_lazy:44) at t.invoke (polyfills.js:3) at Object.onInvoke […]

Sending multipart message with text, images and videos in Cordova from file URI

I am using Cordova and I can take pictures and record video; also, I can access my device gallery and select a picture. In all cases, I can show a preview starting from the file URI. Then, I need to send the selected multimedia files to a server, along with some JSON, in a multipart request, but I cannot get it to work, as I seem not to be sending any file. This is my […]

Ionic tabs switching from one tab to another tab two events need to switch

I’ve Ionic project have 2 tabs. When I switch from Tab1 to Tab2 using $state.go, the Tab2 page is empty, again when I pressed Tab2, Then only I can view Tab2 detail. How to clear existing view in Tab2(Only Tab2 Ionic view clear) and show Tab2 view without again pressing Tab2. My code is Tab2 code in app.js .state(‘tabs.chart’, { url: ‘/chart’, params: {‘chartsymbol’: null}, views: { ‘chart-tab’: { templateUrl: ‘views/chart/chart.html’, controller: ‘ChartController’ } } […]

Image previews do not appear in Facebook when posted from iOS 11 via Branch

We have a cordova based Ionic 1 application. A user is able to share content to various channels to the likes of Facebook, WhatsApp among others. To achieve this, we have Branch io cordova plugin that brings up the share sheet to post to a desired channel. To enable the content preview on Facebook posts, following information is included: var properties = { objectId :, $og_title: obj.title, $og_description: obj.description, $og_image_url: obj.imageUrl, $og_image_width: 600, $og_image_width: […]

problems of substituting localhost by true IP in ionic service.js

I am trying to deploy my ionic v1 application´╝î which requires change baseURL from localhost:3000 to myip:3000. before:(works) angular.module(‘’, [‘ngResource’]) .constant(“baseURL”,”http://localhost:3000/”) .service(‘menuFactory’, [‘$http’, ‘$resource’, ‘baseURL’, function($http, $resource,baseURL) { Before(error): angular.module(‘’, [‘ngResource’]) .constant(“baseURL”,””) .service(‘menuFactory’, [‘$http’, ‘$resource’, ‘baseURL’, function($http, $resource,baseURL) { However, after the change, the post request no longer works, the error I got is WebSocket connection to ‘ws://localhost:35729/livereload’ failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED exports.Connector.Connector.connect @ livereload.js:74 (anonymous) @ livereload.js:55 (anonymous) @ livereload.js:1152 any idea […]

How to upload Cordova Camera image to Spring MVC?

I’m using Cordova camera to take images and save those images to database. In server side i am using spring framework and client side i am using angularjs and ionic. Here my client side code take image $scope.takePicture = function(resp){ console.log(resp); var source; if (resp == “camera”) { source = Camera.PictureSourceType.CAMERA; }else{ source = Camera.PictureSourceType.PHOTOLIBRARY; }; var options = { quality : 75, destinationType : Camera.DestinationType.FILE_URI, sourceType : source, allowEdit : true, encodingType: Camera.EncodingType.JPEG, targetWidth: […]

Next Page »