What does ensureInitialized actually do? And when should I use it? #7486
Unanswered
KirillRodichevUtorg
asked this question in
Q&A
Replies: 1 comment
-
I'm wrapping my head around how to better load remote config and these are the same questions I have. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi FB team!
I wonder what does
ensureInitialized
actually stands for?In the docs it says
So I understand that it will be resolved as soon as activation is passed (In my code as soon as
fetchAndActivate
resolves I guess)My remote config initialization looks like this
My read functions look like this
Question 1:
I don't understand why when I try to read a value before
fetchAndActivate
resolves, it simply reads empty strings.It's strange because I use
setDefaults
for every value. And I expectgetSomeValue
to at least return a value from the defaults.Question 2:
I see that in Android code
ensureInitialized
seems to await forfetchAndActivate
However for iOS I don't find similar implementation. Do
ensureInitialized
behave the same on both platforms?Beta Was this translation helpful? Give feedback.
All reactions