inProgress-team / react-native-meteor

Meteor Reactivity for your React Native application :)
MIT License
693 stars 210 forks source link

subscription updates when app is in background #256

Open ujwal-setlur opened 7 years ago

ujwal-setlur commented 7 years ago

Does react-native-meteor work with maintaining a subscription when the app moves to the background? In my case, subscription seems to get refreshed only when app comes back into foreground.

lishine commented 7 years ago

Asking similar question Can data be refreshed in a background timer, sort of waking up the app in the background ?

redwind commented 7 years ago

As i know, device will kill app after period of time. So when app back from background or open, we should call sync method to update last changed data.

joaopiopedreira commented 6 years ago

How about react-native-background-task? All you have to do is to ensure connection to Meteor (Meteor.reconnect()) and execute your background data sync. Didn't test it, but it should work.

Diwei-Chen commented 6 years ago

@joaopiopedreira Sorry, may be a naive question - how can we reconnect to Meteor server while it is disconnected?