This issue is too large to document properly here, but @sjl1826 and I have discussed multiple facets of this in length at various meetings and we have notes that we will put here eventually.
Some of the things we discussed -
A singleton implementation to globalize user state (stored in a struct UserModel) through a UserManager class - that handles asynchronous network calls using the Protocol-Delegate method.
Persistent login techniques using the access & refresh tokens.
On app launch - attempt to login using cached (in UserDefaults) refresh token.
If signing up/logging back in, use the flow we discussed.
Storage of all data (except accessToken) in UserDefaults to enable offline viewing of the app.
Difference between a "failed login" and an "offline". - failed login should log out the user but an "offline" should allow the user to view the app in a "view only" mode - i.e. all API requests should fail with appropriate error messages that the UI code will then promise to handle.
This issue will be continuously updated as I get time to put more details down.
@sjl1826 I would love to have this completed by Sunday, November 18. Please plan to finish it by then.
This issue is too large to document properly here, but @sjl1826 and I have discussed multiple facets of this in length at various meetings and we have notes that we will put here eventually.
Some of the things we discussed -
UserModel
) through aUserManager
class - that handles asynchronous network calls using the Protocol-Delegate method.This issue will be continuously updated as I get time to put more details down.
@sjl1826 I would love to have this completed by Sunday, November 18. Please plan to finish it by then.