dose-amigos / dose-amigos-ionic

Mobile code for Dose Amigos: Don't miss a dose with help from your amigos.
1 stars 4 forks source link

Store Schedule Locally and Schedule Alarms #7

Closed mckoon closed 8 years ago

mckoon commented 8 years ago

For offline support, we need to always store the latest version of a user's schedule locally client-side.

Possibly a tool to use for this: http://ionicframework.com/docs/v2/native/sqlite/

Alternatively, perhaps can write JSON somewhere persistent? Storing the results of the REST call (which is in JSON) as JSON is probably better.

Perhaps this is a solution: https://www.thepolyglotdeveloper.com/2014/06/saving-data-with-ionicframework/

Then we should on a recurring basis schedule alarms for when the user needs to take medication.

Local notifications: http://ionicframework.com/docs/v2/native/local-notifications/

We need to keep a reference to each alarm so we can clear them when the user takes the medicine early, or if a freshly downloaded schedule removes entries already with alarms.

mckoon commented 8 years ago

Should probably use local storage for simplicity: http://cordova.apache.org/docs/en/latest/cordova/storage/storage.html#localstorage

mckoon commented 8 years ago

gets weekly schedule every 5 min and reschedules locally.