Social Plugin ( ios ): Wont upload image to facebook

I’m having trouble posting an image to facebook. The post appears but sources an image from the url. I’m linking directly to the App Store so it’s just grabbing my app icon. 

Has anyone had trouble with this? I’ve tried these:

    image = {

       { filename = “social_01.png”, baseDir = system.ResourceDirectory },

    },

image = {

        { filename = “social_01.png”, baseDir = system.DocumentsDirectory },

     },

Facing the same problem - It can only post the image from a remote server. 

Hi @altafr,

Please post your code so we can inspect, and remember to surround it with “lua” tags for clarity.

[lua] --code [/lua]

Thanks,

Brent

FYI FB iOS sharing with the social plugin works for me with a local image.

I am having the same problem.

In fact, it seems the only value in the options parameter that is accepted at all is the “url”; which for some reason displays on facebook with an image selected out of my games images directory (seemingly at random).

[lua]

local function facebookPublish()

  local options = {

    service = “facebook”,

    – listener = eventListener,

    image = { filename = “myScreenshot.jpg”, baseDir = system.ResourceDirectory },

    url = “http://www.naturelinksgame.com

  }

  native.showPopup( “social”, options )

end

local isFacebookAvailable = native.canShowPopup( “social”, “facebook” )

if isFacebookAvailable == true then

  local facebookButton = display.newImage(“images/menus/facebookShare.png”)

    facebookButton.x = 525

    facebookButton.y = 650

    facebookButton:addEventListener( “tap”, facebookPublish )

    sceneGroup:insert( facebookButton )

end

[/lua]

FYI I am sure the image exists. I was including a message in “options” as well, but it wasn’t being posted. Also, the “pop-up” that appears when users tap the button firing the facebookPublish function has several options (a space for a message, the ability to share location, and a drop-down of the group of users to share with).

Also, the pop-up only appears for a few seconds before disappearing; the user has to tap the share button in the app to get the pop-up again.

Any help or ideas would be appreciated.

I am having the same problem - no image is included with my Facebook post. Jumped back and forth between various build without any difference. Just FWIW, I am seeing this error in the Xcode console:

<Warning>: Unable to bootstrap_look_up port with name com.apple.share.Facebook.post.gsEvents: unknown error code

Any help appreciated!

Facing the same problem - It can only post the image from a remote server. 

Hi @altafr,

Please post your code so we can inspect, and remember to surround it with “lua” tags for clarity.

[lua] --code [/lua]

Thanks,

Brent

FYI FB iOS sharing with the social plugin works for me with a local image.

I am having the same problem.

In fact, it seems the only value in the options parameter that is accepted at all is the “url”; which for some reason displays on facebook with an image selected out of my games images directory (seemingly at random).

[lua]

local function facebookPublish()

  local options = {

    service = “facebook”,

    – listener = eventListener,

    image = { filename = “myScreenshot.jpg”, baseDir = system.ResourceDirectory },

    url = “http://www.naturelinksgame.com

  }

  native.showPopup( “social”, options )

end

local isFacebookAvailable = native.canShowPopup( “social”, “facebook” )

if isFacebookAvailable == true then

  local facebookButton = display.newImage(“images/menus/facebookShare.png”)

    facebookButton.x = 525

    facebookButton.y = 650

    facebookButton:addEventListener( “tap”, facebookPublish )

    sceneGroup:insert( facebookButton )

end

[/lua]

FYI I am sure the image exists. I was including a message in “options” as well, but it wasn’t being posted. Also, the “pop-up” that appears when users tap the button firing the facebookPublish function has several options (a space for a message, the ability to share location, and a drop-down of the group of users to share with).

Also, the pop-up only appears for a few seconds before disappearing; the user has to tap the share button in the app to get the pop-up again.

Any help or ideas would be appreciated.

Same problem here. A random image from the URL is shown, but not the actual image attached to the post.

d.

After investigation and tests, it seems you can only add an image if you don’t add an URL.

Get the URL out and the image is properly added to the message.

Still a bug though, esp because it is not possible to prefill the facebook message (to add your URL there if needed).

d.

@JareDatkins:

I suggest you:

  1. Use only  system.DocumentsDirectory

  2. Do not use  system.ResourceDirectory

  3. Use same variable for saving and sharing image

  4. I would avoid using predeclared image names, grab a variable instead

  5. Make sure that you grab image in scene:show, and not in forward declarations… because it would be nil

  6. Facebook does not support predeclared strings, email and message does…

Ivan

I am having the same problem - no image is included with my Facebook post. Jumped back and forth between various build without any difference. Just FWIW, I am seeing this error in the Xcode console:

<Warning>: Unable to bootstrap_look_up port with name com.apple.share.Facebook.post.gsEvents: unknown error code

Any help appreciated!

Same problem here. A random image from the URL is shown, but not the actual image attached to the post.

d.

After investigation and tests, it seems you can only add an image if you don’t add an URL.

Get the URL out and the image is properly added to the message.

Still a bug though, esp because it is not possible to prefill the facebook message (to add your URL there if needed).

d.

@JareDatkins:

I suggest you:

  1. Use only  system.DocumentsDirectory

  2. Do not use  system.ResourceDirectory

  3. Use same variable for saving and sharing image

  4. I would avoid using predeclared image names, grab a variable instead

  5. Make sure that you grab image in scene:show, and not in forward declarations… because it would be nil

  6. Facebook does not support predeclared strings, email and message does…

Ivan