• Empleos
  • Sobre nosotros
  • profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
  • empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Pruebas Online
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

353
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()
almost 3 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.

almost 3 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")
  }
}
almost 3 years ago · Santiago Trujillo Denunciar

0

Try this :

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

let content = FBSDKShareMediaContent()
content.media = [photo];
almost 3 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 Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda