File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed
Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 2222 < ion-item >
2323 < ion-input [(ngModel)] ="phone " (keypress) ="onInputKeypress($event) " type ="tel " placeholder ="Your phone number "> </ ion-input >
2424 </ ion-item >
25+
26+ < ion-item >
27+ < ion-buttons >
28+ < button ion-button (click) ="loginFacebook() "> Login with Facebook</ button >
29+ </ ion-buttons >
30+ </ ion-item >
2531</ ion-content >
Original file line number Diff line number Diff line change @@ -50,6 +50,21 @@ export class LoginPage implements AfterContentInit {
5050 alert . present ( ) ;
5151 }
5252
53+ loginFacebook ( ) : void {
54+ const options = {
55+ requestPermissions : [ 'public_profile' , 'user_friends' , 'email' ]
56+ } ;
57+
58+ ( < any > Meteor ) . loginWithFacebook ( options , ( error : Error ) => {
59+ if ( error ) {
60+ this . handleError ( error ) ;
61+ } else {
62+ console . log ( "Logged in with Facebook succesfully." ) ;
63+ console . log ( Meteor . user ( ) ) ;
64+ }
65+ } ) ;
66+ }
67+
5368 handleLogin ( alert : Alert ) : void {
5469 alert . dismiss ( ) . then ( ( ) => {
5570 return this . phoneService . verify ( this . phone ) ;
You can’t perform that action at this time.
0 commit comments