【发布时间】:2019-04-30 01:10:44
【问题描述】:
我在我的 react-native 应用程序中使用 react-native-fbsdk。
我也遵循了官方设置指南。并设法将其集成到应用程序中。
我正在使用以下标准代码通过ShareDialog分享链接
const shareLinkContent = {
contentType: 'link',
contentUrl: 'http://www.google.com',
quote: 'try 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: ${
result.postId }`);
}
},
(error) => {
alert(`Share fail with error: ${ error }`); // I get the error on this line.
},
);
以上代码在 iOS 和部分安卓设备上运行良好。
但在某些 android 设备上我得到错误Share fail with error: Error: API_ERROR: API_ERROR
仅部分设备没有发现问题
我遇到问题的设备是
Google Pixel gen 1、一些 SAMSUNG 设备、oppo。
我成功运行的设备没有错误:
小米redme note 4,google nexus 5
提前感谢您的帮助
【问题讨论】:
标签: android facebook-share react-native-fbsdk fbsdksharedialog