aretherecookies-mobile/js/apis/FacebookAuth.js
2018-12-01 11:04:53 -06:00

49 lines
1.1 KiB
JavaScript

// //@flow
// //$FlowFixMe
// import { FBLoginManager } from 'react-native-facebook-login';
// export type FacebookProfile = {
// email: string,
// first_name: string,
// last_name: string,
// name: string,
// picture: {
// data: {
// height: number,
// is_silhouette: boolean,
// url: string,
// width: number,
// },
// },
// };
// export type FacebookCredentials = {
// token: string,
// tokenExpirationDate: string,
// userId: string,
// };
// export type FacebookAuthResponse = {
// credentials: FacebookCredentials,
// declinedPermissions: Array<any>,
// eventName: string,
// profile: string,
// provider: string,
// type: string,
// };
// export type FacebookAuth = {
// credentials: FacebookCredentials,
// profile: FacebookProfile,
// };
// export const authFacebook = async (): Promise<FacebookAuth> => {
// return new Promise((resolve, reject) => {
// FBLoginManager.loginWithPermissions(['email'], (error: string, data: FacebookAuthResponse) => {
// return error
// ? reject(error)
// : resolve({ credentials: data.credentials, profile: JSON.parse(data.profile) });
// });
// });
// };