Итак, я внедрил встроенную кнопку FBSDKGraphRequest и login. Войти работает правильно, но при попытке запроса график пользователя, вместо полного объекта я ожидать, что/я оконечным вернутьFBSDKGraphRequest in React Родной возвращающийся неполный объект
{ "id": "162036280799349", "birthday": "08/08/1980", "email": "test_ppjeffg_eight\u0040tfbnw.net", "first_name": "Test", "gender": "male", "last_name": "Eight", "link": "https://www.facebook.com/app_scoped_user_id/162036280799349/", "locale": "en_US", "name": "Test Eight", "timezone": -8, "updated_time": "2015-07-28T18:22:16+0000", "verified": false }
Я просто
Object {name: "Test Eight", id: "162036280799349"}
Я очень хорошо делаю запрос неправильно, хотя я сделал все в соответствии с документацией. Вот соответствующий исходный код:
class LoadingOverlay extends BaseComponent{
constructor(props){
super(props);
this._bind(/*'_fetchFriendsRequestFunction'*/);
this.state = {isVisible: true,
token: null,
profileInfo: null}
}
_fetchGraphRequestFunction(){
console.log("start");
var fetchProfileRequest = new FBSDKGraphRequest((error, result) => {
if (error) {
alert('Error making request.');
} else {
// Data from request is in result
console.log(result);
}
}, '/me');
// Start the graph request.
fetchProfileRequest.start();
}
render(){
return(
<Overlay isVisible={this.state.isVisible}>
<BlurView style={styles.background} blurType="dark">
<FBSDKLoginButton
onLoginFinished={(error,result)=>{
if (error){
alert('Error Logging In.');
} else {
if (result.isCanceled){
alert('Login Cancelled.');
} else {
FBSDKAccessToken.getCurrentAccessToken((token)=>{
console.log(token.tokenString);
this._fetchGraphRequestFunction();
})
}
}
}}
onLogoutFinished={()=>console.log('Logged Out.')}
readPermissions={['public_profile', 'email', 'user_birthday', 'user_friends']}
publishPermissions={['publish_actions']}/>
</BlurView>
</Overlay>
);
}
}`