开发者

facebook c# sdk: deleting a request-id

I am using the latest facebook c# sdk (http://facebooksdk.codeplex.com/). After i have sent an apprequest, i want to delete the request id.

This is how i do it at the moment:

var app = new FacebookClient(appid, appsecret);
app.Delete(requestID);

But i am开发者_Python百科 not sure if its get deleted or not. If i try to see if it still exist using the graph api i get:

{
"error": {
  "type": "GraphMethodException",
  "message": "Unsupported get request."
   }
}

But the user still has the request in his notification area. So my question is> Is the request deleted, or did i miss something? Thanks


        var url = "https://graph.facebook.com/{0}?access_token={1}";
        fb.Delete((String.Format(url, fullRequestId, fb.AccessToken)));

First parameter is requestId and user id like -> fullRequestId = requestId + "_" + fbUser.id Second parameter is Accesstoken


I'm just getting started on this myself, but I'm guessing that you need to instantiate the FacebookClient with the authorization code from the user, not with your application data. The way I understand it, the request is sent by the user not your application. Hence the need to use the users authorization code to get information about the requeset.


This is what's working for me (sorry it's VB.Net):

Dim fb As FacebookClient = New FacebookClient(Config.FacebookAppId,Config.FacebookAppSecret)
Dim result = fb.Delete(String.Format("{0}_{1}?access_token={2}", facebookRequestId, facebookUserId, fb.AccessToken))
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜