Facebook

Hi all,

I think I got ahead of myself :(.   I know these questions have been asked before, but I cannot find any recent answers, and things in the facebook workd change fast.  I have set up my game to take screenshots of my game which I would then post to facebook.  However, I think i just discovered;

  • That you cannot post local images to facebook using the Facebook v4 pluggin?  

  • I can use the social popup, but this just posts an image without any context, or connection to my app (it would be nice if it opened my website when the image was clicked).

  • Can’t find the documentation for activity plugin, is this still prefered for iOS?

Do I have any other options?

Thanks in advance,

Craig

You can post with the facebook.request() API, however you have to get approval from Facebook to do it and you can’t pre-fill out any text. The approval process is challenging.

There should be a facebook.showDialog() that will let you post your image without needing the extra publish privileges that is needed for facebook.request(). I’m not sure which dialog would work best for you.

There seems to be a redirect issue for the Activity plugin. We are investigating.  But it’s still the preferred way to simply share things to Facebook and Twitter on iOS and the “Social” plugin for Android.

Rob

Thanks Rob,

Just to be clear,  can I upload a ‘local’ image, or do I need to connect to a URL?  The documentation talks about URLs.  

Cheers,

Craig

Hey,

I am assuming that local uploads are not working,  I tried it and kept getting “response: (#324) Requires upload file”.  I saw in a post this might be implemented at some stage, any word on this??

Cheers,

Craig

Have you looked at the sample app that ships with Corona:  SampleCode/Networking/Facebook?

There are buttons in the sample to post a photo and use the Share photo dialog.

Rob

Hey Rob,

This was my starting point,  in the example there are no ‘local’ uploads,  all the images posted are via a url.  For this to work I would have to post my image somewhere first, I am trying to avoid this, I was looking for a way to post directly to facebook.

elseif requestedFBCommand == POST\_PHOTO then local attachment = { caption = "Photo Caption", url = "http://www.coronalabs.com/links/demo/Corona90x90.png", } response = facebook.request( "me/photos", "POST", attachment ) 

Thanks,

Craig

This was mentioned in another post last November,  is this likely to be included any time soon?

https://forums.coronalabs.com/topic/66067-facebook-v4-share-image-dialog/

Craig

Hey,

Just a bump on this.  I got around the issue by uploading the image to my server first and then linking to that url when posting to FB.  This works well most times, but it does fail a lot when my server (cheap hostgator option) is running slow.

Is there any other option?   Just to be clear what I want; user takes screenshot in game, and then posts this image to facebook.  

I thought about using the social plugin, but it doesnt suit the flow, and it doesnt create a link with my app on FB (it is just a photo). 

Thanks,

Craig

I’m just investigating this now for one of my games.   Can you bake the name of your game into your screenshot that gets uploaded?   Some (most?) people will see these posts on their desktop/laptop, I would think the game link would only help with mobile facebook users.

I’ve got canned mp4 video of scenes I’m hoping to be able to send via SMS, Facebook, and Twitter.   Seems odd that FB won’t let you post text but you can upload an image.   Maybe I read this thread wrong.

I believe that Facebook’s intent here is that they don’t want apps writing messages that the individual didn’t write themselves. Lets say a malicious app would write “I robbed the convenient store last night”. Clearly most humans would not say such a thing, so Facebook does not allow apps to write something with out a human being able to read and edit it before posting.  Because humans are lazy, even a pre-filled out message could be sent without the person paying attention to it, so no pre-filled messages. Facebook is of course reacting to problems that have happened and they want to minimize issues.

Rob

You can post with the facebook.request() API, however you have to get approval from Facebook to do it and you can’t pre-fill out any text. The approval process is challenging.

There should be a facebook.showDialog() that will let you post your image without needing the extra publish privileges that is needed for facebook.request(). I’m not sure which dialog would work best for you.

There seems to be a redirect issue for the Activity plugin. We are investigating.  But it’s still the preferred way to simply share things to Facebook and Twitter on iOS and the “Social” plugin for Android.

Rob

Thanks Rob,

Just to be clear,  can I upload a ‘local’ image, or do I need to connect to a URL?  The documentation talks about URLs.  

Cheers,

Craig

Hey,

I am assuming that local uploads are not working,  I tried it and kept getting “response: (#324) Requires upload file”.  I saw in a post this might be implemented at some stage, any word on this??

Cheers,

Craig

Have you looked at the sample app that ships with Corona:  SampleCode/Networking/Facebook?

There are buttons in the sample to post a photo and use the Share photo dialog.

Rob

Hey Rob,

This was my starting point,  in the example there are no ‘local’ uploads,  all the images posted are via a url.  For this to work I would have to post my image somewhere first, I am trying to avoid this, I was looking for a way to post directly to facebook.

elseif requestedFBCommand == POST\_PHOTO then local attachment = { caption = "Photo Caption", url = "http://www.coronalabs.com/links/demo/Corona90x90.png", } response = facebook.request( "me/photos", "POST", attachment ) 

Thanks,

Craig

This was mentioned in another post last November,  is this likely to be included any time soon?

https://forums.coronalabs.com/topic/66067-facebook-v4-share-image-dialog/

Craig

Hey,

Just a bump on this.  I got around the issue by uploading the image to my server first and then linking to that url when posting to FB.  This works well most times, but it does fail a lot when my server (cheap hostgator option) is running slow.

Is there any other option?   Just to be clear what I want; user takes screenshot in game, and then posts this image to facebook.  

I thought about using the social plugin, but it doesnt suit the flow, and it doesnt create a link with my app on FB (it is just a photo). 

Thanks,

Craig

I’m just investigating this now for one of my games.   Can you bake the name of your game into your screenshot that gets uploaded?   Some (most?) people will see these posts on their desktop/laptop, I would think the game link would only help with mobile facebook users.

I’ve got canned mp4 video of scenes I’m hoping to be able to send via SMS, Facebook, and Twitter.   Seems odd that FB won’t let you post text but you can upload an image.   Maybe I read this thread wrong.

I believe that Facebook’s intent here is that they don’t want apps writing messages that the individual didn’t write themselves. Lets say a malicious app would write “I robbed the convenient store last night”. Clearly most humans would not say such a thing, so Facebook does not allow apps to write something with out a human being able to read and edit it before posting.  Because humans are lazy, even a pre-filled out message could be sent without the person paying attention to it, so no pre-filled messages. Facebook is of course reacting to problems that have happened and they want to minimize issues.

Rob