iOS分享Facebook Open Graph Action时出现错误(不安全的链接)

4

我曾经尝试通过官方iOS SDK(最新版本)分享Facebook开放图谱动作,但是近几天来,该动作一直返回错误并停止工作。

该应用程序已经通过了Facebook的审核,包括相关对象和操作都正确无误。

对象创建和共享操作

// ############## OpenGraph - Arrive At a Marina

// Photo
var photoURL = ""
if let image = firstMarina.images.first {
    photoURL = image.width1440
} else {
    photoURL = "https://fbstatic-a.akamaihd.net/images/devsite/attachment_blank.png"
}
let photo = FBSDKSharePhoto(imageURL: NSURL(string: photoURL)!, userGenerated: false)

// Properties
let properties = [
    "fb:app_id": "xxxxxxxxxxxxxxxxxxxxx",
    "og:locale": NSLocale.preferredLanguages()[0].stringByReplacingOccurrencesOfString("-", withString: "_"),
    "og:type": "smartsea:marina",
    "og:title": firstMarina.name!.text,
    "og:description": firstMarina.desc!.text,
    "og:image": [photo],
    "place:location:latitude": firstMarina.location!.lat,
    "place:location:longitude": firstMarina.location!.lng
]

// Object
let object = FBSDKShareOpenGraphObject(properties: properties as [NSObject : AnyObject])

// Action
let action = FBSDKShareOpenGraphAction(type: "smartsea:arrive_at", object: object, key: "marina")

// Content
let content = FBSDKShareOpenGraphContent()
content.action = action
content.previewPropertyName = "marina"

// Share
FBSDKShareDialog.showFromViewController(self, withContent: content, delegate: self)

并返回错误

Error Domain=com.facebook.Facebook.platform Code=102 "(null)" UserInfo={error_reason=The content you're trying to share includes a link that our security systems detected to be unsafe:

https://m.facebook.com/appcenter/smartsea?fbs=9909&fb_object_id=1684374595135519

Please remove this link to continue., error_description=An error occurred during publishing., app_id=xxxxxxxxxxxxxxxxxxxxx, error_code=102}

奇怪的是,错误的 URL 是 Facebook 的域名,而我并没有直接分享这个 URL。它似乎是在每次分享时自动生成的。

有什么想法吗? 谢谢!


请问,有人可以帮我吗? - mhergon
2个回答

3

不幸的是,我已经尝试过这个方法,但问题仍然存在。谢谢! - mhergon
支持团队没有回复……我会再试一次。 - mhergon

0

连接可能因为应用传输安全而被阻止。应用传输安全是iOS9中引入的新功能。它会阻止与不符合某些安全要求的服务器的连接,例如最低TLS版本等。

请尝试在info.plist中关闭ATS后再次尝试。请参考此链接,了解如何关闭ATS。


那与Facebook无关,但谢谢! - mhergon

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接