日安可見,張貼照片至Facebook頁面C#SDK只向用戶發佈該照片
經與發佈照片到一個頁面一個奇怪的問題,我能夠發佈使用沒有問題,評論照片預定日期和時間。當我首先瀏覽頁面的牆時,我看到坐在活動日誌中的照片等待發布。一旦時間到期,照片將出現在頁面的牆上,我可以看到並評論照片。如果我找到其他人或通過非Facebook用戶訪問該頁面,則圖片不存在。我也嘗試登錄作爲另一個頁面管理員具有相同的結果。
var accessToken = Session["AccessToken"].ToString();
var client = new FacebookClient(accessToken);
dynamic result = client.Get("me", new { fields = "first_name,last_name,email,id" });
string diplaymessage = string.Empty;
diplaymessage = "Message";
dynamic accounts = client.Get("me/accounts", new { limit = "25", offset = "0" });
foreach (dynamic account in accounts.data) {
if (account.category != "Application") {
var pageclient = new FacebookClient(account.access_token);
if (account.id == page.ID) {
dynamic post = null;
//if (product.Targeting != null) {
dynamic parameters = new ExpandoObject();
parameters.source = new FacebookMediaObject {
ContentType = "image/" + product.Extension,
FileName = path + filename
}.SetValue(File.ReadAllBytes(path + filename));
parameters.message = diplaymessage;
if (product.DateScheduled < DateTime.Now) {
parameters.scheduled_publish_time = Facebook.DateTimeConvertor.ToUnixTime(DateTime.Now.AddMinutes(15));
} else {
parameters.scheduled_publish_time = Facebook.DateTimeConvertor.ToUnixTime(product.DateScheduled);
}
parameters.published = false;
try {
post = pageclient.Post("/" + account.id + "/photos", parameters);
} catch (Exception ex) {
//error
}
}
}
}
是否有需要傳遞額外的參數,使之「公」,甚至通過Facebook查看照片的權限時,雖然他們似乎都公開?