Hasan Nagizade

    Hasan Nagizade

    4 months ago
    I want to use this library to replace SharedPreferences in Multiplatform project. I want to store token from Firebase. Firebase needs you to create a service in Android side which you can’t put in commonMain. How can I access Settings from a service in androidApp?https://github.com/russhwolf/multiplatform-settings
    russhwolf

    russhwolf

    4 months ago
    You could add the library to your app-level dependencies if you want to talk to the
    Settings
    interface from there. Or you could just talk to
    SharedPreferences
    , and if you use the same
    SharedPreferences
    instance to create your
    AndroidSettings
    then the data in them will be the same.
    Hasan Nagizade

    Hasan Nagizade

    4 months ago
    by same instance do you mean shared preferences with same key? and thank you very much for amazing library 🙂
    russhwolf

    russhwolf

    4 months ago
    I mean if you have a
    val preferences: SharedPreferences
    and do
    val settings = AndroidSettings(preferences)
    , then
    preferences.getString("key", "default")
    will be the same as
    settings.getString("key", "default")
    Hasan Nagizade

    Hasan Nagizade

    4 months ago
    @russhwolf I use no arg version of the library in commonModule will this make a difference?
    russhwolf

    russhwolf

    4 months ago
    If you’re using no-arg then it’s the equivalent of
    PreferenceManager.getDefaultSharedPreferences(context)
    Hasan Nagizade

    Hasan Nagizade

    4 months ago
    thank you very much again @russhwolf