嘿,伙计们,我遇到了一个firebase远程配置的问题,基本上我模糊的部分有一个json数组,看起来像这样:
[
{
"owner": "1",
"platform": "android"
},
{
"owner": "2",
"platform": "ios"
}
]然后在java的"onCreate“方法中,我使用了下面的代码:
mFirebaseRemoteConfig = FirebaseRemoteConfig.getInstance();
configSettings = new FirebaseRemoteConfigSettings.Builder()
.setMinimumFetchIntervalInSeconds(3600)
.build();
mFirebaseRemoteConfig.setConfigSettingsAsync(configSettings);当我尝试用下面的代码获取字符串形式的值时:
String object = FirebaseRemoteConfig.getInstance().getString("mobile_database");
如果我进入调试模式,它会显示object = "“这只是一个空字符串,有什么地方我做错了吗?
我试着做研究,但是找不到任何有用的东西?
提前感谢:)
PS (在有人将其标记为重复之前,这些链接对我没有帮助:D
Is there a way to create an audience of developer builds?
getString Outside of a Context or Activity
FirebaseRemoteConfig getString returns empty but bytearray of remote config is not empty)
发布于 2021-02-05 00:36:43
您没有调用fetch方法,因此如果您设置了本地配置,则RemoteConfig将回退到您的本地配置。参见how to fetch and activate values。
https://stackoverflow.com/questions/66048441
复制相似问题