I have an app where user logs in and use several features. In the meantime, he can adjust some settings in a relevant screen (receive push notifications, post to facebook, post to twitter).
I am wondering where to save these parameters in order to stick with the logged in user, so that when another user log in, he can get his own relevant settings configured. And so on.
If I store that values to localStorage, they will be related always to the LAST logged in user, which is not a convenient way.
So shall I store that kind of data in my backend tables? (I am using parse BTW) and retrieve them each time the user log in ? Or there is another way to do so?
Thanks
You can either store those settings in localStorage (or any other persistent storage), but key each setting to the user, or store the settings in the cloud. The latter works well if users might expect their settings to follow them to other devices they are using, but you'll need to be very clear you are doing this.
As for keeping the settings local, why not this?
localStorage.setItem ( userName, JSON.stringify( { postToTwitter: true, postToFacebook, false, ... } ) );
And later, to retrieve:
var userSettings = JSON.parse(localStorage.getItem ( userName ));
if (userSettings.postToTwitter) { ... }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With