我想在後臺服務(我用來顯示通知)中使用Firebase Remote Config。是否有可能做到這一點 ?Android:是否可以在後臺服務中使用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
}
}
謝謝!
就我而言,我試圖在一個不同的進程中通過'IntentService'運行Firebase Remote Config。我不得不從'onStart'函數而不是'onHandleIntent'函數啓動'fetch'命令。 –
'onComplete'在我的情況下永遠不會被調用,你知道爲什麼嗎? – ericn