Sushi is a framework to keep data always fresh in your mobile application. With a little bit of code in your mobile application and the upload of a generic cloud function in Parse, when every data you are interested in is saved on server, your mobile application can get it.
Goals:
- only interesting data : client filtering
- network friendly : no request if no interesting data on server
- device (battery) friendly : only active when interesting data available
- no server side development
- Create a Parse application
- Copy your appId and clientKey in the properties file
/app/src/main/res/raw/credentials
, like this :
parse.appid=0123456789abcdef
parse.clientkey=0123456789abcdef
The application save object class names to Parse installation object
When an object is saved, a special object is saved on Parse ("SushiUpdates") with the class name of the object. The cloud function send a special push notification to all subscibed mobiles apps. The app wake up when it receive the push notification, and download the new data.
Sushi is a work in progress, and must not be used as is in a production environnement.
The main fix now is to prevent multiple push to a same mobile app for same class of data if it didn’t already query for the data.
Improvements will be :
- Sync point : the client must query new data since last sync
- Continuous query : add parameters to subscription
- iOS support : use push notification to set a flag, that we use to make or not a request in a "background fetch" mode
Sushi is an open idea, and it can support other triggers too. Some ideas :
- Git : on push, use a hook to synchronize data (can be a good CMS candidate)
- Elastic Search : "percolate" capabilities can be interesting to trigger