views:

461

answers:

1

I'm playing with the Facebook development toolkit and I can't get profile.setinfo to work. The documentation is not useful. I'm using the latest source - 28656.

Can someone post a VB.Net example for me please?

Update: I was asked for a specific problem, so here it is:

Setinfo takes a List(Of facebook.Schema.info_field)

and info_field is supposed to take a List (Of facebook.Schema.info_item)

but it seems to want an itemsLocalType instead. So the error is

Unable to cast object of type 'System.Collections.Generic.List`1[facebook.Schema.info_item]' to type 'itemsLocalType'.

+6  A: 

I finally worked it out on my own:

Dim items = New facebook.Schema.info_field.itemsLocalType     
items.info_item.add(New Schema.info_item With {.label = "Happy", .image = "http://imageurl1/", .sublabel = "", .description = "The original and still undefeated.", .link = "http://www.scottstonehouse.ca/blog"})

items.info_item.Add(New Schema.info_item With {.label = "Indifferent", .image = "http://imageurl2/", .sublabel = "", .description = "meh....", .link = "http://www.scottstonehouse.ca/blog"})

items.info_item.Add(New Schema.info_item With {.label = "Sad", .image = "http://imageurl3/", .sublabel = "", .description = "Oh my god! you killed my dog!", .link = "http://www.scottstonehouse.ca/blog"})

items.info_item.Add(New Schema.info_item With {.label = "Cool", .image = "http://imageurl4/", .sublabel = "", .description = "Yeah. whatever", .link = "http://www.scottstonehouse.ca/blog"})

Dim ifields = New List(Of facebook.Schema.info_field)()

ifields.Add(New facebook.Schema.info_field With {.field = "test field name", .items = items})

_fbService.API.profile.setInfo("Info Title", 5, ifields, _fbService.API.uid)
ScottStonehouse