TheAlmightyBob / Calendars

Cross-platform calendar API plugin for Xamarin and Windows
MIT License
101 stars 23 forks source link

Calendar access denail #61

Closed eminbayrak closed 6 years ago

eminbayrak commented 6 years ago

<uses-permission android:name="android.permission.READ_CALENDAR" /> and <uses-permission android:name="android.permission.WRITE_CALENDAR" /> are placed in AndroidManifest for Android but I am still getting Calendar access permission denail.

I am getting the error soon as program hits this line: var calendars = await CrossCalendars.Current.GetCalendarsAsync();

What am I missing? Please help :(

TheAlmightyBob commented 6 years ago

From the README:

Unlike iOS, permissions will not automatically be requested on Android Marshmallow. Check out the Permissions Plugin for help with this.

https://github.com/jamesmontemagno/Xamarin.Plugins/tree/master/Permissions

(I s'pose it should be updated to say "Marshmallow and above".... Marshmallow was the newest when that was written...)

eminbayrak commented 6 years ago

Thank you ALMIGHTY BOB! I missed that part. CrossPermissions.Current.RequestPermissionsAsync(Permission.Calendar); did the trick!