ionic4

How to display base64 image on iPhone in Ionic 4

三世轮回 提交于 2020-04-18 06:12:15
问题 I am using Capacitor Plugins to get the image file (from camera or gallery). PC and Android are working fine, but the code crashes on iPhone. It opens the galery, I grab the image and it crashes when trying to display I checked the permissions and they are all set. Why would it crash only on ios? Is it a problem with the string? Security? HTML: < ion-img role="button" class="image" [src]="selectedImage" *ngIf="selectedImage" > TS CODE: Plugins.Camera.getPhoto({ quality: 100, source:

Render JSON in html from Service [Ionic 4]

♀尐吖头ヾ 提交于 2020-04-17 22:09:41
问题 Thanks to parrycima, I created my first service. results.service.ts constructor(private httpService: HttpClient) { } async checkFunc() { this.apiurl = 'https://my.apiurl.com/'; this.httpService.get(this.apiurl).subscribe(res => { if (res) { this.items = Object.keys(res).map(function(key) { return res[key]; }); } }, (err: HttpErrorResponse) => { console.log (err.message); } ); } app.component.ts export class AppComponent { constructor( public myService: ResultsService, private httpService:

Render JSON in html from Service [Ionic 4]

跟風遠走 提交于 2020-04-17 22:06:58
问题 Thanks to parrycima, I created my first service. results.service.ts constructor(private httpService: HttpClient) { } async checkFunc() { this.apiurl = 'https://my.apiurl.com/'; this.httpService.get(this.apiurl).subscribe(res => { if (res) { this.items = Object.keys(res).map(function(key) { return res[key]; }); } }, (err: HttpErrorResponse) => { console.log (err.message); } ); } app.component.ts export class AppComponent { constructor( public myService: ResultsService, private httpService:

Ionic 4 net::ERR_CONNECTION_REFUSED(http://localhost/)

喜欢而已 提交于 2020-04-14 07:03:38
问题 I'm facing a problem that when I try to create mobile Front-End application based on Ionic 4 but a net:ERR_CONNECTION_REFUSED(http://localhost/) show up when I run it with cordova on android studio emulator. This what i m using Angular CLI: 7.1.4 Node: 8.9.4 OS: win32 x64 Ionic version 4.5.0 My config.xml 回答1: For anyone else losing their mind that might be using Capacitor go into your capacitor.config.json file and remove this: "server": { "url": "http://localhost:8100" } I've had this in my

Get current logged in user info (email or userid) from google fit API

偶尔善良 提交于 2020-03-26 03:58:49
问题 I am integrating google fit APIs for tracking fitness activities and I need to display logged in user email, but I am not able to fetch user info like email or userid from google fit. I have found https://developers.google.com/fit/rest/v1/reference/users/dataSources/get but I need to add userId and dataSourceId in request parameters which I am unable to find. 回答1: You are looking at the wrong place. The data you are looking for is under: People API v1 . Use the following scopes for oAuth:

Angular Auth Guard with Subscribe

谁说胖子不能爱 提交于 2020-03-05 06:05:43
问题 I have an auth guard and need to run an api call to see if they have access. I don't believe it's possible to return data from a subscribe but how else would I do this? I need to get the userid and then call the api and then return either true of false depending on the api call. import { Injectable } from '@angular/core'; import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, Router } from '@angular/router'; import { Observable } from 'rxjs'; import { AuthService } from 'src/app

How to lazy load modals in ionic4

不打扰是莪最后的温柔 提交于 2020-03-05 02:51:07
问题 I need some help with lazy loading of modals in ionic 4. I googled a lot but can't find an exact solution. I have several modals on a page. And I want to lazy load them. Following is the example of two modals on a page In one of my modal, I need AndroidPermissions , so I have to import it in the module file of the page because importing in the module file of the modal is not working. Why this is happening? Can ionic modals not be lazy-loaded? Thank you in advance home.module.ts import {

I can't handle android back button on Ionic 4

北城以北 提交于 2020-03-04 16:48:10
问题 I am new on ionic development.I have tried more and more way by following articles. Finally I have tried on this Handling hardware back button in Ionic3 Vs Ionic4 Please help me @Fabian N. But on device, I can't seem if the back button work regards code... that is the code is not work in my case. :( This is my ionic info. Ionic: Ionic CLI : 5.2.3 (/usr/local/lib/node_modules/ionic) Ionic Framework : @ionic/angular 4.6.2 @angular-devkit/build-angular : 0.13.9 @angular-devkit/schematics : 7.3.9

Keep app working even when phone is locked/sleep - Ionic4

假如想象 提交于 2020-03-04 05:06:33
问题 App is an ionic4 capacitor app which uses few cordova plugins as well. I have a timer feature associated with a bluetooth device that has to keep running even when the phone goes to sleep or in locked mode. Using the cordova-background-mode plugin the app works in the background, but as soon as phone is locked or in sleep the timer stops working. When the screen resumes, the timer continues from where it stopped. I cannot use the platform pause and resume events in my case as just taking the

Keep app working even when phone is locked/sleep - Ionic4

旧巷老猫 提交于 2020-03-04 05:06:12
问题 App is an ionic4 capacitor app which uses few cordova plugins as well. I have a timer feature associated with a bluetooth device that has to keep running even when the phone goes to sleep or in locked mode. Using the cordova-background-mode plugin the app works in the background, but as soon as phone is locked or in sleep the timer stops working. When the screen resumes, the timer continues from where it stopped. I cannot use the platform pause and resume events in my case as just taking the