6
我将Firebase集成到我的Android项目中,为不同的应用程序用户获取不同的参数值。 我做了以下内容:在我的火力地堡项目 Firebase远程配置条件由userId
- 设置用户相匹配的用户:的UID是AAAAAAA ...,并BBBBBBB ...因此。
- 创建在远程配置部分中的参数:
- 此参数添加条件:和设定值的条件:
进入下面的代码从所述应用在用户登入:
Task resultTask = firebaseAuth.signInWithEmailAndPassword("[email protected]", password);
- 确保登录成功。
- 然后我试图获取远程配置参数:
firebaseRemoteConfig.fetch() .addOnCompleteListener(new OnCompleteListener() { @Override public void onComplete(@NonNull Task task) { if (task.isSuccessful()) { // Once the config is successfully fetched it must be activated before newly fetched // values are returned. firebaseRemoteConfig.activateFetched(); Log.d(TAG, firebaseRemoteConfig.getString("MyParameter")); } else { Log.d(TAG, "fetch firebase remote config failed. Reason = " + task.getException()); } } });
的结果是,我总是得到默认值:默认值
我做了什么错?我错过了什么?
用户是否必须登录进行分析以识别其唯一ID? –
@IgorGanapolsky:是的,需要登录,因此Firebase会记录唯一ID。 – noti