Joel WZ Joel WZ - 1 year ago 70
Javascript Question

Posting a title along with a Photo using the FB.api

I have a kiosk web app that I am supporting and I am having a bit of a problem. We just converted it to allow the customer to enter their own custom message. However, the client is also wanting to post a caption for their venue, along with the photo. We have been using the FB.api method and it works just fine with the customer message. However, I cannot figure out what property to get a title to post. I have tried using title, description, caption, and name. All are either ignored or post instead of the customer's message. If I convert it to the FB.ui method, I can add the title to the post. THe problem with the ui method is that I cannot get the focus to set to the FB generated textbox for the customer to use to enter their custom message. I am sure the focus issue is due to the fact that we are running kiosk mode, with a touch screen and a popup keyboard extension.

Any help would be appreciated.

Answer Source

Here is the method that should work:

var params = {};
params['message'] = fbMsg;
params['link'] = imgUrl;
params['description'] = 'Description Parameter';
params['picture'] = imgUrl;
params['caption'] = 'PostCaption';
params['url'] = imgUrl;
FB.api('/me/feed', 'post', params
, function (response) {
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download