I’m building a native mobile app in which the user can select a town and follow its news.
But at this moment, user doesn’t need to log in, as he just want to follow a town.
But how to keep in the app that this unknown user (let say temp user) selected this town ?
The goal is to not force him to log in, and to keep in memory the town he selected.
I haven’t done this with Native Mobile, but on the Web builder, you can have fields on the User type, and even if the user is anonymous / not-logged-in, workflows that save to User will work. A lot of shopping carts built in Bubble work this way. I would add a field of type ‘Town’ on User, and have a workflow that when a Town is selected by the user, a workflow is run of Make Changes to Current User, field ‘Town’, and set the town field to the town selected. Now you can refer to the user’s Town, which will work with page refreshes, page changes, etc.
Another idea would be to write the town to LocalStorage (using a plugin), so it would store it on the User’s browser instead.
Yes, it’s possible. The simplest way is to store the selected town in local storage so it persists on the device. Alternatively, you can create a temporary user record in your database and link the selection to it, which gives you more flexibility if you expand features later.