pages.isfan data fetch error
I use c# SDK to fetch pages.isfan data , but it always error.
var args=new Dictionary<string,object>();
args["uid"] = fb_uid;
args["page_id"] = _isfan_page_id;
var isfanobj = (IDictionary<string, object>)fb.Api("pages.isfan", args);
foreach 开发者_如何学JAVA(KeyValuePair<string, object> entry in isfanobj)
{
Response.Write(
string.Format("key:{0}\nvalue:{1}\n",
entry.Key,entry.Value
)
);
}
pages.isfan need 2 parameters: page_id and uid
loop iterate my "isfanobj" , a dictionary type, the "key" always be "error".
Is my code any wrong?
If wrong, how do I get pages.isfan data?
Thanks for your help!!!
this is what I user and it works great for me.
Dictionary<string, object> parms = new Dictionary<string, object>();
parms.Add( "method", "pages.isFan" );
parms.Add( "page_id", YourAppId );
parms.Add( "uid", UsersFbId );
var isFan = fb.Api( parms );
if( (bool)isFan )
{
//this user is a fan
}
I find the fb.Api signature that you pass in all the parameters as a Dictionary works best for me.
I just wanted to add that when dealing with the REST API it is not the same as dealing with the Graph API you have to pass in the method as a parameter.
Also once the Rest API is fully deprecated we will all have to switch to the new method... If they ever come out with it.
Cheers
精彩评论