1
0
Fork 0

No issue: Add logging for firebase/autopush

master
Jonathan Almeida 2019-09-04 16:04:48 -04:00 committed by Jonathan Almeida
parent 58287cd5bb
commit ccd9e44a3e
2 changed files with 6 additions and 0 deletions

View File

@ -192,6 +192,8 @@ open class FenixApplication : Application() {
// We need the push feature setup here to deliver messages in the case where the service
// starts up the app first.
if (components.backgroundServices.pushConfig != null) {
Logger.info("Push configuration found; initializing autopush..")
val push = components.backgroundServices.push
// Install the AutoPush singleton to receive messages.

View File

@ -83,11 +83,15 @@ class BackgroundServices(
}
val pushConfig by lazy {
val logger = Logger("PushConfig")
val projectIdKey = context.getString(R.string.pref_key_push_project_id)
val resId = context.resources.getIdentifier(projectIdKey, "string", context.packageName)
if (resId == 0) {
logger.warn("No firebase configuration found; cannot support push service.")
return@lazy null
}
logger.debug("Creating push configuration for autopush.")
val projectId = context.resources.getString(resId)
PushConfig(projectId)
}