Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
When I call eventStore.RequestAccessAsync it's always returning true, even if the user hasn't granted access, so I need to check if "eventStore.DefaultCalendarForNewEvents" is different than null.
If I call eventStore.RequestAccess, the callback returns correctly.
var response = await eventStore.RequestAccessAsync(EKEntityType.Event);
bool granted = response.Item1;
if (granted && eventStore.DefaultCalendarForNewEvents != null)
EKEvent newEvent = EKEvent.FromStore(eventStore);
newEvent.StartDate = date.DateTimeToNSDate();
newEvent.EndDate = date.AddMinutes(30).DateTimeToNSDate();
newEvent.Title = title;
newEvent.Notes = description;
newEvent.Calendar = eventStore.DefaultCalendarForNewEvents;
eventStore.SaveEvent(newEvent, EKSpan.ThisEvent, out error);
if (error == null)
Setting to confirmed as I can reproduce this issue, but I wonder whether using the async method is necessary. Since the "non-async" version pops up an alert it seems it is necessarily asynchronous, which is reinforced by this note in the docs for using EventKit here:
In that section it says specifically: "Because it raises an alert view, the call is asynchronous, and will call a completion handler passed as an NSAction (or Lambda) to it..."
So my suggestion would be to just use the RequestAccess call rather than RequestAccessAsync.
In any case, I am attaching a test project based on our Calendars sample with the async call being used instead.
## Steps to reproduce:
1. Open the attached project and launch it to an iSO device or simulator.
2. Tap "Calendars" at the top of the list.
3. In the alert asking for permission click "Don't Allow"
Expected result: Alert will show up with message "Returned Value - False"
Actual result: Alert shows up with message "Returned Value - True"
I tested with XI version 22.214.171.124
So it would seem that this is not a regression as the bug reporter claims they hit this on version 8.10
=== Xamarin Studio ===
Version 5.10 (build 704)
Installation UUID: 964c531b-d928-456b-a9ae-e1f82266b360
Mono 4.2.0 (explicit/2701b19)
GTK+ 2.24.23 (Raleigh theme)
Package version: 402000207
=== Xamarin.Profiler ===
=== Apple Developer Tools ===
Xcode 6.4 (7720)
=== Xamarin.Mac ===
Version: 126.96.36.199 (Business Edition)
=== Xamarin.Android ===
Version: 188.8.131.523 (Business Edition)
Android SDK: /Users/apple/Library/Developer/Xamarin/android-sdk-mac_x86
Supported Android versions:
4.0.3 (API level 15)
4.1 (API level 16)
4.2 (API level 17)
4.3 (API level 18)
4.4 (API level 19)
5.0 (API level 21)
5.1 (API level 22)
SDK Tools Version: 24.3.4
SDK Platform Tools Version: 23
SDK Build Tools Version: 23
Java SDK: /usr
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)
=== Xamarin Android Player ===
Location: /Applications/Xamarin Android Player.app
=== Xamarin.iOS ===
Version: 184.108.40.206 (Business Edition)
Build date: 2015-08-31 15:32:33-0400
=== Build Information ===
Release ID: 510000704
Git revision: c16e63aeeaa63ea912638f958ae1547905aed4e5
Build date: 2015-08-31 15:47:00-04
Xamarin addins: a7a74af8bcc6bca9a02f34afb66025c0a3fa18cb
Build lane: monodevelop-lion-master
=== Operating System ===
Mac OS X 10.10.5
Darwin Jons-iMac.local 14.5.0 Darwin Kernel Version 14.5.0
Wed Jul 29 02:26:53 PDT 2015
Created attachment 12746 [details]
The issue is that the generated async code is checking for an NSError (not just the `bool`) and, in this case, no error is returned. Thanks for the sample.