I tried to split the Open Open action on Facebook through the official iOS SDK (latest version), but within a few days this action returns an error, and now it has stopped working. The app has endorsed Facebook, including actions and related objects, and it all seems right.
Creating and sharing objects
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)
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
]
let object = FBSDKShareOpenGraphObject(properties: properties as [NSObject : AnyObject])
let action = FBSDKShareOpenGraphAction(type: "smartsea:arrive_at", object: object, key: "marina")
let content = FBSDKShareOpenGraphContent()
content.action = action
content.previewPropertyName = "marina"
FBSDKShareDialog.showFromViewController(self, withContent: content, delegate: self)
and received error
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:
Please remove this link to continue., error_description=An error occurred during publishing., app_id=xxxxxxxxxxxxxxxxxxxxx, error_code=102}
It is strange that the error URL is a Facebook domain, and I did not pass it to the direct URL. It seems to be generated with every stock action.
Any idea? Thanks!
source
share