I would like to enable users in my app to share certain content on their facebook page such as: url, photo, text.
This is the only piece of documentation that I could find on facebook website. I can't find any proper tutorial.
Do I need to add any method in App Delegate to configure facebook sdk?
What is the type of myContent
?
I don't know where to start.
import FacebookShare
let shareDialog = ShareDialog(content: myContent)
shareDialog.mode = .Native
shareDialog.failsOnInvalidData = true
shareDialog.completion = { result in // Handle share results }
try shareDialog.show()
pods spec
Installing Bolts (1.9.0)
Installing FBSDKCoreKit (4.38.0)
Installing FBSDKLoginKit (4.38.0)
Installing FBSDKShareKit (4.38.0)
Installing FacebookCore (0.5.0)
Installing FacebookLogin (0.5.0)
Installing FacebookShare (0.5.0)
There is a difference between
Message Dialog
andShare Dialog
, the message dialog opens the messenger app with the content, and the share dialog opens the share option in the facebook app, from your code it looks like you are trying to open the share option so you should edit the question title, secondlymyContent
is a type of object that conforms to theContentProtocol
, for example like you said sharing a url, you need to create aLinkShareContent
, here is an example:note: for a photo you can create a
PhotoShareContent
.