سؤال

Since Facebook is removing the ability to post to friends' wall via Graph API from February 6, 2013 onward, I want to know if there are some alternates to post to the friend's Wall.

Till now, I was using Feed API for this- using to parameter but it throws the exception:

(#200) Feed story publishing to other users is disabled for this application

The possible solution that I found was: OG: Mention Tagging. But is there a way to accomplish this other than by using OpenGraph? Please help.

هل كانت مفيدة؟

المحلول

But is there a way to accomplish this other than by using open graph?

Accomplish what exactly?

Tagging users/friends in any kind of posts? Only possible for Open Graph stories, or photos. (But be aware, apps are not supposed to tag users in photos if the user is not actually in it, or if it’s not a real photo, but just a composite image.)

Or posting to friend’s wall? This will only be possible using the Feed dialog from Feb. 2013 on.

نصائح أخرى

The possibilty to post to friend’s walls via API will be removed in February 2013 – https://developers.facebook.com/roadmap/#february-2013:

If it fails for your app already, maybe you have the corresponding migration enabled in your settings? Anyway, not much point in developing such a thing now, since it won’t work any more in a week.

“We will remove the ability to post to a user's friends' walls via the Graph API. Specifically, posts against [user_id]/feed where [user_id] is different from the session user, or stream.publish calls where the target_id user is different from the session user, will fail.”

If you want to allow people to post to their friends' timelines, invoke the feed dialog. Stories that include friends via user mentions tagging or action tagging will show up on the friend’s timeline (assuming the friend approves the tag). For more info, see this blog post.

Edit:

@Sahil: See also this answer if it works now. I am not sure it will work now or not. But you should try once. I had made some workflow previously by selecting friend and inviting him and also posting on his wall also. I havn't tested this now, please confirm me.

If you use the to parameter with the Feed Dialog, you'll also need to specify a valid access token.

We actually had this same problem, which we solved by displaying the Feed Dialog as an iframe and dynamically adjusting the to param. You can find an in-depth answer + code sample here: https://stackoverflow.com/a/14532867/1406819

Check the FB.ui documentation for the feed method here: https://developers.facebook.com/docs/reference/dialogs/feed/

Setting the "to" parameter to a friend's ID will enable posting to a timeline. to - The ID or username of the profile that this story will be published to. If this is unspecified, it defaults to the the value of from.

See the Properties detail lower on that page for more info. Note that using this will trigger a confirmation dialog.

If you're using the JS SDK, here's something to get you started:

var MY_ID = "1000000000000";
    function post(link, callback){
        var post = {};
        post.method = 'feed';
        if(!link.target)
        {
            link.target = MY_ID;
        }
        if(!link.from)
        {
            link.from = MY_ID;
        }

        post.to             = link.target;
        post.from           = link.from;
        post.link           = link.link;
        post.name           = link.name;
        post.picture        = link.picture;
        post.caption        = link.caption;
        post.description    = link.description;

        FB.ui(post, function(response){
            if(typeof callback=='function'){callback(response);}
        });
    }
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top