Creatio mobile - local storage

Hi,
I'm adapting my Creatio mobile Freedom UI customizations to work correctly when there is no connection to the server. Is there something like local storage that I could use to save information between app launches?
I was thinking about creating a special "offline cache" object to store this data, and filtering it by the assigned user. However, this feels like a workaround.
Maybe there is already a built-in solution for this, or does Creatio plan to add something like this in the future?
Thank you in advance for your help!

Like 0

Like

3 comments

Hello Eryk,

Yes, we have native support of the offline mode. The offline mode requires an Internet connection only for the first imports and subsequent synchronizations. With this mode, the data is saved on your mobile device. Manually run a synchronization with the Creatio instance server to get the configuration changes and update the data.

You can use the following articles to get more information on how the offline mode works:
https://academy.creatio.com/docs/8.x/mobile/mobile-app-setup/classic-ui/synchronization
https://academy.creatio.com/docs/8.x/mobile/mobile-development/mobile-basics/architecture-mobile/overview-mobile

Have a great day!
 

Hi, thanks for the response.

I may have phrased my question a bit imprecisely - the need I'm describing is fairly specific. I'd like to be able to store some temporary technical information locally on the phone only, scoped to the currently logged-in user. I know I could do this by adding a dedicated object with a relation to the user and fields to hold this kind of data, setting that relation on record save, adding a filter on read, and possibly some security to prevent other users from reading it. But that feels somewhat overengineered, and on top of that, it unnecessarily writes this data to the database. It would be much simpler in this case if the SDK offered something like localStorage, where I could do:

localStorage.setItem('someSetting', { ... })

and later just read it back with:

const settingValue = localStorage.getItem('someSetting');

Hello,

At the moment, the Mobile Creatio Freedom UI SDK does not provide a public localStorage-like API for device-only data. Page attributes exist only within the ViewModel lifecycle, and custom logic runs in an embedded JS runtime rather than a browser, so the standard web localStorage is not available either.
The approach you described (a dedicated object filtered by the current user) is currently the supported way to persist such data. In offline and hybrid mode, records are stored in the local on-device database and transferred to the server only during synchronization, so it works without a connection: https://academy.creatio.com/docs/8.x/mobile/mobile-development/mobile-b…
You are right that the data will eventually reach the server database, and there is no supported way to keep it device-only. A local key-value storage in the mobile SDK is a reasonable suggestion, so please consider posting it in the Ideas section: https://community.creatio.com/?type=idea

Show all comments