Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using saveEventually() instead of save() or saveInBackground() for ParseUser or ParseObject

Looking at Parse documentation, there is a saveEventually() method that can be used in place of save() and saveInBackground().

Can I use this function everywhere in my code in place of save and saveInBackground so I don't have to worry about the user switching between being offline and online and I won't have to handle saving in situations where there is no connectivity? Are there any drawbacks to using this approach?

like image 996
Vaibhav Aggarwal Avatar asked Jul 05 '14 05:07

Vaibhav Aggarwal


1 Answers

According to Parse's iOS guide:

Most save functions execute immediately, and inform your app when the save is complete. If you don't need to know when the save has finished, you can use saveEventually instead. The advantage is that if the user currently doesn't have a network connection, saveEventually will store the update on the device until a network connection is re-established. If your app is closed before the connection is back, Parse will try again the next time the app is opened.

So you will use save if you need the callback when the save has finished. I think you can use both depending on the situation you are handling.

like image 192
Enrico Susatyo Avatar answered Oct 06 '22 18:10

Enrico Susatyo