Hello Ionic!
This bug is driving me crazy!
If the keyboard is open connections are interrupted/not opened, and this error message pops up:
A network error (such as timeout, interrupted connection or unreachable host) has occurred.
I am testing this on a samsung galaxy S3 (4.3). Crosswalk and Whitelist are installed.
In config.xml everything is allowed:
<access origin="*"/>
<allow-navigation href="*"/>
<allow-intent href="*"/>`
My login.html:
<ion-content padding>
<ion-list>
<ion-item>
<ion-label floating>Email</ion-label>
<ion-input type="email" [(ngModel)]="email" name="email" required></ion-input>
</ion-item>
<ion-item>
<ion-label floating>Contraseña</ion-label>
<ion-input type="password" [(ngModel)]="password" name="password" required></ion-input>
</ion-item>
<ion-item>
<button ion-button type="button" block (click)="loginUser()">Iniciar sesión</button>
</ion-item>
</ion-list>
</ion-content>
My login.ts:
import { Component, NgZone } from '@angular/core';
import { NavController, NavParams, LoadingController } from 'ionic-angular';
import { TabsPage } from '../tabs/tabs';
import { AngularFire } from 'angularfire2';
@Component({
selector: 'page-login',
templateUrl: 'login.html'
})
export class LoginPage {
email: any;
password: any;
loading: any;
constructor(public navCtrl: NavController,
public navParams: NavParams,
public af: AngularFire,
public zone: NgZone,
public loadingCtrl: LoadingController) {}
loginUser(){
this.presentLoadingDefault();
this.af.auth.login({
email: this.email,
password: this.password
}).then((response) => {
this.loading.dismiss();
this.zone.run(() => {
this.navCtrl.setRoot(TabsPage);
});
}).catch((error) => {
this.loading.dismiss();
alert(error);
});
}
presentLoadingDefault() {
this.loading = this.loadingCtrl.create({
content: 'Procesando...'
});
this.loading.present();
}
}
Can someone tell me what is going on?
Thanks you in advance!