小编Pfe*_*aum的帖子

有没有办法覆盖 Firebase 远程配置的区域/国家/地区

我在启动时覆盖 Android 应用程序的区域设置,并允许在运行时更改区域。我像这样设置区域设置:

    Resources res = context.getResources();
    Configuration configuration = res.getConfiguration();
    DisplayMetrics metrics = res.getDisplayMetrics();

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
        configuration.setLocale(locale);
    }else{
        configuration.locale = locale;
    }
    Locale.setDefault(locale);
    res.updateConfiguration(configuration, metrics);
Run Code Online (Sandbox Code Playgroud)

现在我想将 Firebase-Remote-Config 与区域/国家条件一起使用。例如

test_property -> fr_FR = Bonjour 
              -> de_DE = Hallo
              -> default = Hi
Run Code Online (Sandbox Code Playgroud)

如果我现在将我的设备设置为 de_DE 并且将我的应用程序设置为我将从区域( )fr_FR获取。我想要得到的是该地区的test_propertyde_DEHallotest_propertyfr_FR应用程序设置的

我尝试过了FirebaseApp.initializeApp(...)我在更改应用程序中的区域后

有人知道如何以编程方式设置/覆盖该区域,以便 firebase 将该区域用于区域条件吗?

我不想使用 Firebase Analytics User Properties,因为它们更新得太晚了。

android firebase firebase-remote-config

5
推荐指数
1
解决办法
2738
查看次数

标签 统计

android ×1

firebase ×1

firebase-remote-config ×1