Skip to content

Commit 87fdeaf

Browse files
authored
fix(user): remove eager Firebase.messaging call that crashes before FirebaseApp init (#773)
The `Firebase.messaging.token` call in `UserManager.init` runs during Hilt graph construction in `FlipcashApp.onCreate()`. On some devices, Firebase has not yet initialized at this point, causing an IllegalStateException. This call is redundant — `AuthManager.updateFcmToken()` already fetches and registers the push token via `PushTokenProvider` during login/soft-login. Fixes: Bugsnag 6a0c83a8dd5b5015ce623eae Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
1 parent 3662f6c commit 87fdeaf

2 files changed

Lines changed: 0 additions & 6 deletions

File tree

services/flipcash/build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ dependencies {
4747

4848
implementation(platform(libs.firebase.bom))
4949
implementation(libs.firebase.installations)
50-
implementation(libs.firebase.messaging)
5150

5251
implementation(libs.play.integrity)
5352

services/flipcash/src/main/kotlin/com/flipcash/services/user/UserManager.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ import com.getcode.opencode.model.financial.usdf
1717
import com.getcode.services.opencode.BuildConfig
1818
import com.getcode.utils.TraceManager
1919
import com.getcode.utils.base58
20-
import com.google.firebase.Firebase
21-
import com.google.firebase.messaging.messaging
2220
import com.hoc081098.channeleventbus.ChannelEventBus
2321
import com.mixpanel.android.mpmetrics.MixpanelAPI
2422
import kotlinx.coroutines.flow.MutableStateFlow
@@ -104,9 +102,6 @@ class UserManager @Inject constructor(
104102
didDetectUnlockedAccount()
105103
}
106104

107-
Firebase.messaging.token.addOnSuccessListener { token ->
108-
set(pushToken = token)
109-
}
110105
}
111106

112107
fun establish(entropy: String) {

0 commit comments

Comments
 (0)