react-native-fbsdk - 来自 ShareDialog 的 react-native postId null
问题描述
我过去常常react-native-fbsdk {ShareDialog}
在 Facebook 上发布我的提要,但ShareDialog
没有返回帖子 ID,在我的情况下它始终为空。
我的进口
import { ShareDialog, LoginManager, AccessToken, LoginButton } from "react-native-fbsdk";
这是我的代码
const shareLinkContent = {
contentType: 'link',
contentUrl: 'https://www.niofox.com/',
contentDescription: 'Test Sharing Description'
};
var tmp = this;
ShareDialog.canShow(shareLinkContent).then(
(canShow) => {
if (canShow) {
return ShareDialog.show(shareLinkContent);
}
}
).then(
(result) => {
if (result.isCancelled) {
alert('Share cancelled');
} else {
alert('Share success with postId: ' + JSON.stringify(result));
}
},
(error) => {
alert('Share fail with error: ' + error);
}
);
解决方案
推荐阅读
- unit-testing - 在没有杂乱的类型转换的情况下使用 jest.mock 和 TypeScript?
- c - C 编程 - 从 char * 转换为 char 数组?
- mongodb - 如何查询数组中的对象并返回一个对象?
- python - Python: def __init__(self, config_path: str, *args, **kwargs): ^ SyntaxError: invalid syntax
- angular - Angular 5 Firebase Auth Guard 登录状态与从 Auth 服务返回的不同
- angular - 如何减小 Angular 5 模板文件(component.html)的大小?
- javascript - Javascript - 数据重组所需的递归迭代器 - 很难嵌套
- httprequest - Http post and get request in angular 6
- hibernate - “字段列表”中的休眠 JPA 未知列
- sql - 从具有唯一值的列的联接表中选择最大日期