Firebase Remote Config feature for web app (after Firebase expansion)

前端 未结 5 1304
生来不讨喜
生来不讨喜 2021-02-03 23:02

I am building a web application with Firebase and I saw they released their expansion with all great new features. However, the Remote Config section is now only available for A

5条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-03 23:49

    If you are interested in remote config on the web I suggest the following tips: I did this on my web app and it is working perfectly.

    in the firebase database create a config node for example:

    sampleFirebaseDB-c2555
    {
        config : 
        {
        'lang':'EN',
         'color':'blue',    ...
        }
    }
    

    read that from javascript using regular firebase database read

    firebase.database.ref('/config/').once('value').then(function(snap){
    
    });
    

    and store that in an object or locally. and you can access the object proprietes by dot notation in your application

    and to change the config you can make an admin page to change those database objects or to change them in firebase directly

    I hope that helps :D

提交回复
热议问题