共享對話框打開Facebook應用程序,儘管內容已成功共享,我總是收到。取消回撥。在這兩種情況下 - 當我取消共享和共享成功時。任何想法有什麼不對? 莢版本:Facebook ShareDialog總是返回。完成時取消
Using Bolts (1.8.4)
Using FBSDKCoreKit (4.20.2)
Using FBSDKLoginKit (4.20.2)
Using FBSDKShareKit (4.20.2)
Using FacebookCore (0.2.0)
Using FacebookLogin (0.2.0)
Using FacebookShare (0.2.0)
代碼段用於顯示對話框:
@IBAction func onShareClicked(_ sender: UIButton) {
do{
var myContent = LinkShareContent(url: URL(string: "https://www.facebook.com/8MinuteWorkoutChallenge")!)
myContent.hashtag = Hashtag("#8MWC")
let shareDialog = ShareDialog(content: myContent)
shareDialog.mode = .native
shareDialog.failsOnInvalidData = true
shareDialog.completion = { result in
switch result {
case .success:
print("Share succeeded")
case .failed:
self.shareButton.isHidden = true
case .cancelled:
print("Share cancelled")
}
}
try shareDialog.show()
} catch {
print("Error: \(error)")
}
}
配置
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbapi</string>
<string>fb-messenger-api</string>
<string>fbauth2</string>
<string>fbshareextension</string>
</array>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>fb188***33776</string>
</array>
</dict>
</array>
<key>FacebookAppID</key>
<string>18851***3776</string>
<key>FacebookDisplayName</key>
<string>8MWC</string>
您是否要求用戶的發佈許可? –
不,我沒有。在文檔和分享工作中沒有任何關於此的內容,但不是回調。 –