I have built a Calendar application that has the ability to import Google Calendar events. On certain occasions, the event's are returned perfectly. However, some events do not return at all. I cannot narrow down the reason for what might be causing these issues.
Sometimes it's on certain Google 'calendars' and I thought it may be due to security prevention on these particular calendars but I can not find a way to bypass these issues.
This is my code:
var credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
new ClientSecrets
{
ClientId = "id",
ClientSecret = "secret",
},
new[] { CalendarService.Scope.Calendar },
accountEmail,
CancellationToken.None).Result;
var service = new CalendarService(new BaseClientService.Initializer
{
HttpClientInitializer = credential,
ApplicationName = "appname",
});
EventsResource.ListRequest request = service.Events.List(calendarid);
Events events = request.Execute();
foreach (var eventItem in events.Items)
{
Console.WriteLine(eventItem.Summary);
}
It won't import all this data from a calendar called 'Supplier confirmed dates'
But it will import the data from this calendar called 'Trade's diary'
But with another calendar, it will import some events and not others which is why I am confused.
Any suggestions will be welcomed, please.
won't import all this data
it looks like there might be more than 250 events present and thus, not all of them will be retrievedmaxResults
to a higher value - up to 2500pageToken
to the value of nextPageToken
you obtained in the response of your first query