Tag: firebase remote config

Firebase – 使用userProperty的RemoteConfig返回默认值

首先,我对我的英文表示歉意:-)我正在开发一个大项目,并且在我的Android应用程序中遇到了使用Firebase的问题。 我有使用Analytics(分析)用户属性的条件的RemoteConfig。 当我在应用程序中设置用户属性,获取数据,并成功完成后,我激活提取的数据,即使RemoteConfig条件为true,我仍然从RemoteConfig获取参数的默认值。 代码是用Kotlin编写的。 这是我的代码的一个例子(这段代码是在类的onCreate()方法,它扩展了Appliaction类: FirebaseAnalytics.getInstance(this).setUserProperty(“testprop”, “a”); FirebaseRemoteConfig.getInstance().fetch(0).addOnCompleteListener { if (it.isSuccessful) { FirebaseRemoteConfig.getInstance().activateFetched(); val a = FirebaseRemoteConfig.getInstance().getString(“test_param”); Log.i(“TOAPP”, “Test param is $a”); } else { Log.i(“TOAPP”, “Error: ${it.exception?.localizedMessage}”); it.exception?.printStackTrace(); } } } Firebase中的RemoteConfig: 参数= test_param – MyUser =开发 – 默认值:=生产 条件: MyUser – 如果用户属性testprop完全匹配一个 当我运行这个,我在控制台中得到这个: I / TOAPP:测试参数是生产 我有这些库在gradle.build文件中: // Play services implementation “com.google.android.gms:play-services-location:11.4.2” implementation […]