Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

451
Vistas
How to share image with text in Facebook SDK in swift

I want to share a post on facebook with Image and text. I am using Facebook SDK and I am able to share Image, Now I want to share text with this image. How I can?

Here is the source code of sharing the image,

 let photo:FBSDKSharePhoto = FBSDKSharePhoto()

    var message:String?

    let imageName:String = "Star.png"
    photo.image = UIImage(named: imageName)
    photo.isUserGenerated = true

    let content = FBSDKSharePhotoContent()
    content.photos = [photo];


    let dialog = FBSDKShareDialog()
    dialog.fromViewController = self
    dialog.shareContent = content
    dialog.mode = .native
    dialog.show()
over 4 years ago · Santiago Trujillo
3 Respuestas
Responde la pregunta

0

Due to the abuse from some applications, Facebook has explicitly disabled the pre-fill option for the text by simply ignoring it.

"You must not pre-fill any of the fields associated with the following products, unless the user manually generated the content earlier in the workflow: Stream stories (user_message parameter for Facebook.streamPublish and FB.Connect.streamPublish, and message parameter for stream.publish), Photos (caption), Videos (description), Notes (title and content), Links (comment), and Jabber/XMPP."

More info here.

over 4 years ago · Santiago Trujillo Denunciar

0

Facebook wont allow user to add text with image.

Integrate facebookshare sdk

@IBAction func facebookBtn(sender: AnyObject) {
  let shareImage = SharePhoto()
  shareImage.image = imageView.image //Image from your imageview
  shareImage.isUserGenerated = true

  let content = SharePhotoContent()
  content.photos = [shareImage]

  let sharedDialoge = ShareDialog()
  sharedDialoge.shareContent = content

  sharedDialoge.fromViewController = self
  sharedDialoge.mode = .automatic


  if(sharedDialoge.canShow)
  {
    sharedDialoge.show()
  }
  else
  {
    print("Install Facebook client app to share image")
  }
}
over 4 years ago · Santiago Trujillo Denunciar

0

Try this :

 let sharePhoto = FBSDKSharePhoto()
photo.image = photo
photo.caption = "you title"

let content = FBSDKShareMediaContent()
content.media = [photo];
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda