【发布时间】:2020-02-15 13:49:15
【问题描述】:
我已按照此 GitHub URL 将 Facebook 共享集成到我的应用程序中。 https://github.com/facebook/react-native-fbsdk 这是我的代码:
constructor(props){
super(props);
this.state={
shareLinkContent : {
contentType: 'link',
contentDescription: 'Facebook sharing is easy!',
contentUrl: 'https://cabbazar.com',
},
}
shareLinkWithShareDialog() {
var tmp = this;
ShareDialog.canShow(tmp.state.shareLinkContent).then(
function(canShow) {
if (canShow) {
return ShareDialog.show(tmp.state.shareLinkContent);
}
}
).then(
function(result) {
console.log('handle result: ' + result);
},
function(error) {
console.log('Share fail with error: ' + error);
}
);
}
但我的模拟器总是出错。我需要为 Xcode 设置什么吗? 我检查了这个网址,但它没有解决我的问题。 null is not an object (evaluating 'ShareDialog.canShow')
谢谢
【问题讨论】:
标签: ios xcode react-native react-native-fbsdk