ionic-native

Ionic native push registration format changed?

和自甴很熟 提交于 2020-01-25 07:00:05
问题 I am not sure why but it seems that the interface for push registration changed? My app follows the logic from https://ionicframework.com/docs/v3/native/push/ with pushObject.on('registration').subscribe((registration: any) => console.log('Device registered', registration)); where registration used to be of below type export interface PushDevice{ registrationId: string; registrationType: string; } but now I am getting {"registrationId":"{length=32,bytes=0x459ca46ab66f4fe790220809215176d6..

Ionic 3 - network-information plugin - Object(…) is not a function(…)

萝らか妹 提交于 2020-01-11 10:46:19
问题 I need to implement network information plugin in an ionic 3 angular 4 project. I have installed a network plugin using $ ionic cordova plugin add cordova-plugin-network-information $ npm install --save @ionic-native/network@5.0.0 After installation, I have used this plugin in app.component.ts but I'm getting an error as ERROR Error: Uncaught (in promise): TypeError: Object(...) is not a function(…) on either device or emulator. I'm sharing native-core and plugin versions that I have used in

Ionic cordova-plugin-qrscanner has no camera preview

◇◆丶佛笑我妖孽 提交于 2020-01-01 09:37:09
问题 I run a simple demo to use cordova-plugin-qrscanner, it can scan qrcode but no camera preview. qrscannerDemo on Github Related code blow: import { Component } from '@angular/core'; import { NavController } from 'ionic-angular'; import { AndroidPermissions } from '@ionic-native/android-permissions'; import { QRScanner, QRScannerStatus } from '@ionic-native/qr-scanner'; @Component({ selector: 'page-home', templateUrl: 'home.html' }) export class HomePage { constructor(public navCtrl:

How can I install my ionic app on my android phone?

一个人想着一个人 提交于 2019-12-24 18:35:39
问题 I'm trying to install my ionic app on my android phone. I tried install my ionic app on my android phone The app ran on my phone, but when I ran the same command to run a different app, the app was replaced on my mobile. How can I keep both? I don't intend to modify any of these apps, they are ready. I tried these commands as well: ionic cordova build android --prod --release and ionic cordova run android --prod --release I got this error message: [ERROR] An error occurred while running

ionic2 ionic native and cordova-plugin-gyroscope error

烈酒焚心 提交于 2019-12-24 10:16:27
问题 i have an ionic2 apps and i want to use Gyroscope with ionic native and cordova-plugin-gyroscope like this tutoriel : https://ionicframework.com/docs/native/gyroscope/ but i have this error ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'watch' of undefined TypeError: Cannot read property 'watch' of undefined at Observable._subscribe ... import { Component } from '@angular/core'; import { NavController } from 'ionic-angular'; import { Gyroscope, GyroscopeOrientation,

Mocking Ionic Native Support in Browser

蓝咒 提交于 2019-12-24 06:06:41
问题 Trying to mock Ionic Native Network in browser. To do so, I added the class in my app.module.ts as follows: ... import { Network } from '@ionic-native/network'; ... ... export class NetworkMock extends Network{ type = 'none'; } @NgModule({ .... providers: [ ... ... { provide: ErrorHandler, useClass: IonicErrorHandler }, {provide: Network, useClass: NetworkMock} With the above, when I call the following function in a component: check_network() { console.log(this.net.type); } I get null in the

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); });

Deeplinks gives empty path

南笙酒味 提交于 2019-12-23 21:17:15
问题 I have a problem of implementing DeepLinks. I can open the app from the URL like myapp://myapp.com/route. But it doesn’t handle path of it. It just opens the program. I open it with : this.deeplinks.route({ '/route': RoutePage }).subscribe(match => { // match.$route - the route we matched, which is the matched entry from the arguments to route() // match.$args - the args passed in the link // match.$link - the full link data console.log('Successfully matched route', match); }, nomatch => { //

Displaying a FILE_URI image taken by Native Camera in Ionic 3

∥☆過路亽.° 提交于 2019-12-23 18:31:05
问题 How do you display a FILE_URI image taken by the user using @ionic-native/camera in Ionic 3? I can use Ionic Native's Camera to get a FILE_URI image URL, with a result like this: file:///var/mobile/Containers/Data/Application/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX/tmp/cdv_photo_005.jpg However, When I try to display this image back to the user by referring to the URI in my view template, the image never loads. Things I've tried: -Using the image URI directly in the view <img src="{{profile.image}

IONIC 3 and jsPDF , using FILE Transfer to download pdf not working

一个人想着一个人 提交于 2019-12-23 04:56:23
问题 i want to use jsPDF library with IONIC3 to download PDF , i have created a simple document and when i try to download it with the default function from jsPDF doc.Save() it work in my browser , but in a real device won't work. So i decided to use FileTransfer Plugins from IONIC native , i have firstly created a blob File from jsPDF output , then i tried to use the writeFile() function from IONIC FILE plugin to create a new file from the blob , then i tried to download that file using Download(