2015-12-21 41 views
4

我试图通过官方iOS SDK(最新版本)共享Facebook Open Graph Action,但现在几天,此操作返回一个错误,现在它已停止加工。 该应用程序通过了Facebook的批准,包括行动和相关对象,这一切似乎都是正确的。从iOS共享Facebook Open Graph Action时出错(不安全链接)

对象的创建和共享动作

// ############## 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是一个网站域名,我还没有分享这个URL直接。它似乎是通过每次分享行动产生的。

有什么想法? 谢谢!

+0

请谁能帮助我? – mhergon

回答

3

不幸的是我不能发表一个简单的评论,所以我不得不将它作为'答案'发布。我找到了这篇文章。这是关于被封锁的网址,但不幸的是没有封锁“Facebook”网址。我希望它能提供帮助。

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

+0

不幸的是,我试过这个,但我仍然有同样的问题。谢谢! – mhergon

+0

您是否尝试过使用支持? –

+0

支持不响应...我会再试一次 – mhergon

0

它连接可能被阻塞,由于App transport security。应用程序传输安全性是iOS9中引入的一项新功能。 它阻止连接到不符合某些安全要求的服务器,如最低TLS版本等。

请将info从ATS关闭后重试。看到这个link显示如何关闭ATS。

+0

这与Facebook无关,但谢谢! – mhergon