// //@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, // eventName: string, // profile: string, // provider: string, // type: string, // }; // export type FacebookAuth = { // credentials: FacebookCredentials, // profile: FacebookProfile, // }; // export const authFacebook = async (): Promise => { // 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) }); // }); // }); // };