-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to set location, add reminder, and set android calendar to sync. #9
Ability to set location, add reminder, and set android calendar to sync. #9
Conversation
|
Hey there! Blarg, that shouldn't have gotten added. Let me delete and add So what I have found is that when creating a new calendar it is created
|
Alright, now we are looking better :) only +20 lines of change seems more like it :) Yeah, so reading through the docs and testing on Android if you don't set it to true then it wont get synced to the device, i have verified that I have to manually add the calendar. SYNC_EVENTS A boolean indicating whether the calendar should be synced and have its events stored on the device. A value of 0 says do not sync this calendar or store its events on the device. A value of 1 says sync events for this calendar and store its events on the device. http://developer.android.com/guide/topics/providers/calendar-provider.html |
Ability to add a reminder to an existing event specified minutes ahead of time
Just added the ability to set a reminder on a event. Let me know what you think. |
Also, can you email me james@xamarin.com, just want to make sure you have everything you need to build and distribute and such. |
Thanks for updating the ignore file. We both read the same documentation on SyncEvents, just interpreted it differently. I trust that your interpretation is correct since your tests back it up, although I don't understand why my tests were passing if it's necessary... makes me wonder if the tests are somehow flawed... Excited to see reminder support! But questions:
|
Yeah, SyncEvents is a super tricky one and they do get added correctly, but in the calendar app (probably different per device and app) it needs to be marked as Sync from what I have read and tested. We can always change too if it isn't. Let's see if I can go through the Qs 2.) This is true, I was figuring just a comment in there would be good. I can add it in. 3.) Reading the docs it seems just fine: https://developer.apple.com/library/ios/documentation/EventKit/Reference/EKAlarmClassRef/#//apple_ref/occ/clm/EKAlarm/alarmWithRelativeOffset: This is the same with Android though the UI only presents simple options, which makes sense from a UX stand point. |
I'm definitely glad you didn't go with the additional parameters route. My concern is mainly that I feel like making the alarms a property of CalendarEvent is the better long-term solution, supporting retrieving/editing, and I was thinking about the transition from this version to that one... but I guess it's not a big deal. I do agree that if you're not going to implement retrieval now, having it as a property would be misleading, so the separate method seems reasonable. However: iOS also supports multiple reminders (EKEvent has an array of Alarms..). And if I'm reading this right, AddReminder will update any existing reminder on Windows, but just keep adding new reminders on Android/iOS? Hm.. Good point re: 3. I quickly tried that on Android and saw that the custom time was just added to the list of options in the Google calendar app. That's good, I was worried there was more of a difference between platforms on this. |
/// <param name="calendarEvent">Event to add</param> | ||
/// <param name="reminder">Reminder to add</param> | ||
/// <returns>If successful</returns> | ||
/// <exception cref="ArgumentException">If calendar event is not create or note valid</exception> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typos... "If calendar event is not create or note valid"...
Also "Event to add" (probably should be something like "Event to add the reminder to")
Fix the comments up. Ahhh yes, you are correct actually that both iOS and Android have a List of Alarms, so that is pretty great :) So I was thinking of just updating the Windows documentation for the plugin that there can only be one alarm on an event, so the current would just be updated. Here are the docs: https://msdn.microsoft.com/en-us/library/windows/apps/windows.applicationmodel.appointments.appointment |
I also have it as Minutes for the reminder.. could change that to seconds too, not sure what you think, or maybe even a TimeSpan? |
I think TimeSpan would be great. Updating the docs is probably fine, as long as the difference is addressed somehow. |
First check if iCloud is enabled and create calendar there, else set to local
Can you speak more to the color exception? When were you seeing an exception? Was this related to having iCloud enabled? |
Oh sure, well in this case I was connected to a phone and inserting it into the default calendar. In that instance the calendar color is simply null, so that would throw an exception. I just added a null check. |
I should note, this is when you pass in null as the color to set on the new calendar you are creating. If you pass in any valid color then it is not null and is set correctly. |
"inserting it into the default calendar" Maybe a terminology mixup here. This is the calendar creation logic... I assume you mean creating a calendar using the default calendar's source? Strange that would affect whether a color was returned. (I have no problem with the change, just trying to understand the scenario that required it) |
Yeah, how you phrases it is what I meant. I am grabbing the default
|
Attempt to get the iCloud first, else grab local. Only iCloud and Local can insert new calendars
Just ran some testsI think now finally iOS is good :) |
Ability to set location, add reminder, and set android calendar to sync. Also fixes #10 by creating iCloud calendars instead of local calendars if iCloud is enabled.
Thanks! |
No description provided.