builttoroam / device_calendar

A cross platform plugin for modifying calendars on the user's device
https://pub.dev/packages/device_calendar
BSD 3-Clause "New" or "Revised" License
267 stars 267 forks source link

add new calendar as read only #488

Closed MohamedGawdat closed 1 year ago

MohamedGawdat commented 1 year ago

i would like add new calendar which user cant edit its events information or setting ,, so how can i do it ?

IVLIVS-III commented 1 year ago

As far as I know, this is not possible.

Calendar permissions are handled by the operating system (iOS / Android) and this plugin can only write to calendars that the user can also edit. This, however, is not unique to this plugin, bit rather affects any application that wants to interact with the system calendars.

If you were to create a writable local calendar, then the app and the user can edit events. If you were to create a readonly local calendar, then neither the app nor the user can edit events, which is why the operating system doesn't allow creating local readonly calendars in the first place, since they would be useless.

Your only option to achieve your vision would be to create a remote server that provides a readonly calendar, which the user adds to their system calendars. Then you would have a server api that allows your app to modify the calendar on your server, which then updates the user's readonly calendar on their device. However, for this option the device_calendar plugin would be mostly useless.