Using Local Storage on Mobile... Anyone succeeded with this?

Has anyone been able to get local storage working in the Mobile Beta?

Users with a patchy signal are not getting the Offline warning, so the app is trying to work as normal, but taking 5 minutes to save data. I couldn’t conditionally rely on saving locally if the user is offline (as they are not). So, I thought the best approach would be to always save locally and then try every x minutes to save the local data to the Bubble Server. If the save is successful, delete the local data. If not, try again later.

I found this thread with no solutions up to May…

1 Like

I’m using the local storage plugin to save the data offline, but it has limitations. I’m creating a JSON object to save a list of things in a single text. I’m using split by, extract with regex and find & replace to access the data I saved. I have a synchronize button to activate a backend workflow that saves everything in the database.

1 Like

Thank you, @geovanevasconcelos2. Your detailed steps are really helpful :folded_hands:

Does the LocalStorage plugin work when AirPlane mode is on (i.e. zero signal, rather than low signal)?

Is your synchronize button invisible/“not interactive” when the Connection is Offline or does Bubble handle the saving Workflow whenever it starts working again? I assume that sending a single JSON string to the backend works OK even with a weak signal.

Images

Are you uploading images? Chatting with our Users, the Picture Uploader is causing the greatest issues due to a weak mobile signal. It can take 5 minutes to upload an image. If so, have you been able to get this working with the Local Storage plugin?

I was thinking that if I could locally convert the image to a base64 type, and then convert it back to an image on the server that may work with Local Storage. Alternatively, I don’t know if a link to the local version of an image can be stored in the JSON until the file can be uploaded. It looks like with no signal, I cannot get the picture uploader or Camera to open at all (the WorkFlow step to open the library does not run without signal). I guess we may need a new plugin to access the picture library locally (if that is possible :thinking:)

The plugin works offline. In my case, I use it only when users are really offline. The sync button is only available when the user is online again. I use the button action to sync, but you can also use the “do when this condition is true” and use the “connection is offline” condition.
I haven’t tested syncing with a weak signal yet, but it’s only sending a text to a backend workflow.

I haven’t tried using images yet, but I’m not sure if it’s possible to save the base64 image offline. Let me know if you are able to do it

We have built one that works as expected, even when they’re offline.

If it helps we can add an online/offline trigger to this plugin and trigger a seperate event for it.

Link: Local Storage (React Native) Plugin | Bubble

1 Like

This is the one I’m using

1 Like

Hi @nocodeventure

Thanks for following the thread. I haven’t used your plugin yet, but if a trigger can be set up after an offline storage event has occurred and when the user is next back online, that would be helpful. This could save the need for the user to manually trigger the upload or to use polling to check if any unsynchronised data has been stored :+1:

Does your plugin allow access to the picture library when the user is Offline? For my users, uploading pictures of work carried out is a core function, so having a locally stored version of pictures along with the JSON text would be of great benefit to us.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.