gpt4 book ai didi

Android:是否可以在后台服务中使用 Firebase Remote Config?

转载 作者:搜寻专家 更新时间:2023-11-01 07:45:56 26 4
gpt4 key购买 nike

我想在后台服务(用于显示通知)中使用 Firebase Remote Config。可以这样做吗?

更准确地说,是否可以在后台服务中获取远程值?

// Code below in a background service ?
mFirebaseRemoteConfig.fetch(cacheExpiration).addOnCompleteListener(this, new OnCompleteListener<Void>() {

@Override
public void onComplete(@NonNull Task<Void> task) {
// get remote values here

}
}

谢谢!!!

最佳答案

回答我自己的问题!是的,有可能,只需删除 addOnCompleteListener 中的“this”即可。它给出:

mFirebaseRemoteConfig.fetch(cacheExpiration).addOnCompleteListener(new OnCompleteListener<Void>() {

@Override
public void onComplete(@NonNull Task<Void> task) {
// get remote values here

}
}

似乎在后台服务中完美运行。

关于Android:是否可以在后台服务中使用 Firebase Remote Config?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44281103/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com