cordova-plugins

how to access THIS in cordova plugin with IONIC

微笑、不失礼 提交于 2020-01-22 02:48:05
问题 i am trying to implement the apple-sign-in method using a cordova plugin and set the credentials to firebase. what i actually have is: constructor ( public afAuth: AngularFireAuth, public afs: AngularFirestore, @Inject(FirebaseApp) firebase: any ){ this.firebase = firebase; } loginApple(): Promise<boolean> { return new Promise((resolve, reject) => { cordova.plugins.SignInWithApple.signin({ requestedScopes: [0, 1] }, function(succ){ var provider = new firebase.auth.OAuthProvider('apple.com')

How to get audio files on my phone using Ionic 2 Cordova plugins?

谁说胖子不能爱 提交于 2020-01-22 02:13:43
问题 I have tried the Ionic mediaPlugin import { MediaPlugin } from 'ionic-native'; var file = new MediaPlugin('path/to/file.mp3'); I'm still confused on how to do that. All I want to do is to create something like a media player, that gets all the audio on a users android phone, and to play and pause it too. 回答1: Check this tutorial first it will guide you. However check this too, it will tell you where you have to store your data. If you do it on android, you should use externalDataDirectory .

I need help modifying the InAppBrowser in native code

点点圈 提交于 2020-01-17 13:47:05
问题 this is a different question but is still regarding my original problem: Is there an elegant way to access the camera from the inappbrowser under iOS? tl;dr: I want to open the cordova camera plugin on top of the inappbrowser plugin(view hierarchy problem) After my first approach (old question) did not lead me anywhere, I tried to modify the inappbrowser (gitlink). I wanted it to be a subview of the cordova view, which the following code managed to accomplish: __weak CDVInAppBrowser* weakSelf

ionic 2 SQLite manage callback with Promise

白昼怎懂夜的黑 提交于 2020-01-17 05:53:33
问题 I want to get the callback of a successful SQLite transaction with Ionic 2. I am still currently learning the HTML5 Promise, and it is still a bit confuse. And since I've heavily used jQuery Deferred before, I try to adapt what I used to do with jQuery. Before Ionic 2, I used the following jQuery pattern to execute my async SQL: var SqlResult = function(sqlToExecute,bracketValues){ this.sqlToExecute = sqlToExecute; this.bracketValues =bracketValues; }; SqlResult.prototype

Unable to open a PDF file locally using a custom Cordova Apache plugin

萝らか妹 提交于 2020-01-17 05:07:51
问题 I tried to create a Cordova plugin to open a PDF file in a hybrid application following some examples. I'm facing this error while running the app on Android simulator. logcat: [2015-10-25 20:43:10 - CordTestProjectCordTestAndroid] Conversion to Dalvik format failed with error 1 [2015-10-25 20:58:56 - CordTestProjectCordTestAndroid] Dx Uncaught translation error: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: GC overhead limit exceeded [2015-10-25 20:58:56 -

Cordova camera plugin not launching camera

人盡茶涼 提交于 2020-01-17 04:11:45
问题 I've created an Ionic app and I need the camera functionality so that a user can take a picture and send it to a webservice. I've followed the following guide by Ionic. Basically you just cd into your applicatoin cd myApp then you run cordova plugin add org.apache.cordova.camera and once the plugin has been installed, you can invoke it's functionality where ever in your app (because according to Cordova, navigator.camera is a global object). In my case I'm just doing it in one of my

Cordova camera plugin not launching camera

杀马特。学长 韩版系。学妹 提交于 2020-01-17 04:11:14
问题 I've created an Ionic app and I need the camera functionality so that a user can take a picture and send it to a webservice. I've followed the following guide by Ionic. Basically you just cd into your applicatoin cd myApp then you run cordova plugin add org.apache.cordova.camera and once the plugin has been installed, you can invoke it's functionality where ever in your app (because according to Cordova, navigator.camera is a global object). In my case I'm just doing it in one of my

Impossible to pick video from gallery/library - phonegap/cordova

笑着哭i 提交于 2020-01-17 01:39:07
问题 I am using windows phone, cordova/phonegap. How is possible to pick a video from gallery as it was a picture? The official plugin seems to work for picture only. Here is the code: function getVideo() { var options = { quality: 80 }; options["sourceType"] = 0 | 2; options["mediaType"] = 1; navigator.camera.getPicture(onVideoSuccess, onFail, options); } var onVideoSuccess = function (fileuri) { console.log("fileuri " + fileuri); } var onFail = function (err) { console.log("onFail"); } This way

Issue with SMS cordova 3.5 plugin for android?

☆樱花仙子☆ 提交于 2020-01-16 18:48:11
问题 I have installed the SMS plugin via CLI, and the installation was done properly. Then I wrote JavaScript code as follows: function sendsms() { alert("click"); var number = $("#numberTxt").val(); var message = $("#messageTxt").val(); var intent = ""; //leave empty for sending sms using default intent var success = function() { alert('Message sent successfully'); }; var error = function(e) { alert('Message Failed:' + e); }; sms.send(number, message, intent, success, error); } HTML code: <input

How to get Google Advertisement ID in Ionic3?

≡放荡痞女 提交于 2020-01-16 05:33:25
问题 Hi we tried to get Advertisement ID using ionic3 application.We added plugin cordova plugin add cordova-plugin-idfa --save We tried like this ONE: cordova.plugins.idfa.getInfo().then(function(info) { if (!info.limitAdTracking) { console.log('OK getting ID**********'+info.idfa || info.aaid); } }); we are getting get Cannot read property 'getInfo' of undefined TWO: declare var androidIDFA; @Component({ templateUrl: 'app.html', }) export class MyApp { googleAddId:any; if (this.platform.is(