简体   繁体   English

无法在Facebook分享中添加标题和描述

[英]Can't add title and description in facebook Share

I am trying to implement the Facebook Share in my quiz app. 我正在尝试在测验应用程序中实现Facebook Share。 The content is app store link and quiz score.Which is working fine in simulator but in device shows in different and not showing my description. 内容是应用程序商店链接和测验分数。在模拟器中可以正常工作,但在设备中显示的内容有所不同,但未显示我的描述。 Here is my Code 这是我的代码

    func ShareFB() {
    let fbVC = SLComposeViewController(forServiceType: SLServiceTypeFacebook)
    fbVC?.setInitialText("Hey! I scored \(String(describing: UserDefaults.standard.string(forKey: "TOTAL_SCORE")!)) in Test. This is really interesting! You can also try.")
    fbVC?.add(URL(string: "https://itunes.apple.com/us/app/test-app/i?ls=1&mt=8"))
    fbVC?.add(UIImage(named: "AppIcon"))
    present(fbVC!, animated: true) { _ in

    }
}

also attaching screen Shot of simulator and device. 还附有模拟器和设备的屏幕截图。 模拟器截图

设备的屏幕截图

Why don't you use UIActivityController for such functionality? 为什么不使用UIActivityController实现这种功能?

Example : 范例

    let shareItems = [
        "Hey! I scored \(String(describing: UserDefaults.standard.string(forKey: "TOTAL_SCORE")!)) in Test. This is really interesting! You can also try.",
        URL(string: "https://itunes.apple.com/us/app/test-app/i?ls=1&mt=8"),
        UIImage(named: "AppIcon")] //Add the items you want to share in this array

    let activityViewController = UIActivityViewController(activityItems: shareItems, applicationActivities: nil)

    self.present(activityViewController, animated: true, completion: nil)

Edit: 编辑:

Check this out: https://stackoverflow.com/a/30020929/5716829 看看这个: https : //stackoverflow.com/a/30020929/5716829

now you cannot share image, text and url simultaneously in facebook. 现在,您无法在Facebook中同时共享图像,文本和url。 also Facebook does not allow pre filled text now 此外,Facebook现在也不允许预填文本

According to Facebook's 2.3 policy rules, you can't share pre-filled content because of policy violation. 根据Facebook的2.3政策规则,由于违反政策,您不能共享预填充的内容。 Facebook does not allow you to share the pre-filled user message parameters with any content the user didn't entered himself. Facebook不允许您与用户未输入自己的任何内容共享预填充的用户消息参数。

If you want to share content on Facebook then user has to write/enter himself in Facebook prompt message dialog. 如果要在Facebook上共享内容,则用户必须在Facebook提示消息对话框中进行写/输入。

For more info, please visit: https://developers.facebook.com/docs/apps/review/prefill 有关更多信息,请访问: https : //developers.facebook.com/docs/apps/review/prefill

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法使用Facebook分享链接内容在URL中添加描述和标题 - Can't add description and title to url using Facebook share link content Facebook分享:在Facebook iPhone应用程序中看不到描述 - facebook share: description not visible in facebook iphone app 使用FBSDK for IOS共享标题,图像和描述 - Share title, image and description using FBSDK for IOS iOS-无法再将图像分享到Facebook? - iOS - Can't share images to Facebook anymore? 如何在Facebook iPhone 6中共享带有图像和描述的链接 - How to share a link with image and description in facebook iPhone 6 Facebook SDK似乎缺少内容标题和描述? - The Facebook SDK seems to be missing content title and description? 无法更改共享扩展名导航栏标题颜色(快速) - Can't change share extension navigation bar title color (Swift) Facebook SDK,如何在iOS上隐藏“共享”标题? - Facebook SDK, how to hide “Share” title on iOS? FBSDKShareLinkContent 当应用程序处于实时状态 iOS 时无法共享标题和描述 - FBSDKShareLinkContent Unable to share title and description when application is in live state iOS 无法使用UIActivityViewController在Facebook中共享屏幕截图和URL - Can't share screenshot & URL in Facebook using UIActivityViewController
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM