通过Facebook Native app - iOS Facebook SDK分享时,“引用”缺失

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了通过Facebook Native app - iOS Facebook SDK分享时,“引用”缺失相关的知识,希望对你有一定的参考价值。

我在我的ios应用程序中使用Facebook共享。通过Facebook Native app分享时,“quote”缺失,请查看以下屏幕截图:

enter image description here


但是当FBSDKShareDialogModefeedBrowser时,它运作良好。检查以下屏幕截图:

enter image description here

可能是什么问题?这个功能最近是从Facebook删除的吗?以下是我的代码:

  let content = FBSDKShareLinkContent()
  content.contentURL = URL(string: "https://www.google.co.in/")
  content.hashtag = FBSDKHashtag(string: "#FeelingGood")
  content.quote = "Sample Quote"

  let dialog = FBSDKShareDialog()
  dialog.fromViewController = self

  dialog.shareContent = content
  dialog.delegate = self
  dialog.mode = FBSDKShareDialogMode.native
  if !dialog.canShow() {
    dialog.mode = FBSDKShareDialogMode.automatic
  }
  dialog.show()

我正在使用Xcode9.1,Swift 3.2,iOS 10.3.3和iOS 11以及FacebookSDK 4.19.0

答案
  let content = FBSDKShareLinkContent()
  content.contentURL = URL(string: "https://www.google.co.in/")
  content.hashtag = FBSDKHashtag(string: "#FeelingGood")
  content.quote = "Sample Quote"

  let dialog = FBSDKShareDialog()
  dialog.fromViewController = self

  dialog.shareContent = content
  dialog.delegate = self
  dialog.mode = FBSDKShareDialogMode.shareSheet
  if !dialog.canShow() {
    dialog.mode = FBSDKShareDialogMode.automatic
  }
  dialog.show()`

以上是关于通过Facebook Native app - iOS Facebook SDK分享时,“引用”缺失的主要内容,如果未能解决你的问题,请参考以下文章

React-native Log in with Facebook App 刷新应用

ios swift facebook登录 fb_mobile_login_native_app_switch_dialog_result 错误

当设备中安装了 FB Native App 时,无法使用 Facebook ios sdk v3 进行授权

有哪些推送平台支持react native

Facebook 登录“异常抛出”错误通过 iOS 上的 React Native

Expo,React Native,分享/上传图片到Facebook(我自己的页面上的故事)