profile.setInfo()

Aug 28, 2008 at 9:41 PM
Hi -

Can someone provide an example of how to properly call this? I am getting a "Setting info failed. Check the formatting of your info fields."

 List<info_item> items = new List<info_item>();
                    info_item item = new info_item();
                    item.label = "my school";
                    item.link = "http://www.mydomain.com";
                    item.description = "my description";
                    item.sublabel = "my sublabel";
                    item.image = "http://www.mydomain.com/images/logo.gif";
                    items.Add(item);

Thank you in advance for your help.
Aug 30, 2008 at 3:44 AM
anyone? :(

thanks!
Aug 31, 2008 at 1:38 AM
Im guessing here but im assuming you've not read the spec here: http://wiki.developers.facebook.com/index.php/New_Design_Application_Info_Sections

"Fields are proper-cased by Facebook. Facebook enforces that each key string must end in a colon (":").

Fields have a character limit of around 30 characters. It’s a good practice to ensure that keys don’t wrap onto a second line. "

Im guessing that yor missing the colon, so you code would become:

List<info_item> items = new List<info_item>();
                    info_item item = new info_item();
                    item.label = "my school:";
                    item.link = "http://www.mydomain.com:";
                    item.description = "my description:";
                    item.sublabel = "my sublabel:";
                    item.image = "http://www.mydomain.com/images/logo.gif:"; // You need to check this is under 30 characters when you set it properly
                    items.Add(item);

Hope this helps,
Chris

Aug 31, 2008 at 6:29 AM
Edited Aug 31, 2008 at 7:20 AM
The spec says "Object info sections contain only a single field and an array of info_items. The field is the title for the items and can contain up to 30 characters. The info_items array contains the following items: " - I don't think the link in item.image has that limit as it is an info_item and doesn't carry the 30 character limit, it's not displayed anyway, the limit was to prevent wrapping.  If you check the image at the bottom of the page Chris linked, the first description is 34 or so characters.

I get the same error using either of the FBMLCanvasSample projects, in C# or VB.  Has anyone determined what the cause actually is?

Scratch that - I see that the actual "field" entry isn't being added...  Has anyone corrected the profile class to build the info_fields in the correct format? 
Aug 31, 2008 at 10:30 AM
It's going be an error in the API in that case and we'll have to wait until Tuesday for an answer from the dev team. I've had a quick look at the source and can't see anything obvious out of place however I've not got the time today to debug and step through to see just how it gets formatted.
Sep 1, 2008 at 10:19 PM
I think you are right that there is an error in the API.  There is an open issues regarding Profile.setInfo created in July but does not seem to be resolved.

http://www.codeplex.com/FacebookToolkit/WorkItem/View.aspx?WorkItemId=10364

Please vote. ^_^

Thanks for your feedbacks!