Skip to content

Commit efc08ae

Browse files
committed
chore: add get access token example in angular demo
1 parent 8f4edc0 commit efc08ae

File tree

5 files changed

+16
-1
lines changed

5 files changed

+16
-1
lines changed

demo-angular/app/pages/home/home.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@
99
<StackLayout class="buttons">
1010
<FacebookLoginButton (logout)="onLogout($event)"></FacebookLoginButton>
1111
<Button text="Log out (custom)" (tap)="logout()"></Button>
12+
<Button text="Get current access token" (tap)="getCurrentAccessToken()"></Button>
1213
</StackLayout>
1314
</StackLayout>

demo-angular/app/pages/home/home.component.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,10 @@ export class HomeComponent {
5252
this.navigationService.go(['login'], "slideRight");
5353
});
5454
}
55+
56+
public getCurrentAccessToken() {
57+
let accessToken = Facebook.getCurrentAccessToken();
58+
59+
alert("Current access token: " + JSON.stringify(accessToken, null, '\t'));
60+
}
5561
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<StackLayout class="login-buttons">
22
<FacebookLoginButton (login)="onLogin($event)"></FacebookLoginButton>
33
<Button text="Continue with Facebook (custom)" (tap)="login()"></Button>
4+
<Button text="Get current access token" (tap)="getCurrentAccessToken()"></Button>
45
</StackLayout>

demo-angular/app/pages/login/login.component.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,10 @@ export class LoginComponent {
3333
}
3434
});
3535
}
36+
37+
public getCurrentAccessToken() {
38+
let accessToken = Facebook.getCurrentAccessToken();
39+
40+
alert("Current access token: " + JSON.stringify(accessToken, null, '\t'));
41+
}
3642
}

demo-angular/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@
5252
"typescript": "~2.4.2",
5353
"webpack": "~3.8.1",
5454
"webpack-bundle-analyzer": "^2.8.2",
55-
"webpack-sources": "~1.0.1"
55+
"webpack-sources": "~1.0.1",
56+
"uglifyjs-webpack-plugin": "~1.1.6"
5657
},
5758
"scripts": {
5859
"ns-bundle": "ns-bundle",

0 commit comments

Comments
 (0)