Skip to content
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

Unable to save calendar event in Android. #415

Open
tushar-patil-android opened this issue Aug 19, 2022 · 3 comments
Open

Unable to save calendar event in Android. #415

tushar-patil-android opened this issue Aug 19, 2022 · 3 comments

Comments

@tushar-patil-android
Copy link

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.

@mertcaliskanyurek
Copy link

mertcaliskanyurek commented Sep 14, 2022

Any update?

@kanyo33
Copy link

kanyo33 commented Oct 22, 2022

  1. RNCalendarEvents.requestPermissions()

@Udbhav9628
Copy link

Udbhav9628 commented Nov 30, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants