Reputation: 4891
I am sharing video on facebook using GraphSharer and looking for post id in the share completion.
But I am not able to fetch it.
sharer.completion = { result in
// Handle share results
print("Share results : \(result)")
}
I am getting this on my logs :
Share results : success(FacebookShare.PostSharingResult(dictionary: ["video_id": "1455433997844989", "completionGesture": "post"]))
So i tried these but didn't work :
let dict = result as! [String:Any]
result[""]
but getting error ContentSharerResult has no subscript member
Any idea how to get the value video_id from this result ? Any help would be appreciated.
Thanks!
Upvotes: 0
Views: 209
Reputation: 4891
After some more workarounds I finally got the solution for my problem. For anyone in future wants to fetch post id.
sharer.completion = { result in
// Handle share results
print("Share results : \(result)")
switch result{
case .success(let shareResult):
print(shareResult["video_id"]) // Your post id
break
case .cancelled:
break
case .failed(let Error):
print(Error)
break
}
Upvotes: 2