zdravim,
nemozem sa vysomarit z googloveho API. Chcem pridavat udalosti do cudzich kalendarov (mam jeho email adresu). Nejak som to spravil, ale vzdy mi prida len do mojho kalendara. Mam takyto nejaky kod:
ClientSecrets client_secret = new ClientSecrets();
client_secret.ClientId = "XXXX.apps.googleusercontent.com";
client_secret.ClientSecret = "YYYY";
UserCredential credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
client_secret,
Scopes,
user, // tu je email adresa uzivatela, ktoremu cjhcem zapisovat do kalendara
CancellationToken.None).Result;
UserCredential credential = autorizuj(user);
var service = new CalendarService(new BaseClientService.Initializer()
{
HttpClientInitializer = credential,
ApplicationName = ApplicationName,
});
Event ev = new Event();
EventDateTime evstart = new EventDateTime();
evstart.DateTime = start;
EventDateTime evend = new EventDateTime();
evend.DateTime = end;
ev.Summary = nadpis;
ev.Description = popis;
ev.Start = evstart;
ev.End = evend;
ev = service.Events.Insert(ev, "primary").Execute();
Kde robim chybu? Da sa to vobec zapisovat do cudzieho kalendara?