ionic-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"; // ...

Getting count of contacts correct but getting null values for contacts in Ionic 4

戏子无情 提交于 2020-02-23 08:07:25
问题 I am using ionic contacts plugin it is giving me the correct number of contacts in the phone but all the details field are null, I am using, “cordova-plugin-contacts”: “3.0.1”, “@ionic-native/contacts”: “^5.0.0” import { Contacts } from '@ionic-native/contacts/ngx'; constructor( private contactsPlugin: Contacts ) { } document.addEventListener("deviceready", () => { this.contactsPlugin.find(["displayName", "phoneNumbers","photos"], {multiple: true, hasPhoneNumber: true}) .then((contacts) => {

Ionic App crash after Open native camera - Error 20

久未见 提交于 2019-12-24 01:17:00
问题 I'm using the cordova camera plugin on ionic 4 to capture some image. takePicture() { console.log(' camera takePicture '); const options: CameraOptions = { quality: 100, destinationType: this.camera.DestinationType.DATA_URL, encodingType: this.camera.EncodingType.JPEG, mediaType: this.camera.MediaType.PICTURE } this.camera.getPicture(options).then((imageData) => { this.selectedImage = 'data:image/jpeg;base64,' + imageData; }, (err) => { // Handle error console.log('Camera issue:' + err); });

How to fix problem due to providing '@ionic-native/AppVersion' or '…/ngx' and having exception when calling any methods of AppVersion?

非 Y 不嫁゛ 提交于 2019-12-11 02:28:23
问题 I've added the AppVersion Ionic native plugin (https://ionicframework.com/docs/native/app-version#usage). After try to provide it into my app.module.ts i've an error at compilation like "No provider exists for AppVersion" ... I thinking that maybe from Ionic 4/recent version of AppVersion, i need to follow this instructions : https://ionicframework.com/docs/native/#Add_Plugins_to_Your_App_Module which say to provide the plugin into the app.module.ts with a import like this : import AppVersion