The ClientStorage external object allows you to store information (pairs of key-values) locally that can be accessed from the client even without connectivity.

You can find the ClientStorage external object in the KB Explorer within the Client module, which is in turn located within the GeneXus module.
It does not have any.
It saves the received value associated with the specified key. If it is applied consecutive times to the same key, its value is the latest assigned.
Notes:
- When generating the app for iOS, this method uses the file system to store the data. Therefore, that data is not persisted if the app is uninstalled and reinstalled.
- When generating the app for Android, the stored data is not persisted if the app is uninstalled, too. The data is kept if a new version is installed over the existing one. This is because it is saved with other local data, like cache, login information or offline database.
Analogous to the Set method, but it persists encrypted data.
Notes:
- When generating the app for iOS, this method uses the OS Keychain to store the data securely. Therefore, that data can persist if the app is uninstalled and reinstalled.
- When generating the app for Android, this method saves the data using the KeyStore on Android, but is stored in the app itself.
Deletes the stored value for the given key. If the key does not exist, the method has no effect.
Gets the stored value for the given key. If the key does not exist, it returns an empty string.
Clears all pairs of key-values stored in the device.
Return value |
None |
Parameters |
None |
It does not have any.
This API is useful, for instance, when the application needs to save some user settings in the device.
Event 'ConfirmHomeGeolocation'
Composite
ClientStorage.Set('HomeGeolocation', &Geolocation)
CustomerPanel()
EndComposite
EndEvent
Event ClientStart
Composite
&Geolocation = ClientStorage.Get('HomeGeolocation')
If not &Geolocation.IsEmpty()
CustomerPanel()
EndIf
EndComposite
EndEvent
- ClientStorage API methods apply to both Online and Offline Smart Devices applications.
- The stored values persist even if the application is closed or the user logs off. (Note that WebSession data type expires when the app is closed.)
- The application stores the information in the device, so you can only use this API in offline procedures and events executed on the device.
- When the developer uses Set and SecureSet methods for the same key, the persisted value it will be associated with the last method invoked.
- Get and Remove methods are shared with both Set methods.