HTML5   发布时间:2022-04-27  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了从iOS共享Facebook Open Graph Action时出错(不安全链接)大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我尝试通过官方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@R_432_6964@": 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.它似乎是在每次分享行动时产生的.

任何的想法?
谢谢!

解决方法

不幸的是我无法发表简单的评论,因此我必须将其作为“回答”发布.我找到了这篇文章.这是关于被阻止的URL,但不幸的是没有被阻止的’Facebook’URl.我希望它可以提供帮助.

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

大佬总结

以上是大佬教程为你收集整理的从iOS共享Facebook Open Graph Action时出错(不安全链接)全部内容,希望文章能够帮你解决从iOS共享Facebook Open Graph Action时出错(不安全链接)所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。