Open antoinerousseau opened 7 months ago
Can you make a demo, i'm trying solve it. My app crash on both after event create.
i have fixed this by asking permission for android is like below
const writeStatus = await check(PERMISSIONS.ANDROID.WRITE_CALENDAR);
const readStatus = await check(PERMISSIONS.ANDROID.READ_CALENDAR);
if (writeStatus === RESULTS.BLOCKED || readStatus === RESULTS.BLOCKED) {
return RESULTS.BLOCKED;
}
const writeResult = await request(PERMISSIONS.ANDROID.WRITE_CALENDAR);
const readResult = await request(PERMISSIONS.ANDROID.READ_CALENDAR);
if (writeResult === RESULTS.BLOCKED || readResult === RESULTS.BLOCKED) {
return RESULTS.BLOCKED;
}
if (writeResult === RESULTS.GRANTED && readResult === RESULTS.GRANTED) {
return RESULTS.GRANTED;
} else if (
writeResult === RESULTS.DENIED ||
readResult === RESULTS.DENIED
) {
return RESULTS.DENIED;
}
First of all, thanks for this great lib! 💚
I discovered the hard way that:
WRITE_CALENDAR
, it does open the add event activity, but it makes my app crash. I had to addREAD_CALENDAR
to fix it but it defeats the whole idea of not having to ask for READ permission since it does not really need it.CALENDARS_WRITE_ONLY
is an iOS 17+ permission, and must be replaced byCALENDARS
in lower versions. Also,Calendars
is always required insetup_permissions
even for iOS 17, otherwise it crashes after saving an event.The solutions would be to:
react-native-permissions
or document how to do it with the right permissions to ask