cordova-plugins

Cordova local notification doesn't work while app is in background

Deadly 提交于 2019-12-01 07:41:20
问题 I'm developing an android application using Cordova and it uses PushPlugin to receive push notifications from my server. In particular, I'm doing some test using the PushPlugin Example. I'm also using the Cordova Local Notification plugin because I want the app shows a local notification as soon as it receives a push notification. The following code works and the local notification appears but only when the app is in the foreground. I want the local notification appear even when the app is in

cordova-plugin-fcm - FCMPlugin is not defined

蹲街弑〆低调 提交于 2019-12-01 06:33:48
问题 I am using Ionic 2, and am trying to get Push Notifications working. I have registered my app with Firebase, and can push notifications to it successfully. I now need to set up, so that I can push notifications from my app. So I decided to use the following Cordova Plugin (cordova-plugin-fcm). Question 1 When I follow it's instructions, by doing the following in my Ionic app: app.ts declare var FCMPlugin; ... initializeApp() { this.platform.ready().then(() => { ... FCMPlugin.getToken(

cordova-plugin-media callback methods

旧街凉风 提交于 2019-12-01 06:28:24
I am using cordova-media-plugin 1.0.1. in an Ionic mobile app. I am using the plugin to play the audio file. I am able to get it to play using: var media = $cordovaMedia.newMedia(fileToPlay, // success callback mediaSuccess, // error callback mediaFailure, // status callback mediaStatus ); I can then call media.play() at it plays the file. However, the callbacks never seem to execute. I have them defined as: function mediaSuccess () { console.log("Successfully finished task."); } function mediaFailure (err) { console.log("An error occurred: " + err.code); } function mediaStatus (status) {

How to loop a audio in phonegap?

ぃ、小莉子 提交于 2019-12-01 04:20:25
I'm using phonegap 2.2.0. I tried some code to loop the audio for playing without interruption but it is not working on my android device . It plays only once. Here is my code: function playAudio(url) { var my_media = new Media(url, function() { console.log("playAudio():Audio Success"); }, function(err) { console.log("playAudio():Audio Error: "+err); }, function(status) { console.log("playAudio():Audio Status: "+status); } }); // Play audio my_media.play({numberOfLoops:99}); } Can you tell me what is wrong here? Looping is not supported for Android yet in Phonegap - so numberOfLoops does

Cordova Geolocation plugin returning empty position object on Android

拥有回忆 提交于 2019-12-01 01:31:19
问题 I've had quite some issues with the Geolocation Cordova plugin (org.apache.cordova.geolocation). It works fine on iOS, but it doesn't at all on Android. As I understand, the plugin used to include native Android code, but this was removed at some point, because it was too buggy/slow and the native web HTML5 implementation was much more stable and fast. If I use the latest plugin version (0.3.2) which still has the native code, it does work (but slow and indeed, not always). But when it does

Unable to set image source when accessing image from gallery-Android

只谈情不闲聊 提交于 2019-12-01 00:44:31
Iam using cordova 3.4. When i capture an image and set it,its working fine but when I try to access on image from gallery I get the url content://com.android.providers.media.documents/document/image%4A463 and I get image load error in my image tag.I know this is a know bug going around and I have refered stack questions such as Unable to load image when selected from the gallery on Android 4.4 (KitKat) using PhoneGap Camera Plugin I cannot use the rough work around mentioned where URI is set manually like content://media/external/images/media/ because we focus devices with internal built in

cordova/phonegap plugin add VS config.xml

柔情痞子 提交于 2019-12-01 00:06:03
There's something I find quite confusing about phonegap/cordova plugins. For example I can run cordova plugin add cordova-plugin-whitelist OR phonegap plugin add cordova-plugin-whitelist Doing so does not modify the config.xml file Or I can add to config.xml: <plugin name="cordova-plugin-whitelist" spec="1.1.0" /> OR <gap:plugin name="cordova-plugin-whitelist" spec="1.1.0" /> What are exactly the differences between all these different plugin installations? Which one should I use in the end? I want the same plugins to be available on all the other developers computers, in the exact same

Google Maps on Ionic Framework/Cordova not working on android build

*爱你&永不变心* 提交于 2019-11-30 21:34:37
I have been writing code for an app to track user location and display it using Google Maps. My code works perfectly in browsers (Safari,Firefox,Chrome) but doesn't work at all on mobile (android). The google maps api doesn't work and the navigation is unreliable. I'm a ionic newbie and wrote a fairly simple app to test it out. It has got ionic side menu template with some simple AngularJS controller. angular.module('starter.controllers', []) .controller('AppCtrl', function($scope, $ionicModal, $timeout) { // With the new view caching in Ionic, Controllers are only called // when they are

Uploading video to firebase (3.0) storage using cordovaFileTransfer

a 夏天 提交于 2019-11-30 20:33:32
问题 Am creating a hybrid app using Ionic, (ng)Cordova and Firebase storage. Previously, pairing Cordova media capture (e.g. for capturing a video) and cordova file transfer (for uploading it somewhere) worked something like this question states. I'm struggling to work out how to achieve the same thing with the new Firebase Storage upload process, which doesn't use a server address: var uploadTask = storageRef.child('videos/' + file.name).put(file); I get the feeling that I now need to add another

Cordova: Modifying *-Info.plist from plugin.xml

☆樱花仙子☆ 提交于 2019-11-30 19:40:31
I'm building a plugin to use star printers from an iOS device, with their SDK and everything is working fine except that config-file command to modify the info.plist file is not working properly. Inside my plugin.xml I have: <config-file target="*-Info.plist" parent="Supported external accessory protocols"> <array> <key>item 0</key> <string>jp.star-m.starpro</string> </array> </config-file> With that I should get a Supported external accessory protocols array with 1 item called item 0 , type String and value jp.star-m.starpro but instead I'm getting an array with two items as if I would have