我正在玩Facebook开发工具包,我无法让profile.setinfo工作。文档没用。我正在使用最新的资源 - 28656。
有人可以为我发布一个VB.Net示例吗?
更新:我被问到一个特定问题,所以这是:
Setinfo获取一个List(Of facebook.Schema.info_field)
和info_field应该采用List(Of facebook.Schema.info_item)
但它似乎想要一个itemsLocalType。所以错误是
无法将'System.Collections.Generic.List`1 [facebook.Schema.info_item]'类型的对象转换为'itemsLocalType'类型。
答案 0 :(得分:6)
我终于自己解决了这个问题:
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)