我正在使用 Facebook 开发工具包,但无法让 profile.setinfo 工作。该文档没有用。我正在使用最新的源 - 28656。
有人可以为我发布一个 VB.Net 示例吗?
更新:有人问我一个具体问题,所以这里是:
Setinfo 获取一个列表(来自 facebook.Schema.info_field)
并且 info_field 应该获取一个列表(来自 facebook.Schema.info_item)
但它似乎需要一个 itemsLocalType 来代替。所以错误是
Unable to cast object of type 'System.Collections.Generic.List`1[facebook.Schema.info_item]' to type 'itemsLocalType'.
最佳答案
我终于自己解决了:
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)
关于asp.net - Facebook .net 开发工具包 - setinfo,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/548343/