react-native-calendar-events
react-native-calendar-events copied to clipboard
Unable to save calendar event in Android.
Trying to save calendar event in android device but getting below error -
Error: You don't have permissions to retrieve an event to the users calendar.
I already allowed all required permission.
Library version using: react-native-calendar-events: 2.2.0
Application also crashing on
RNCalendarEvents.findCalendars();
RNCalendarEvents.saveCalendar(calendar);
Please help me with this.
Any update?
- RNCalendarEvents.requestPermissions()
Any update?
I think package's developer do not care, so instead waiting for their reply what i did was this
const is_Calender_Permission_Granted = await PermissionsAndroid.check('android.permission.WRITE_CALENDAR'); if (!is_Calender_Permission_Granted) { const granted = await PermissionsAndroid.request( PermissionsAndroid.PERMISSIONS.WRITE_CALENDAR, { title: "ClashHub Needs Calender Permission", message: "So We can Notify you before the Match", buttonNegative: "Cancel", buttonPositive: "OK" } );
i took Permission to write to calendar via this https://reactnative.dev/docs/permissionsandroid .
and dont forget to
const TakePermission = await RNCalendarEvents.requestPermissions((true));
before calling RNCalendarEvents.saveEvent function
i don't know why but it will not work without this
Hope It Helps, Happy Coading.