ionic4

Eager load an ionic Toast Controller

耗尽温柔 提交于 2020-01-16 06:09:24
问题 I have this function that listen the internet connection private verifyNetworkConnection() { this.networkService .isNetworkConnected .pipe(distinctUntilChanged()) .subscribe(connected => { if (connected) { // do secret things } else { this.toast.create({ message: 'Sem conexão a internet', showCloseButton: true, duration: 2000, cssClass: ToastClasses.ERROR }).then((res) => res.present()); this.disconnectFromServices(); } }); } And in the else block, i need to show a Toast that says the user

ionic cordova android build error (cordova.cmd build android exited with exit code 1)

佐手、 提交于 2020-01-16 01:48:04
问题 I'm trying to deploy an android build for the app. But below error occurs in the process. May be the issue is in gradle. But "gradle -v" command executes on cmd successfully and views gradle version. But I separately downloaded gradle files and set path variables to use gradle. ANDROID_SDK_ROOT=undefined (recommended setting) ANDROID_HOME=C:\Users\intern\AppData\Local\Android\Sdk\ (DEPRECATED) Subproject Path: CordovaLib Subproject Path: app Exception in thread "main" java.lang

How to save returned value from a server

耗尽温柔 提交于 2020-01-15 09:52:09
问题 I have the following web service that is hosted online and validates wheter or not we can add a new user into our system. router.post('/register', (req, res) => { var user = req.body; var userPromise = new Promise(async (resolve, reject) => { resolve(await findBy("Users", "email", user.email.toLowerCase())); }) .then(function(result){ if (result){ res.status(418).end(JSON.stringify("User already exists.")); return; } var pass; var passPromise = new Promise(async (resolve, reject) => { resolve

How to use Ionic 4 CSS and JS without CDN in a static website?

不问归期 提交于 2020-01-13 03:41:31
问题 How to include Ionic 4's CSS and JS in a static website without using CDN url’s? When we tried to download the JS file to local and refer it as <script type='text/javascript' src="ionic.js"></script> , the page loads “Empty” with an error in Chrome dev console. The same works if we refer it from CDN. Downloaded the js file from https://unpkg.com/@ionic/core@4.0.0/dist/ionic.js <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <!-- <script src="https://unpkg.com/@ionic/core@4.0.0

API calls made in Ionic 4 app not working on Android device

此生再无相见时 提交于 2020-01-11 11:38:16
问题 I am able to run my ionic app on my laptop by using the ionic lab command. The app makes calls to the IMDB api, & displays data retrieved from it. Now, I am trying to run the app on an android device. by using the following command: ionic cordova run android --device . The app appears on my phone, but when I search for IMDB data, no results are appearing. Below is the service I am using to make calls to the API: export class MovieService { url = 'http://www.omdbapi.com/'; apiKey = 'myKey';

Ionic 3/4 How to stop app kill on swiping from recent apps?

限于喜欢 提交于 2020-01-06 07:53:59
问题 I have a project to build an app based on ionic4/ cordova, running in the background all the time. It basically sends data to server every hour when in the background or foreground. But the app gets killed when the app user swipes it right in the recent apps. I have searched a lot and asked help from various people and documentations, but haven't got any clue till now. I am new to Ionic, please suggest some help, how to deal with this problem? thanks in advance :) 回答1: I suppose you are

Ionic 3/4 How to stop app kill on swiping from recent apps?

天大地大妈咪最大 提交于 2020-01-06 07:53:00
问题 I have a project to build an app based on ionic4/ cordova, running in the background all the time. It basically sends data to server every hour when in the background or foreground. But the app gets killed when the app user swipes it right in the recent apps. I have searched a lot and asked help from various people and documentations, but haven't got any clue till now. I am new to Ionic, please suggest some help, how to deal with this problem? thanks in advance :) 回答1: I suppose you are

Ionic4: Bottom sheet

北慕城南 提交于 2020-01-06 07:32:20
问题 I want to display a bottom sheet with text and table. Action Sheet is perfect in design but it does not allow to give HTML content. Is there any way I can use the bottom sheet in Ionic4. Below is a sample design 来源: https://stackoverflow.com/questions/54663521/ionic4-bottom-sheet

In ionic app, I want to display the data stored in firebase firestore to the app

最后都变了- 提交于 2020-01-06 07:06:06
问题 In ionic, I want to display the user's email and location which are stored in firestore, but the user's firestore document id is their email address. How can i get their data and display to them In authentication.ts import { Injectable } from "@angular/core"; import { AngularFirestore } from '@angular/fire/firestore'; import * as firebase from 'firebase/app'; @Injectable() export class AuthenticationService { constructor(private firestore: AngularFirestore){} registerUser(value){ firebase

In ionic app, I want to display the data stored in firebase firestore to the app

丶灬走出姿态 提交于 2020-01-06 07:03:59
问题 In ionic, I want to display the user's email and location which are stored in firestore, but the user's firestore document id is their email address. How can i get their data and display to them In authentication.ts import { Injectable } from "@angular/core"; import { AngularFirestore } from '@angular/fire/firestore'; import * as firebase from 'firebase/app'; @Injectable() export class AuthenticationService { constructor(private firestore: AngularFirestore){} registerUser(value){ firebase