-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Description
Hi,
I followed the steps as described here to setup my IONIC project (created from scratch):
https://github.com/angular/angularfire/blob/master/docs/install-and-setup.md
I followed similar approach for authentication.
The authentication works on Web but not on iOS simulator. No error, no other message.
Page:
import { Component } from '@angular/core';
import { UserserviceService } from '../services/userservice.service';
@Component({
selector: 'app-tab2',
templateUrl: 'tab2.page.html',
styleUrls: ['tab2.page.scss']
})
export class Tab2Page {
constructor(private userService: UserserviceService,) {}
ionViewDidEnter() {
this.userService.loginUser({email:"xxxxxx", password:"xxxxxx"})
.then(res => {
console.log("Login success", JSON.stringify(res));
}, err => {
console.log("Login failed", JSON.stringify(err));
})
}
}
Service:
import { Injectable } from '@angular/core';
import { AngularFireAuth } from '@angular/fire/compat/auth';
@Injectable({
providedIn: 'root'
})
export class UserserviceService {
constructor(private afAuth: AngularFireAuth) { }
loginUser(value) {
return new Promise<any>((resolve, reject) => {
this.afAuth.signInWithEmailAndPassword(value.email, value.password)
.then(
res => resolve(res),
err => reject(err))
})
}
}
Any idea what can be the issue?
Thank you.
Metadata
Metadata
Assignees
Labels
No labels