doctordick / DoctorDick

A React Native application that empowers gay men to stay on top of their sexual health.
https://www.askdoctordick.com
5 stars 2 forks source link

Add reminders frequency picker #34

Open henryw4k opened 8 years ago

henryw4k commented 8 years ago

TODO:

We've been having a lot of trouble finding a working react-native dropdown picker. We have tried:

All of them has serious problems. Rather than continuing down this rabbit hole, we are going to prioritize getting the core of the reminder's feature working before we come back to add the frequency selector.

henryw4k commented 7 years ago

The react native library that we are using to hook into iOS reminders doesn't support custom frequencies. Right now it supports: daily, weekly, monthly or yearly. See issue: https://github.com/wmcmahan/React-Native-Calendar-Reminders/issues/23

henryw4k commented 7 years ago

One option is to try to extend the library ourselves using Objective C to add this feature. This seems pretty difficult.

kchia commented 7 years ago

How about using a for loop to set up a series of reminders 3 years out (12 reminders in all)

On Saturday, October 8, 2016, Henry Wong notifications@github.com wrote:

One option is to try to extend the library ourselves using Objective C to add this feature. This seems pretty difficult.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/doctordick/DoctorDick/issues/34#issuecomment-252459973, or mute the thread https://github.com/notifications/unsubscribe-auth/AHapMlz2-y0gJfx36VTaGlUsxcDBcZBtks5qyE93gaJpZM4JzEOT .

dsernst commented 7 years ago

Yeah, we thought about that as well.

The downsides is then we'll need to create a bunch of new reminders for the user's app, keep track of all of them, edit & delete them all whenever the user wants to edit (and check to make sure they haven't been manually deleted).

If the user wanted to take them into their own hands and shut off the reminders (say they deleted the Doctor D app), they'd have to go and delete each one.

And then it's hardcoded to this 3 years out end date, which seems pretty arbitrary.

All in all it seems like more of a hack than we really want.


And the native API to set intervals for recurring reminders is not that hard! It's just changing this single line https://github.com/wmcmahan/React-Native-Calendar-Reminders/blob/bfac05c54a56c8f7faf59c3eaf64f3dedb3fba9d/RNCalendarReminders.m#L277 to accept a variable instead of being hardcoded for interval=1.

This seems like the much better solution long term.

So we started to do that. Here's a commit where we started to add this functionality to the native library: https://github.com/doctordick/React-Native-Calendar-Reminders/commit/7e6c8a3c79bee22d3603d0bc136e573d59fc2486 We are blocked right now trying to build the stupid library to get it into our app, but we feel very close.

dsernst commented 7 years ago

FIGURED OUT THE BUILD PROBLEM 👍 💯 🎉 🌮

(react native doesn't let you use npm link https://github.com/facebook/react-native/issues/637)

dsernst commented 7 years ago

The core of this is all done now...........

dsernst commented 7 years ago

Henry has to run out the door to catch the last train, here are the outstanding minor polish pieces:

Make sure to clear out node_modules/react-native-calendar-reminders and re npm install it to pull our custom version with the new extended recurrenceInterval code.

dsernst commented 7 years ago
kchia commented 7 years ago

see #103 as well.