2

In a Unity3D game, connecting to FB (whether using the new FB Unity API, the p31 plugins everyone has usually used, or writing one's own plugin),

Using "me/photos" or "me/photos" you can indeed upload images (I mean literally send an array of bytes).

Let's say you actually WANT TO use FB.FeedShare().

Note, there are two reason you may want to do this:

(1) the dialog is great, you may prefer to use it for user's pleasure

(2) you do not need to get so many permissions from the user or for your app, to use FB.FeedShare().

In fact.

Does anyone know decisively...

Is there a way to include an image with FB.FeedShare()?

If so how to do it?

If the answer is "absolutely no" it would be great to know that.

(Of course you can include a URL of an image. One could cross-post the generated PNG to some web site, and then give the URL. But indeed, I wouldn't be surprised if FB is against that procedure - perhaps the FB systems detect this and ban it, I don't know.)

Fattie
  • 27,874
  • 70
  • 431
  • 719
  • 2
    No, that is not possible - it has to be a publicly reachable HTTP(S) URL. But posting the image to somewhere else, so that it can then be requested from there via HTTP, is perfectly fine; Facebook has no problem with that. (But don’t choose any “free hoster” platform for that where you are one of lots of other users - if one of them misbehaves and posts inappropriate images, the domain/server IP might get blocked, and then your image would not work any more either.) – CBroe Jul 08 '16 at 15:03
  • finally - FACTS :) perhaps, for the sake of googlers and others, you should paste it in as an answer there so I can tick it. Brilliant. canonical stuff – Fattie Jul 08 '16 at 16:27
  • I guess there's the idea of posting it first to indeed one of the user's own albums; and then trying that trick? they don't allow it? – Fattie Jul 08 '16 at 16:27
  • I recommend you contacting Facebook directly. Their support is really good. – Cabrra Jul 08 '16 at 17:12

1 Answers1

3

Is there a way to include an image with FB.FeedShare()?

No, that is not possible - it has to be a publicly reachable HTTP(S) URL.

But posting the image to somewhere else, so that it can then be requested from there via HTTP, is perfectly fine; Facebook has no problem with that. (But don’t choose any “free hoster” platform for that where you are one of lots of other users - if one of them misbehaves and posts inappropriate images, the domain/server IP might get blocked, and then your image would not work any more either.)

I guess there's the idea of posting it first to indeed one of the user's own albums; and then trying that trick? they don't allow it?

Not sure about it in this particular situation, you'd have to try and see if it works.

But they don't allow you to use images "on" Facebook when you put an og:image meta tag into a document and have the FB scraper fetch it from there; in the debug tool that will give an error message saying using images from Facebook's CDN is not allowed. So it might be the same when sharing a link via other means such as the Feed dialog.

CBroe
  • 91,630
  • 14
  • 92
  • 150
  • 1
    Thanks for this great answer. I sent a bounty as a token of thanks. Again it's just remarkable that so few people know this stuff. – Fattie Jul 17 '16 at 18:09