{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angularfire2/issues/736","repository_url":"https://api.github.com/repos/angular/angularfire2","labels_url":"https://api.github.com/repos/angular/angularfire2/issues/736/labels{/name}","comments_url":"https://api.github.com/repos/angular/angularfire2/issues/736/comments","events_url":"https://api.github.com/repos/angular/angularfire2/issues/736/events","html_url":"https://github.com/angular/angularfire2/issues/736","id":197466773,"number":736,"title":"Angularfire2 Ionic2 facebook auth error","user":{"login":"theunreal","id":6171883,"avatar_url":"https://avatars.githubusercontent.com/u/6171883?v=3","gravatar_id":"","url":"https://api.github.com/users/theunreal","html_url":"https://github.com/theunreal","followers_url":"https://api.github.com/users/theunreal/followers","following_url":"https://api.github.com/users/theunreal/following{/other_user}","gists_url":"https://api.github.com/users/theunreal/gists{/gist_id}","starred_url":"https://api.github.com/users/theunreal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theunreal/subscriptions","organizations_url":"https://api.github.com/users/theunreal/orgs","repos_url":"https://api.github.com/users/theunreal/repos","events_url":"https://api.github.com/users/theunreal/events{/privacy}","received_events_url":"https://api.github.com/users/theunreal/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-12-24T15:07:09Z","updated_at":"2016-12-29T12:33:41Z","closed_at":"2016-12-26T09:26:43Z","body":"### Version info\r\n\r\n<!-- What versions of the following libraries are you using? Note that your issue may already\r\nbe fixed in the latest versions. -->\r\n\r\n**Angular:** 2.2.1\r\n\r\n**Firebase:**3\r\n\r\n**AngularFire:**beta 6\r\n\r\n**Other (e.g. Ionic/Cordova, Node, browser, operating system):** Ionic 2 RC.4 - Cordova Android\r\n\r\n**Steps to set up and reproduce**\r\n\r\n```\r\nsignInWithFacebook(): firebase.Promise<FirebaseAuthState> {\r\n    if (this.platform.is('cordova')) {\r\n      console.log(\"trying to log in using cordova...\");\r\n      Facebook.login(['email', 'public_profile']).then(res => {\r\n        console.log(\"Logged in. result here\");\r\n        const facebookCredential = firebase.auth.FacebookAuthProvider.credential(res.authResponse.accessToken);\r\n        console.log(firebase.auth().signInWithCredential(facebookCredential));\r\n        return firebase.auth().signInWithCredential(facebookCredential);\r\n      });\r\n    } else {\r\n      return this.auth$.login({\r\n        provider: AuthProviders.Facebook,\r\n        method: AuthMethods.Popup\r\n      });\r\n    }\r\n  }\r\n```\r\n\r\n### Debug output\r\n\r\n** Errors in the JavaScript console **\r\n\r\nThe app works great in web browser. In Android, the login doese't work.\r\nI debugged why the login button is not working and I found this errors:\r\n\r\n```\r\nEXCEPTION: Error in ./HomePage class HomePage - inline template:6:0 caused by: Cannot read property 'then' of undefined....\r\n\r\nLogged in. result here\r\n\r\nEXCEPTION: Uncaught (in promise): ReferenceError: firebase is not defined\r\nReferenceError: firebase is not defined\r\n    at file:///android_asset/www/build/main.js:42039:42\r\n    at t.invoke...\r\n```\r\n\r\nI tried to: `console.log(this._auth.signInWithFacebook());` and it returned undefined.\r\n\r\nRegards the second issue (firebase is not defined) I tried to \r\n`import firebase from 'firebase';`\r\nbut Ionic 2 build returned error.\r\n\r\n### Expected behavior\r\n\r\nFacebook login work on Android (Cordova)\r\n\r\n### Actual behavior\r\n\r\nLogin button return errors as described above"},"comment":{"url":"https://api.github.com/repos/angular/angularfire2/issues/comments/269624104","html_url":"https://github.com/angular/angularfire2/issues/736#issuecomment-269624104","issue_url":"https://api.github.com/repos/angular/angularfire2/issues/736","id":269624104,"user":{"login":"lickos","id":2457327,"avatar_url":"https://avatars.githubusercontent.com/u/2457327?v=3","gravatar_id":"","url":"https://api.github.com/users/lickos","html_url":"https://github.com/lickos","followers_url":"https://api.github.com/users/lickos/followers","following_url":"https://api.github.com/users/lickos/following{/other_user}","gists_url":"https://api.github.com/users/lickos/gists{/gist_id}","starred_url":"https://api.github.com/users/lickos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lickos/subscriptions","organizations_url":"https://api.github.com/users/lickos/orgs","repos_url":"https://api.github.com/users/lickos/repos","events_url":"https://api.github.com/users/lickos/events{/privacy}","received_events_url":"https://api.github.com/users/lickos/received_events","type":"User","site_admin":false},"created_at":"2016-12-29T12:33:41Z","updated_at":"2016-12-29T12:33:41Z","body":"I did it. \r\n  return Facebook.login(['email', 'public_profile']).then(res => {....\r\nI got this error:\r\n Type 'Promise<FacebookLoginResponse>' is not assignable to type 'Promise<FirebaseAuthState>'.at line 25 col 14"}}
{"actor":{"display_login":"lickos"}}