Using Meteor Offline

I would like to know if Meteor can work with my use case.

I have a mobile application that will be available on the App Store. This app contains a little research that users will answer without an internet connection. Then the user will close the application. Then I want to transfer data to the server when the application is online.

Now that the application remains open, data is transferred when the application becomes online. However, when the application is closed and reopened, the data that was entered into the application is lost.

I tried GroundDB but I was not able to get it to work to meet my needs.

Can Meteor work with my use case (with or without a package)? Do you have any examples or suggestions?

thanks

+6
source share
1 answer

You should be able to make this work by storing session data between sessions in a localSession object. You can simply use the amplify package to do this for you.

Just remember to save the data from the survey in the gain, for example, as follows:

 amplify.store("survey_data", data); 

When launched on the client, you can check if this data exists:

 if (amplify.store("survey_data") { .. } 

and then upload it to the server using the method or paste it into the collection.

Please note that this will not happen in the background, but it should work if the user opens the application again.

+2
source

Source: https://habr.com/ru/post/986148/


All Articles