function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Hybrid app with offline storage

I'm developing hybrid app with offline functions; without network connection data should be read from local storage.


I believe SmartSync should do this, but does that store data so it will be available even after rebooting the device ?


When starting the application, it tries to connect SF but if network is not available then the error message will be shown. Can this error message be bypassed and continue to application itself, then load data from storage ? Later if modify/create records, in (or before) sync method network connection will be checked and either update local storage or SF.


Is this possible or out of question ?


Smartstore data is available after rebooting the device.  


You can check if the device is offline via the deviceIsOnline method - if that is try you can connect to SF and if its false you can go to your local storage.


Check out the developerforce page for more information:

Hi Juhana,

I am also developing  a hybrid application. I am able to Store data offline as well I am also able to update offline data. When user comes online it will synchronize the data. App works fine but after some time it stop working. After deleting cache app start work again.
In my app I added Salesforce SDK and smart store. Am I missing something ? I posted my question here:

Please help if possible.