如何通过google api在google plus上发布媒体?

时间:2015-04-09 12:45:50

标签: c# asp.net post google-plus

private void googleplue()
{
    Moment body = new Moment();
    ItemScope itemScope = new ItemScope();

    itemScope.Id = "replacewithuniqueforaddtarget";
    itemScope.Image = "http://www.google.com/s2/static/images/GoogleyEyes.png";
    itemScope.Type = "";
    itemScope.Description = "The description for the action";
    itemScope.Name = "An example of add activity";

    body.Object = itemScope;
    body.Type = "http://schema.org/AddAction";

    MomentsResource.InsertRequest insert =
        new MomentsResource.InsertRequest(
            plusService,
            body,
            userId,
            MomentsResource.Collection.Vault);
   // Moment wrote = insert.Fetch();
}

我试过这个但不行,请给我任何其他解决方案。

1 个答案:

答案 0 :(得分:1)

时刻与发布到Google+时间轴不同,无法发布到Google+时间轴。见Issue 41: Write access to the streams

为了发布不同的时刻,您需要能够将request_visible_actions设置为身份验证过程的一部分,并且它似乎与当前版本无关C#客户端库see

如果您想发布片刻而不是写入用户时间线,那么您必须弄清楚如何在身份验证过程中发送request_visible_actions。如果你确实想弄明白该怎么做,请在我的问题上发表答案。

相关问题