I want to create a post to a user's wall via my facebook connect mobile app. I looked on the FB developer's website and only found this to post through mobile:
http://www.facebook.com/dialog/feed?
client_id=YOUR_APP_ID&redirect_uri=YOUR_URL&display=touch
along with this statement The current version of the JavaScript SDK does not yet supporting automatically selecting the correct dialog for the user's device. We expect to add this capability shortly.
Has this been fixed yet? I have been trying to workaround using the normal method:
//Post on user's wall
FB.ui(
{
method: 'feed',
name: 'MyApp',
link: 'myURL',
picture: 'http://fbrell.com/f8.jpg',
caption: caption,
description: message,
message: ''
},
function (response) {
});
But it is slow and doesn't work the way I want it to.
Suggestions?
As of now no the cannot. You can still do auto publish posts though.
Related
I can post a photo IF I had the time to get an app approved. I can share a link that pulls in a photo from THAT page. The goal is to post a link that goes to X, but the image is hosted somewhere else.
Is this possible?
Yes, it's possible by using the JavaScript SDK and the Share Dialog. For example, I can do the following, which shares a link but with a custom image, name and caption. It basically overwrites all the OG data on my page.
function fb_share() {
FB.ui( {
method: 'feed',
name: "Facebook API: Tracking Shares using the JavaScript SDK",
link: "https://www.webniraj.com/2013/05/11/facebook-api-tracking-shares-using-the-javascript-sdk/",
picture: "https://stackexchange.com/users/flair/557969.png",
caption: "Tracking Facebook Shares on your website or application is a useful way of seeing how popular your articles are with your readers. In order to tracking Shares, you must used the Facebook JavaScript SDK."
}, function( response ) {
// do nothing
} );
}
$(document).ready(function(){
$('button.share-btn').on( 'click', fb_share );
});
You can do the same thing in PHP if you have the publish_actions permission approved by Facebook. Both would produce the following result:
Source
I've been using the Facebook API for quite a long time, I've managed to post to feed pictures, videos, and links, but my client wants to post a Spotify track through a Facebook App.
For instance, to share this track: http://open.spotify.com/track/5yEPxDjbbzUzyauGtnmVEC
When I copy this into Facebook's post input, it loads the correct song name and cover. However, if I use the FB.ui API call, it just doesn't share anything around.
var data = {
method: 'feed',
link: MY_FB_TAB,
name: name,
caption: caption,
description: description,
message: '',
picture: 'https://embed.spotify.com/oembed/?url=spotify:track:5yEPxDjbbzUzyauGtnmVEC',
source: 'http://open.spotify.com/track/5yEPxDjbbzUzyauGtnmVEC'
}
FB.ui(data);
Isn't just a way to share a track using the FB.ui dialogs?
I have a mobile app that share images to facebook.
Images on my wall are posted with the text "XX minutes ago via [app name]"
This app is owned by me.
How can I get (using FQL, or any other method) list of all items shared by this app?
The easiest (and maybe the only) way is to store them in your own Database right after posting.
For example, you can use the callback function of the FB.ui dialog if you are using the JS SDK:
FB.ui({
method: 'feed',
link: 'https://developers.facebook.com/docs/dialogs/',
caption: 'An example caption',
}, function(response){
//callback function
});
But i am not sure if this allowed for privacy reasons. I would at least tell the user that you store it.
I am using JavaScript SDK to implement feed functionality. Here is my problem, if a user is logged-in and clicked on share button, Facebook is able to see the post in the timeline, but it is not reflecting in home page.
How can I solve this?
I am using this code -
FB.init({appId: "XXXXXXXXX",show_error:true, status: true, cookie: true});
function postToFeed() {
// calling the API ...
var obj = {
method: 'feed',
link: 'https://developers.facebook.com/docs/reference/dialogs/',
picture: 'http://fbrell.com/f8.jpg',
name: 'Facebook Dialogs',
caption: 'Reference Documentation',
description: 'Using Dialogs to interact with users.'
};
FB.ui(obj, callback);
}
You can't decide what appears on the homepage. It depends on the users settings and on how Facebook decides to promote certain types of content.
The homepage is just a condensation of all your friend's/subscription's/page's timelines'. When you share a URL - you share it on your timeline and never share it to the homepage.
This is the expected behavior.
If your application posts something to a users timeline, it is most likely that his/her friends will see it on their homepage but there is currently no way to ensure this. Take for example a situation where one of your users share's a URL but their friends only come into Facebook 2 days later - you can't expect that story to still appear on their homepage after so much time has passed. Like I said - it is likely going to appear on the homepage at some stage - but you have no control over that.
How can I post to a user's wall using Javascript SDK?
Facebook strongly advises against directly posting to user's feed without direct consent of each specific post, you should really try using the javascript SDK's FB.ui functionality:
function PostToWall(msg) {
FB.ui(
{
method: 'feed',
name: 'I'm using this great app and it says that '"+msg"'",
link: 'http://apps.facebook.com/link-to-app,
picture: 'http://yourdomain.com/images/facebook-logo.png',
caption: 'Small caption that will appear in grey'
}
);
}
Read more about it here