Closed tatva-hiral closed 3 years ago
Did you requested permission first?
Did you requested permission first?
Yes, I did as below :
Installed the latest version of react-native-calendar-events and run react-native link react-native-calendar-events and added permission in AndroidManifest.xml
<uses-permission android:name="android.permission.READ_CALENDAR" />
<uses-permission tools:node="remove" android:name="android.permission.WRITE_CALENDAR" />
And request permission as below :
export const calendarAccessPermission = async () => {
const status = await RNCalendarEvents.checkPermissions(true);
if (status !== "authorized") {
const requestStatus = await RNCalendarEvents.requestPermissions(true);
if (requestStatus === "authorized" || requestStatus === "undetermined") {
return true;
} else {
return false;
}
}else{
return true;
}
};
Please help me to short out this issue. Thanks
Hi,
Without trying if it would solve this, I think you're issue has to do with the use of the readOnly = true
for your checkPermissions and requestPermissions method. Which for Android would only enable you to read calendar data and not to save them. Good luck
Edit:
Also make sure you don't remove the write calendar permission, cos that is what your doing in your first codeblock.
Yeah it seems you are removing write permissions that is required for saving. I will try to make doc clear about that.
Yes, I update below line as :
const requestStatus = await RNCalendarEvents.requestPermissions();
And it's working, Thanks
const requestStatus = await RNCalendarEvents.requestPermissions(); Getting requestStatus is denied.
Environment
System: OS: Windows 10 10.0.18363 CPU: (4) ia32 Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz Memory: 892.17 MB / 7.82 GB Binaries: Node: 10.16.0 - C:\Program Files (x86)\nodejs\node.EXE Yarn: 1.22.5 - C:\Program Files (x86)\Yarn\bin\yarn.CMD npm: 6.9.0 - C:\Program Files (x86)\nodejs\npm.CMD npmPackages: react: 16.12.0 => 16.12.0 react-native: 0.61.5 => 0.61.5 npmGlobalPackages: react-native-cli: 2.0.1 react-native-screens: 2.11.0
Steps to Reproduce