简体   繁体   English

在C#Facebook SDK中使用no_story

[英]Using no_story with C# Facebook SDK

I'm trying to use no_story=1 to avoid posting in the user wall when an album has been created. 我正在尝试使用no_story = 1来避免在创建相册后在用户墙上发帖。

But I don't know where to pass such parameter, I've used: 但是我不知道在哪里传递这样的参数,我用过:

var fb = new FacebookWebClient(_accessToken);
Dictionary<string, object> album = new Dictionary<string, object>();
System.Random rnd = new Random();
string name = "MyAlbum" + rnd.Next(150).ToString();
album.Add("name", name);
**album.Add("no_story", 1);**
album.Add("location", "MyLocation");
album.Add("privacy", "{\"value\": \"CUSTOM\", \"friends\": \"SELF\"}");
dynamic aid = fb.Post("/me/albums", album);

and also used: 并用于:

dynamic aid = fb.Post("/me/albums?no_story=1", album);

Neither way is working, I still see when the album has been created in my wall. 两种方法均无效,我仍然可以看到在墙上创建了相册的时间。

Any help is appreciated. 任何帮助表示赞赏。

Thanks. 谢谢。

Your code is correct in the sense that you are adding the parameter the right way. 从正确的方式添加参数的意义上,您的代码是正确的。 However, this is not a valid parameter when creating an album so Facebook's Graph API is simply ignoring it. 但是,这在创建相册时不是有效的参数,因此Facebook的Graph API只是忽略了它。 You can see the docs here: https://developers.facebook.com/docs/reference/api/album/ 您可以在此处查看文档: https : //developers.facebook.com/docs/reference/api/album/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM