gpt4 book ai didi

facebook - react-native-fbsdk - 如何获取用户配置文件?

转载 作者:行者123 更新时间:2023-11-30 05:19:59 35 4
gpt4 key购买 nike

onLoginFinished 的结果只是告诉我授予的权限。来自repo ,不清楚如何获取用户配置文件。似乎 react-native-fbsdkcore 应该包装 FBSDKProfile.h 但看不到它在哪里。

 var FBSDKLogin = require('react-native-fbsdklogin');
var {
FBSDKLoginButton,
} = FBSDKLogin;

var Login = React.createClass({
render: function() {
return (
<View>
<FBSDKLoginButton
onLoginFinished={(error, result) => {
if (error) {
alert('Error logging in.');
} else {
if (result.isCanceled) {
alert('Login cancelled.');
} else {
alert('Logged in.');
}
}
}}
onLogoutFinished={() => alert('Logged out.')}
readPermissions={[]}
publishPermissions={['publish_actions']}/>
</View>
);
}
});

最佳答案

发现您可以使用 Graph API 登录用户的个人资料。

// Create a graph request asking for user's profile
var fetchProfileRequest = new FBSDKGraphRequest((error, result) => {
if (error) {
alert('Error making request.');
} else {
// Data from request is in result
}
}, '/me');
// Start the graph request.
fetchProfileRequest.start();

关于facebook - react-native-fbsdk - 如何获取用户配置文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32000570/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com