gpt4 book ai didi

ios - React-native 应用程序和 Facebook SDK

转载 作者:可可西里 更新时间:2023-11-01 05:11:45 25 4
gpt4 key购买 nike

我成功地创建了一个本地组件,它成功地将用户登录到 Facebook。因此,在我的 native react 应用程序中,我获得了访问 token 和用户 ID。现在,我想使用 Facebook SDK(例如,Graph API)来访问一些基本信息(个人资料名称、个人资料图片等)并执行基本操作(分享帖子等)

此时我很迷茫:我该怎么做?我可以使用获取 API 吗?我是否需要向我的应用程序添加一些节点插件(我正在寻找这个:https://github.com/Thuzi/facebook-node-sdk)?

最佳答案

您可以使用 fetch API 发出这样的请求,其中查询可以类似于 https://graph.facebook.com/me?access_token=token_you_got

fetch('https://graph.facebook.com/me?access_token=token_you_got')
.then(response => response.json())
.then(json => this._handleResponse(json.response))
.catch(error =>
this.setState({
isLoading: false,
message: 'Something bad happened ' + error
}));

更多信息在这里:http://www.raywenderlich.com/99473/introducing-react-native-building-apps-javascript

关于ios - React-native 应用程序和 Facebook SDK,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30232432/

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