Closed CDrosos closed 6 years ago
I had the same issue when i was starting out but how to got around this i had to analyze the Xamarin Evolve 2016 app. They use this same plugin, https://github.com/xamarinhq/app-conference/blob/master/src/Conference.Clients.Portable/Services/ReminderService.cs
I would recommend taking a look at the link above. Let me know if it helped.
Hi! Thanks for your interest and to @AnthonyLatty for the response. The Evolve 2016 app is a great example of a "real world" usage. I would also point out the Calendars Tester app at https://github.com/TheAlmightyBob/CalendarsTester , which is a Xamarin Forms app that simply exposes most of the things you can do with this. The unit tests in this library may also be informative.
(I also have another app on GitHub that uses it but it's very old...)
Generally I consider the interface comments on https://github.com/TheAlmightyBob/Calendars/blob/master/Calendars/Calendars.Plugin.Abstractions/ICalendars.cs to be the "documentation," however as I look at that now it occurs to me that it omits one key detail that may be relevant to you: If successful, the AddCalendar/Event APIs will update the ExternalID property on the calendar/event you passed in so that you can use that to find/update the event later.
Thoug a small snippet to add an event to a calendar or remove one or list the available calendars could help out. I was looking for this too and found the calendarstester but there is also no small readme.md so you have to navigate through the code and search.
edit: I think that I am starting to get it.
var cals = await CrossCalendars.Current.GetCalendarsAsync();
await CrossCalendars.Current.AddOrUpdateEventAsync(cals[0], new CalendarEvent() { Name = "test" });
So you list the available calendars and add a calendarevent to it. But reminders are also attached to the calendar and not directly to the event?
I also have an other noob question: why is there a current property in CrossCalendars
? Since it's the only option, perhaps it would be easier to have CrossCalendars.AddOrUpdateEventAsync
?
I have probably missed something. I have just installed the latest beta (0.6.45 beta) nuget in my Xamarin Forms application...
Could not load file or assembly 'Plugin.Calendars, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
You've got the idea.
I think you might have misread the reminder API. It takes an event, not a calendar.
The Current
property is a standard pattern of Xamarin Plugins and is related to the cross-platform support. That's where the portable code resolves to the platform-specific implementation.
Thank you, I see that the geolocation plugin also has this pattern. About the reminder, is that perhaps due to the external api's? that the reminder is not a property of the event?
It is due to the external APIs as well as the fact that the ability to add reminders was quickly added to support a requirement of the Evolve app and has not been fully completed. There is still an open issue on that.
Just a quick update that reminders are now a property of the event.
I added a basic sample to the readme. Contributions are welcome if others have more ideas of what would be helpful.
Do we have a quick documentation on how to do basic stuff? i have try to check to code to figure it out but i can't understand it. I just want to be able to add events and to view those events later Thanks bro