firebase-kotlin-sdk icon indicating copy to clipboard operation
firebase-kotlin-sdk copied to clipboard

RemoteConfig - setDefaults. Does it need to be "suspend" or am I doing this wrong?

Open Monabr opened this issue 1 year ago • 1 comments
trafficstars

Hello.

In an Android project I got a RemoteConfig in classes using DI. In it I configured the RemoteConfig in the module specifying the update period and default values.

I did the same using your library. During the migration I found that the setDefaults function has now become a suspend function. At first this puzzled me a lot because functions in the DI module cannot be suspend. I solved this situation by using runBlocking.

Despite my decision to use runBlocking I still doubt this method.

  • Did I configure it correctly? Maybe I should configure it differently?
  • Will runBlocking greatly affect the application startup time?
  • Should setDefaults definitely be suspend?
  • Is it possible to do setDefaults differently without affecting the application startup time?

Monabr avatar Sep 28 '24 23:09 Monabr