2013-06-20 26 views
0

大家好, 我使用
https://graph.facebook.com/USER_ID/notifications?include_read=1&access_token=ACCESS_TOKEN 讓我vb.net應用程序從Facebook通知,但讀我試圖https://graph.facebook.com/NOTIF_ID?unread=false,但它似乎沒有沒有,我不能將通知標工作。 任何人都可以幫助我將通知標記爲已讀嗎? 請注意代碼標記的Facebook notificatios爲已讀圖形API

USER_ID = xxxxxxxxxxxx 
ACCESS_TOKEN = xxxxx.....xxxx(quite lengthy actually) 
NOTIF_ID = notif_xxxxxxx_yyyyyyyy 

三江源:)

回答

1

您正在使用的標記通知讀取URL是完全正確的。我正在使用它來標記我的應用程序中的閱讀通知。您發佈的帖子請求必須存在問題。

下面是我如何標記通知讀取(在C#/ XAML中)。 VB.NET的實現不應該離它太遠。

我獲取包括閱讀的通知數據,就像你已經做了,並將它們保存在一個集合/ List中。然後標記單個項目閱讀使用下面的代碼:

string notif_id = item.Id; // My notification obj

string url = " https://graph.facebook.com/ " + notif_id + "?unread=false";

FacebookClient fb = new FacebookClient(App.AccessToken);

IDictionary para = new Dictionary();

dynamic result = await fb.PostTaskAsync(url, para);

opResult = (bool)result; // If its true means notification has been successfully marked read

如果你想將它們標記單批,然後只需用一個forearch及以上裏面的代碼,如:

foreach(Notification item in NotificationsCollection) {

// insert above code lines here

}

希望這有助於。 :)