Reality Check
RealityCheck is the main interface for the RealityCheck module.
It is used to get the latest dk.ds.rc.domain.model.RealityCheckMessage object, and to accept the notification displayed by the frontend.
To get RealityCheckMessages, call getRealityCheckMessages and subscribe to the observable it returns.
the method getRealityCheckMessages will return the latest RealityCheckMessage object when the cache is updated.
which only happens when there has gone at least 1 hour since the last update in real active app time or an hour after acceptRealityCheck has been called.
When opening and closing the app, remember to call appDidEnterBackground and appDidEnterForeground respectively.
When the app is in the background, the next RealityCheckMessage call will be stopped until the app enters the foreground again.
acceptRealityCheck is used to accept the notification displayed by the frontend. and will disable updating the cache for an hour.
It also has methods for moving the time forward on the server for testing purposes.
Functions
Call this when the user accepts the RealityCheck notification displayed on the app UI. Check the method for additional information.
Call this when putting the app into the background. Check the method for additional information.
Resumes the RealityCheckMessage call using the time saved from appDidEnterBackground. check the method for additional information.
Returns an observable that can/should be subscribed to, that will return the latest RealityCheckMessage object. Check the method for additional information.
This is used for testing purposes. Check the method for additional information.
Call this method when the user logs in. It will start calling for messages with the pre-defined delay and retry interval. it will also start the internal time controller.
Call this method when the user logs out but haven't shut down the app manually. It will stop calling for messages and stop the internal time controller.