ngcordova

TypeError: Object [object Object] has no method 'getFile' - Ionic

半城伤御伤魂 提交于 2019-12-10 12:26:44
问题 I have the below code to get json data and store it in a storage space in the device,I have tried the below code, ionic.Platform.ready(function() { $cordovaFile.createFile(cordova.file.applicationStorageDirectory, 'file.txt', true) $ionicLoading.show(); $http.post("http://example.com/data/get_data"). success(function(data) { //console.log(data); $ionicLoading.hide(); $cordovaFile.writeFile(cordova.file.applicationStorageDirectory + 'file.txt', data, { 'append': false }).then(function(result)

ionic not rendering google maps on first load

泄露秘密 提交于 2019-12-10 12:15:10
问题 I have an app that is a welcome/sign in screen and after you sign it you are taken to a tab screen with four tabs in it, the first tab of which shows a google map. Upon first sign in the page does not display it's self but upon refresh of the page the map show's up gracefully as it was expected to do the first time. This happens EVERY time but I only get one javascript error. error Uncaught Error: can't load XRegExp twice in the same frame(anonymous function) @ xregexp-min.js:2 code function

Uploading to Google Drive - how to use a base64-encoded image or an image path

左心房为你撑大大i 提交于 2019-12-10 11:57:42
问题 Fairly new to Javascript and still running into this problem after trying a lot of things: I'm using http://ngcordova.com/docs/plugins/camera/ to capture an image on the phone and can retrieve as either a base64-encoded image or as a path to the image location (file://storage/emulated/...jpg). Next I'm using this to upload files to google drive: https://github.com/googledrive/cors-upload-sample I've successfully uploaded a text file with the given example: * @example * var content = new Blob(

How to use ngcordova facebook and push notification plugins in single ionic app

别等时光非礼了梦想. 提交于 2019-12-10 11:41:09
问题 when i am using ngCordova facebook and pushNotification plugins in same app and build the app then find the following error. ======================================================================== UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexException: Multiple dex files define Landroid/support/annotation/AnimRes; at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596) at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554) at com.android.dx.merge.DexMerger

SQLite plugin for Cordova: Code running backwards

拈花ヽ惹草 提交于 2019-12-08 13:56:31
I'm new using Cordova and Mobile development in general, but I have a really strange behavior in my code. I'm using the SQLite plugin with ngCordova (I'm using Ionic) and what I want to do is very simple: If a table exist, then drop it or create if it doesn't exists. I've created a service for the database operations (I don't know if is the best way to do it, but it keeps that kind of logic separated from controllers). The logic is this: app.js angular.module('starter', ['ionic', 'ngCordova', 'starter.controllers', 'starter.services']) .run(function($ionicPlatform, $ionicLoading, $timeout,

Refreshing the battery status with AngularJS/Ionic

删除回忆录丶 提交于 2019-12-08 12:43:51
问题 My Ionic app displays the battery level in a HTML element <progress></progress> . My problem is that the status of the battery will not be updated , if I change the pages or open a new page. In the case is the status always zero. When I launch the app on the start page of the app looks the status like this (Now is fully charged): when I change the pages so (the current status is not called): My question is, how can I update/refresh the status of the battery on every pages? The other question

Delete cacheDirectory cache cordova file system ionic

南笙酒味 提交于 2019-12-08 10:17:42
问题 There is a mobile app in which i want to delete the cached images downloaded by a particular user after log out.Suppose user1 logged in and download few images and user2 logged in and downloaded few images.User2 should not see downloaded images of any other user. downloadFile : function(downloadLink, downloadFileName, downloadFileMimeType) { $ionicLoading.show({ template: '<ion-spinner></ion-spinner>' }); var accessToken = $window.localStorage.getItem(SYSTEM.AUTH_TOKEN); var options = {

SQLite plugin for Cordova: Code running backwards

孤街浪徒 提交于 2019-12-08 06:33:14
问题 I'm new using Cordova and Mobile development in general, but I have a really strange behavior in my code. I'm using the SQLite plugin with ngCordova (I'm using Ionic) and what I want to do is very simple: If a table exist, then drop it or create if it doesn't exists. I've created a service for the database operations (I don't know if is the best way to do it, but it keeps that kind of logic separated from controllers). The logic is this: app.js angular.module('starter', ['ionic', 'ngCordova',

cordova.js causes reference error 'require is not defined'

大憨熊 提交于 2019-12-07 18:23:22
问题 I'm wish to use ngCordova to detect the network state of a device. However, as soon as I include cordova.js I get an error - Uncaught ReferenceError: require is not defined (cordova.js:23) I've installed and am successfully running Node.js and Cordova , and I've downloaded and installed ngCordova following the instructions here. I have also installed the network-information plugin via the Cordova CLI - cordova plugin add cordova-plugin-network-information As per the documentation this is the

ngCordova插件之InAppBrowser插件的使用

∥☆過路亽.° 提交于 2019-12-07 12:43:56
之前详细的写了关于ngCordova安装,配置和使用的wiki,这一次我们来细说其中的插件具体使用方法——InAppBrowser插件 InAppBrowser插件是在APP打开浏览器的页面的一个插件,当我们在APP中需要跳转到一个特定的浏览器网页时,用这个插件会很方便。 下面开始讲解InAppBrowser的具体使用: ngCordova的安装配置在"ngCordova插件使用详解"中已经详细的叙述了。 传送门:http://hpm.hand-china.com/w/newleonchan/ngcordova/ 这篇wiki我们直接讨论如何使用: 1.打开浏览器的页面 $cordovaInAppBrowser.open(URL, target, options) open()中的URL参数为浏览器跳转的地址。 target的参数有三种:_self,_blank,_system,_self是如果URL地址在WhiteList中,则用Cordova的Webview将其打开;如果是_blank则直接在APP中将其打开;如果是_system则是用手机默认浏览器将新页面打开。 options参数包含以下信息: location:设置为yes或no来打开或关闭插件的locationbar hidden:设置为yes则加载出页面但不显示;设置为no则正常加载页面 zoom