Ionic2 + AngularFire2 + Facebook Auth

Hi Guys!,

I have started an Ionic 2 project with Angularfire 2 following this tutorial:

The login is working, but after login I want to get the user email, display name, profile image url and access token.

I don’t know how to do it and the events property is private:

import { Component, OnInit } from '@angular/core';
import { AngularFire, FirebaseListObservable } from 'angularfire2';
import { Routes, Router, ROUTER_DIRECTIVES, ROUTER_PROVIDERS} from '@angular/router';

import { AboutComponent } from './+about';
import { HelpComponent } from './help';

  selector: 'example-app',
  templateUrl: 'example.component.html',
  styleUrls: ['example.component.css'],
  directives: [ROUTER_DIRECTIVES],
  providers: [ROUTER_PROVIDERS ]
  {path: '/about', component: AboutComponent},
  {path: '/help', component: HelpComponent}
export class ExampleAppComponent implements OnInit {

  title = 'It works!';

  constructor(private af: AngularFire, private router: Router) { => {

      // Get user email, etc. How?


  login() {;

Any help?

OK, I’ve found it:


Thank you!!

I followed the article you posted but it does not have anything related to the login, to my question, should I install Cordova Facebook plugin? or I can use Firebase auth simply without any cordova plugins?

No, you don’t need the plugin.

Please, check this:
(Advanced: Handle the sign-in flow manually)

Good luck!

@Corin you are incorrect… you need a plugin or a javascript library to handle the facebook login to get the access_token for this to work with Ionic2


here is an example:

1 Like