Merge pull request #32045 from fluidsonic/facebook-js-sdk-3.2

[facebook-js-sdk] Updated types to SDK version 3.2 & fixed FB.login()
This commit is contained in:
Daniel Rosenwasser
2019-01-17 15:49:47 -08:00
committed by GitHub
2 changed files with 12 additions and 4 deletions
@@ -22,6 +22,14 @@ FB.getLoginStatus(function(response: fb.StatusResponse) {
const authResponse: fb.AuthResponse = FB.getAuthResponse();
console.log(authResponse.accessToken);
FB.login();
FB.login(function(response: fb.StatusResponse) {
console.log(response);
console.log(response.status);
console.log(response.authResponse.accessToken);
});
FB.login(function(response: fb.StatusResponse) {
console.log(response);
console.log(response.status);
+4 -4
View File
@@ -1,4 +1,4 @@
// Type definitions for the Facebook Javascript SDK 3.1
// Type definitions for the Facebook Javascript SDK 3.2
// Project: https://developers.facebook.com/docs/javascript
// Definitions by: Amrit Kahlon <https://github.com/amritk>
// Mahmoud Zohdi <https://github.com/mahmoudzohdi>
@@ -50,7 +50,7 @@ declare namespace facebook {
* @param callback function to handle the response.
* @param options optional ILoginOption to add params such as scope.
*/
login(callback: (response: StatusResponse) => void, options: LoginOptions): void;
login(callback: (response: StatusResponse) => void, options?: LoginOptions): void;
/**
* Use this function to log the user in
@@ -61,12 +61,12 @@ declare namespace facebook {
*
* @param options optional ILoginOption to add params such as scope.
*/
login(options: LoginOptions): void;
login(options?: LoginOptions): void;
/**
* The method FB.logout() logs the user out of your site and, in some cases, Facebook.
*
* @param callback function to handle the response
* @param callback optional function to handle the response
*/
logout(callback?: (response: StatusResponse) => void): void;