ETA on feed.publishUserAction?

Aug 30, 2008 at 4:07 AM
Hi

I just ran into the problem where I can register a template bundle, but there's no corresponding publishUserAction api method. The alternative methods are marked as deprecated in the facebook dev wiki.

I found a possible workaround in this thread, but I'd rather not go manual if this is coming soon.

Pete
Sep 2, 2008 at 4:52 PM
Ditto the first post.  I'd really like to have this method available.
Developer
Sep 3, 2008 at 2:52 AM
I haven't checked the new version but the brand new version should not lack such an important API feature
Sep 3, 2008 at 4:21 PM

I added the following code to feed.cs in the source code to get it to work:

There's the method itself (which goes in the feed class, obviously) and then a helper class and enum, hope this helps:

 

public

 

bool publishUserAction(long template_bundle_id, Dictionary<string, string> template_data, List<feedImage> imageDetails,string body_general, string target_ids, feedStorySize? feedStorySize)

 

{

 

var parameterList = new Dictionary<string, string> { { "method", "facebook.feed.publishUserAction" } };

 

_api.AddRequiredParameter(parameterList,

"template_bundle_id", template_bundle_id.ToString());

 

_api.AddOptionalParameter(parameterList,

"body_general",body_general);

 

 

if(feedStorySize.HasValue)

 

{

_api.AddOptionalParameter(parameterList,

"story_size",(int)feedStorySize.Value);

 

}

 

var list = new List<string>();

 

 

foreach (var item in imageDetails)

 

{

 

var dict = new Dictionary<string, string>{{"src", item.Src}};

 

 

if(!string.IsNullOrEmpty(item.Href))

 

{

dict.Add(

"href", item.Href);

 

}

list.Add(

JSONHelper.ConvertToJSONAssociativeArray(dict));

 

}

template_data.Add(

"images",JSONHelper.ConvertToJSONArray(list));

 

_api.AddJSONAssociativeArray(parameterList,

"template_data", template_data);

 

 

var response = _api.SendRequest(parameterList);

 

 

return !string.IsNullOrEmpty(response) ? feed_publishUserAction_response.Parse(response).TypedValue : false;

 

}

 

 

public class feedImage

 

 

 

 

{

 

public string Src { get; set; }

 

 

public string Href { get; set;}

 

}

 

public enum feedStorySize

 

 

 

 

{

oneLineTemplate=1,

storyTemplate=2,

fullTemplate=4

}

Sep 3, 2008 at 4:27 PM
Edited Sep 3, 2008 at 4:33 PM
http://www.codeplex.com/FacebookToolkit/WorkItem/View.aspx?WorkItemId=10874$0Looks like this has been coded, but is not checked into source yet?$0
Sep 3, 2008 at 5:38 PM
Edited Sep 3, 2008 at 5:40 PM
I got errors using the code above, so here is a slightly modified version

        public bool publishUserAction(long template_bundle_id, Dictionary<string, string> template_data, List<feedImage> imageDetails, string body_general, string target_ids, feedStorySize? feedStorySize)
        {
            var parameterList = new Dictionary<string, string> { { "method", "facebook.feed.publishUserAction" } };
            _api.AddRequiredParameter(parameterList, "template_bundle_id", template_bundle_id.ToString());
            _api.AddOptionalParameter(parameterList, "body_general", body_general);

            if (feedStorySize.HasValue)
            {
                _api.AddOptionalParameter(parameterList, "story_size", (int)feedStorySize.Value);
            }

            var list = new List<string>();
            foreach (var item in imageDetails)
            {
                var dict = new Dictionary<string, string> { { "src", item.Src } };
                if (!string.IsNullOrEmpty(item.Href))
                    dict.Add("href", item.Href);

                list.Add(JSONHelper.ConvertToJSONAssociativeArray(dict));
            }

            //images are not required
            if (list.Count > 0)
                template_data.Add("images", JSONHelper.ConvertToJSONArray(list));

            //template data is not required
            if (template_data.Count > 0)
                _api.AddJSONAssociativeArray(parameterList, "template_data", template_data);

            var response = _api.SendRequest(parameterList);
            return !string.IsNullOrEmpty(response) ? feed_publishUserAction_response.Parse(response).TypedValue : false;
        }
Sep 29, 2008 at 10:43 PM
Sounds like all these fixes need to get bundled into a proper RTW v2.0 release.  The last update was August 8th, it's almost October now!
Oct 6, 2008 at 8:41 AM
is there a new update? when is the fix scheduled for release?
the solution posted here doesn't work for me....
Oct 14, 2008 at 9:44 PM
Am I correct that this is the only means to show something on user's feeds?
I.E.
'userxxx' just installed 'My App'
'userxxx' just updated 'My App'

I would think this is a critical piece for devs. How are you guys getting your app in front of people otherwise?

Please vote this issue up: http://www.codeplex.com/FacebookToolkit/WorkItem/View.aspx?WorkItemId=11223
Oct 14, 2008 at 9:50 PM
I believe messages like "'userxxx' just installed 'My App' " are posted by facebook.
Oct 15, 2008 at 3:15 AM
I have added and removed my own app today, and no messages like that have shown on my wall/profile.
I assume that's for me to do. But I imagine that's a big way to keep your app in front of people's eyes.
Don't you guys have actions in your apps that would get em more attention if you could post actions to the wall/profile.
I am thinking about maybe trying to recompile the dll with the code above if this is as far as the toolkit is going to go.
I am reading in other places that maybe the toolkit is not going to have new releases anytime soon...
Oct 15, 2008 at 8:14 AM
i have added the code above to my dll and using it.
one fix is still needed in order for you to use the target token, add the line:

_api.AddOptionalParameter(parameterList,

"target_ids", target_ids);

 

Oct 15, 2008 at 10:24 AM
Can someone upload their DLLs somewhere for those of us running Web Dev. Edition of VS!!?