2015-12-21 39 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