Google plus API get the Activities List in C#.ne

2019-08-18 06:27发布

问题:

I'm Using the .net Google Plus API and i want to get the list of activities of a specified profile(page/user..).

I have this code which i get it online

 var provider = new NativeApplicationClient(GoogleAuthenticationServer.Description);
    provider.ClientIdentifier = GoogleIdentifier;
    provider.ClientSecret = GoogleSecret;
 ActivitiesResource.Collection collection = new ActivitiesResource.Collection();
  var service = new PlusService();
    service.Key = GoogleKey;
    ActivitiesResource.ListRequest list = service.Activities.List(ProfileID, collection);
    ActivityFeed activityFeed = list.Fetch();
    int count = activityFeed.Items.Count;

on this line:

ActivityFeed activityFeed = list.Fetch();

I get the following error:

An item with the same key has already been added.

回答1:

The requested keys was invalid. Just Put the right ClientSecret & ClientIdentifier.