cordova-plugins

Ionic native device plugin @ionic-native/device returns all nulls

北战南征 提交于 2021-01-28 08:51:51
问题 I need to do a device detection in my Ionic project so I've installed @ionic-native/device plugin per instructions here: https://ionicframework.com/docs/native/device/ However when I wire it in inside of a component, then run ionic serve to preview changes, console.log returns Device object with all values set to null , same happens when I try to use individual property e.g. this.device.model : Here is how I use it inside of a component: import {Device} from "@ionic-native/device"; // ...

How to catch exit app event?

与世无争的帅哥 提交于 2021-01-27 00:35:56
问题 Hy! I need to catch the exit app event in my phonegap application. Actually I want to trigger a looseLife() function if the player tries to cheat and exit the app with minimize and exit from task manager while he already started a new lvl. If he exit it correctly, by pressing the back button it works fine. I tried onunload or onbeforeunload but these functions get called only if I close the app normally, without minimizing it and closing it from task manager. The pause function also doesn't

How to catch exit app event?

无人久伴 提交于 2021-01-27 00:33:58
问题 Hy! I need to catch the exit app event in my phonegap application. Actually I want to trigger a looseLife() function if the player tries to cheat and exit the app with minimize and exit from task manager while he already started a new lvl. If he exit it correctly, by pressing the back button it works fine. I tried onunload or onbeforeunload but these functions get called only if I close the app normally, without minimizing it and closing it from task manager. The pause function also doesn't

Unable to display in app purchase product data in android

我的梦境 提交于 2021-01-07 06:58:05
问题 So far I'm able to receive my product information for an iOS device but not Android. Here is my code in the component module: registerProduct() { this.inAppPurchase.verbosity = this.inAppPurchase.DEBUG; this.inAppPurchase.register({ id: 'android.prod', type: this.inAppPurchase.NON_CONSUMABLE }); this.registerHandlersForPurchase('android.prod'); this.inAppPurchase.refresh(); } registerHandlersForPurchase(productId) { const self = this.inAppPurchase; this.inAppPurchase.when(productId).updated(

I'm unable to get Device token in an ionic app as a result of Cannot read property 'onTokenRefresh' of undefined

泄露秘密 提交于 2021-01-07 02:46:06
问题 I followed two tutorials that suggested installed the following: ionic cordova plugin add cordova-plugin-fcm-with-dependecy-updated npm install @ionic-native/fcm I kept getting errors after installing to a device that said the fcm plugin isn't installed so I viewed https://www.npmjs.com/package/cordova-plugin-fcm-with-dependecy-updated#fcmontokenrefresh site that suggested uninstalling npm uninstall @ionic-native/fcm # Ionic support is included and conflicts with @ionic-native's

I'm unable to get Device token in an ionic app as a result of Cannot read property 'onTokenRefresh' of undefined

徘徊边缘 提交于 2021-01-07 02:45:25
问题 I followed two tutorials that suggested installed the following: ionic cordova plugin add cordova-plugin-fcm-with-dependecy-updated npm install @ionic-native/fcm I kept getting errors after installing to a device that said the fcm plugin isn't installed so I viewed https://www.npmjs.com/package/cordova-plugin-fcm-with-dependecy-updated#fcmontokenrefresh site that suggested uninstalling npm uninstall @ionic-native/fcm # Ionic support is included and conflicts with @ionic-native's

Cordova - download image from URL to the pictures gallery

你。 提交于 2021-01-01 06:33:13
问题 I created a simple cordova android app and I am trying to download an image from an URL to the pictures gallery, but I really can't figure out what is going wrong. I have already searched a lot here in stackoverflow, including the following links: Phonegap - Save image from url into device photo gallery How to save an Image object into a file in Android with Phonegap? I have installed cordova File Transfer plugin and tried to do the example from the official site, but it didn't work too:

Cordova - download image from URL to the pictures gallery

偶尔善良 提交于 2021-01-01 06:31:31
问题 I created a simple cordova android app and I am trying to download an image from an URL to the pictures gallery, but I really can't figure out what is going wrong. I have already searched a lot here in stackoverflow, including the following links: Phonegap - Save image from url into device photo gallery How to save an Image object into a file in Android with Phonegap? I have installed cordova File Transfer plugin and tried to do the example from the official site, but it didn't work too:

input type=“file” does not work in cordova

风格不统一 提交于 2020-12-12 06:25:16
问题 I have a cordova based app and cannot get the file browser to launch on android (SDK-23) with HTML File tag <input type="file" accept=".doc,.docx,.rdf,.txt,.pdf,.odt" onchange="angular.element(this).scope().upload(this)"> Nothing happens when I select the link. Can you please give some suggestion on how to fix this issue Thanks for the help 回答1: <input type="file"> will not work in Cordova. You need to use the File Plugin. 来源: https://stackoverflow.com/questions/39476916/input-type-file-does