【问题标题】:Error when Facebook Open Graph Action shared from iOS (unsafe link)从 iOS 共享 Facebook Open Graph Action 时出错(不安全的链接)
【发布时间】:2016-03-27 15:04:52
【问题描述】:

我尝试通过官方 iOS SDK(最新版本)分享 Facebook Open Graph Action,但几天后,此操作返回错误,现在已停止工作。 该应用程序通过了 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。它似乎是在每次分享操作时生成的。

有什么想法吗? 谢谢!

【问题讨论】:

  • 拜托,谁能帮帮我?

标签: ios facebook facebook-graph-api sdk facebook-opengraph


【解决方案1】:

很遗憾,我无法发布简单的评论,所以我必须将其发布为“答案”。我找到了这篇文章。这是关于被阻止的 URL,但不幸的是,与被阻止的“Facebook” URL 无关。希望能帮到你。

http://www.technerves.com/2015/07/unblock-your-website-url-from-facebook.html

【讨论】:

  • 不幸的是,我已经尝试过了,但我仍然遇到同样的问题。谢谢!
  • 支持没有响应...我会再试一次
【解决方案2】:

由于App transport security,它的连接可能会被阻止。应用传输安全是 iOS9 中引入的一个新事物。 它阻止与不满足某些安全要求的服务器的连接,例如最低 TLS 版本等

请从 info.plist 关闭 ATS 后重试。请参阅此link,它展示了如何关闭 ATS。

【讨论】:

  • 这与 Facebook 无关,但谢谢!
猜你喜欢
  • 2015-09-28
  • 1970-01-01
  • 2014-03-04
  • 2014-01-29
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-04-01
  • 1970-01-01
相关资源
最近更新 更多