Hello! I'm just getting started with Growthbook, u...
# ask-questions
c
Hello! I'm just getting started with Growthbook, using the react-native sdk. I'm using streaming and noticed that when app comes to foreground after some time in background, the flag updates which happened during background, are not received, getting stuck in an old value. Do I need to call again
init
or call
refreshFeatures
to "reactivate" the streaming? Thanks!
s
Yes, it's possible that the feature won't updated automatically when coming to the foreground. It's recommended to run
refreshFeatures
in that case.
c
@strong-mouse-55694 thanks so much for your answer. I've a follow-up question. It might be gap of knowledge on my side, but I understand the streaming connection can be killed by the OS if app is in background for a while. When coming back to foreground I can indeed
refreshFeatures
and I will get up-to-date values. But the streaming connection, I'm not sure that it's recovered. This is handled for browser though, by disabling and enabling the connection channel (listeners on
visibilitychange
event). Wondering if this is actually an issue, and if so, how to solve it.
s
I believe when you call
refreshFeatures
it should also reestablish the streaming connection—but I haven't spent a lot of time with the React Native SDK. It might also be helpful to ask in #C07DHBKUXDH to see if anyone else has more experience.