Search Posts

Category: cordova

Cordova app not redirecting to login page

I have an cordova-angular app. When i run it, its not redirecting to login page. I have got all things set up, i guess. Like I installed angular, cli , node and all, i think i will be needing. My index.html code is: <html> <head> <script src=”cordova.js”></script> <!– Required Polyfills –> <script src=”vendor/es6-shim/es6-shim.min.js”></script> <script src=”vendor/systemjs/dist/system-polyfills.js”></script> <script src=”vendor/angular2/bundles/angular2-polyfills.min.js”></script> <script src=”vendor/intl/dist/Intl.min.js”></script> <script src=”vendor/intl/locale-data/jsonp/en.js”></script> <script src=”vendor/systemjs/dist/system.js”></script> <script src=”vendor/rxjs/bundles/Rx.min.js”></script> <script src=”vendor/angular2/bundles/angular2.js”></script> <script src=”vendor/angular2/bundles/router.min.js”></script> <script src=”vendor/angular2/bundles/http.min.js”></script> <script src=”vendor/fastclick/lib/fastclick.js”></script> <script> var […]

Angularjs: ReferenceError: distanceInKmBetweenCoordinates is not defined at Channel.onDeviceReady

This is my second question today. I am using Cordova + angular (1). I am trying to compare two geolocation with the help of distanceInKmBetweenCoordinates function. I am getting this error while running the app. angular.min.js:101 ReferenceError: distanceInKmBetweenCoordinates is not defined at Channel.onDeviceReady Here is the code. document.addEventListener(‘deviceready’, function onDeviceReady() { angular.bootstrap(document, [‘formApp’]); }, false); var formApp = angular.module(‘formApp’, []); // define angular module/app var formApp = angular.module(‘formApp’, []); formApp.controller(‘formProfile1’, function($scope,$http,$location){ function degreesToRadians(degrees) { return […]

Apollo Client substitute for Cordova App

I have setup an Apollo Server at back-end for GraphQL handling in my Express App and to communicate the front-end with it I am attempting to setup an Apollo Client on front-end with my Cordova App with AngularJS. Searching Apollo Client, I couldn’t find any support for AngularJS and Cordova/ Ionic for that matter. If there is anything I have missed searching or there is a substitute for Apollo Client for communication then please guide […]

How to get the current directory in AngularJS?

I’m using Cordova to build my Web and Android application using AngularJS. I want to get the physical path of the current directory in controller file (.js) file. I need this path because I need to send this path to a server API to download a file from server to this path. I come across $location.path but it gives url not the physical path Source: AngularJS

LocalStorage Causing White Screen And Errors With Then Function

I am using localstorage in my Ionic application to set promises, etc. I have done this method exactly in the past with pouchdb but had some issues so moving over to localstorage instead, I am running the following code and getting a white screen along with the following error. I am not sure where I am going wrong, can localstorage accept a .then function? I thought it would of been able but I don’t see […]

Cordova API call works fine in Android and Postman but returns null in iOS

API request in Cordova app works fine in Android device but the same code returns data as null when running in iOS device. If I copy the request from Safari inspector as a cURL and hit it in postman, it works fine. I see that request Content-type is set as application/json, but the response content-type is text/html response also returns another header ‘content-encoding‘ as ‘gzip‘ Can anyone help me fix this please ? Source: AngularJS

angularjs with cordova routing not working

I am trying to use routing in Cordova but is not working. All js files are in www file. Controllers are working. When I try in url to write: http://localhost:8000/info it says error Cannot GET /info I think I write in code everything correctly. In html inside head I have put the: <base href=”/”/> also the name module project and in body: <ng-view></ng-view> <script type=”text/javascript” src=”/js/angular.min.js”></script> <script type=”text/javascript” src=”/js/angular-route.min.js”></script> <script type=”text/javascript” src=”/js/angular-animate.min.js”></script> <script type=”text/javascript” src=”/js/angular-aria.js”></script> […]

$ not working on iOS devices

alertPopup.then (function(res) { if(ionic.Platform.isAndroid()) { $‘android_link_here’, ‘_system’) } else if(ionic.Platform.isIOS()) { $‘ios_link_here’, ‘_system’) } else { $‘other_link_here’, ‘_system’); } }) Hey Guys, I am trying to set up a popup that pops up informing the user when a new version of the application is available. What I want this to do is basically go to the page that i have in the string quotations. For iOS, this doesn’t work and it fails to open up […]

How cann I access/send data to MainActivity from WebView Cordova AngularJS controller?

how can I send data from the angularjs controller to MainActivity in Android Studio. This is MainActivity: package at.restaurantKellner; import android.os.Bundle; import org.apache.cordova.*; public class MainActivity extends CordovaActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // enable Cordova apps to be started in the background Bundle extras = getIntent().getExtras(); if (extras != null && extras.getBoolean(“cdvStartInBackground”, false)) { moveTaskToBack(true); } // Set by <content src=”index.html” /> in config.xml loadUrl(launchUrl); } } This is my Angular […]

Next Page »