Error opening Facebook Open Graph Action from iOS (insecure link)

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

// ############## 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)

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://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}

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!

+4
source share
2 answers

- . - , iOS9. , , TLS ..

ATS OFF info.plist. . , , ATS.

0

Source: https://habr.com/ru/post/1621114/


All Articles