wmcmahan / react-native-calendar-events

📆 React Native Module for iOS and Android Calendar Events
MIT License
906 stars 292 forks source link

Add Android read only option #320

Closed mikehardy closed 4 years ago

mikehardy commented 4 years ago

Hi there!

This adds the ability to specify a "readOnly" parameter for checkPermission / requestPermission for Android so that the WRITE_CALENDAR permission may be dropped from AndroidManifest.xml if a project desires

All behavior is intended to be backwards-compatible, including the SharedPreferences key used for permission check status

Documentation, example app, types, and even CHANGELOG updated

This seemed to work fine in my testing on the included example app before I altered it (as a backwards-compatibility check), and after I altered it with the new read-only block for android devices (as a test of new functionality)

I've been using the module like this in my project for more than a year, and I'll integrate this branch as well, for further testing

Let me know what you think! Cheers

Fixes #318

mikehardy commented 4 years ago

Confirmed working in my project as-is with 'WRITE_CALENDAR' removed from AndroidManifest.xml as described in my docs change, and a simple addition of 'true' to the permission check (I use react-native-permissions to actually request permissions)

MoOx commented 4 years ago

2.1.0 is out :)

mikehardy commented 4 years ago

Thanks for merging that so quickly @MoOx ! If you see any regressions or anything come in related to it please don't hesitate to directly @ tag me to make sure I see so I can address it. Cheers