javascript - [未处理的承诺拒绝:TypeError:未定义不是对象(评估'NativeGraphRequestManager.start')]
问题描述
试图在我的应用程序中实现 FBSDK 和 UBER SDK,但它似乎不起作用。我的封面图片不断加载,事件无法通过。
这是我的尝试!这是我的 package.json 文件。
"react": "^16.4.1",
"react-native": "^0.55.4",
"react-native-calendar-events": "^1.6.1",
"react-native-easy-grid": "^0.1.17",
"react-native-events": "^1.0.7",
"react-native-fbsdk": "^0.7.0",
"react-native-maps": "^0.21.0",
"react-native-uber-rides": "^0.4.3",
"react-native-uber-rides-estimates": "^0.1.0",
这是我对 fb 的声明
const FBSDK = require('react-native-fbsdk');
const {
GraphRequest,
GraphRequestManager} = FBSDK;
这是我从 facebook 页面中提取事件的尝试。
getFBEvents = () => {
const infoRequest = new GraphRequest(
'/' + this.state.fbPageId + '/events',
{
accessToken: this.state.fbPageToken,
parameters: {
limit: {
string: '1000'
},
time_filter: {
string: 'upcoming'
},
fields: {
string: 'description,end_time,name,place,id,start_time,ticket_uri'
}
}
},
(error, result) => {
if (!error) {
this.state.fbEventLoaded = true;
let data = result.data
RNCalendarEvents.authorizationStatus()
.then(status => {
if (status === 'authorized')
{
this.saveEvent(data)
}
else if (status === 'undetermined')
{
RNCalendarEvents.authorizeEventStore()
.then(status => {
if (status === 'authorized')
{
this.saveEvent(data)
}
})
.catch(error => {
});
}
})
.catch(error => {
});
}
}
);
new GraphRequestManager().addRequest(infoRequest).start();
这是试图从 facebook 页面中提取封面
getFBCoverPhoto = () => {
const infoRequest = new GraphRequest(
'/' + this.state.fbPageId,
{
accessToken: this.state.fbPageToken,
parameters: {
fields: {
string: 'cover'
}
}
},
(error, result) => {
if (!error) {
console.log('result.cover.source:' +result.cover.source)
this.state.imgSource = result.cover.source
}
}
);
new GraphRequestManager().addRequest(infoRequest).start();
试图弄清楚为什么我的数据没有正确提取。我不断收到 NativeGraphRequestManager.start() 的 TypeError,但我似乎无法弄清楚原因。也许我已经按下它太久了,我现在已经脑死了。
任何帮助表示赞赏。谢谢。
解决方案
推荐阅读
- javascript - 如何找到在模态输入中键入的值并在按下回车键时更改另一个输入的值
- couchdb - 在本地存储中获取已删除的文档
- sql-server - sql server 中的嵌套查询
- docker - Docker:来自守护程序的错误响应:连接到网络失败
- php - 用于同步来自不同实体的两个字段的 Symfony 关系指南
- javascript - 议程上的完整日历冲突周和议程日
- c++ - 创建向量集
- android - Android - Managed Google Play Console 发生意外错误。请稍后再试。(826769013)
- azure-ad-b2c - 如何:当用户取消注册时重新启动 Azure AD B2C UserJourney
- javascript - 从 API 获取 - 特定 API 错误与一般 HTTP 错误