我对facebookshare的行为感到非常奇怪。
当我打开共享对话时,我会在ios上看到下面的屏幕。
一旦我打开
Share With Your Facebook App
,它不会触发
shareDialog.completion
完全正确(代码见下文)。但如果我通过下面显示的电子邮件/密码登录,就可以了。
我想上面的部分在本地应用程序之上,而下面的部分在网络之上。我的设备上已经安装了本机Facebook应用程序。
let myContent = LinkShareContent(url: url!, quote: quote)
let shareDialog = ShareDialog(content: myContent)
shareDialog.mode = .automatic
shareDialog.presentingViewController = self
shareDialog.completion = {
result in
switch result {
case .success:
print("Share: Success")
case .cancelled:
print("Share: Cancel")
case .failed:
print("Share: Fail")
}
}
do {
try shareDialog.show()
} catch {
self.notifyUserOfSharingError()
}