RemoteMessage не обнуляется, вы должны изменить это
override fun onMessageReceived(remoteMessage: RemoteMessage) {
val data = remoteMessage.data
if (data.isNotEmpty()) {
var result: List<SubscriptionStatus>? = null
if (REMOTE_MESSAGE_SUBSCRIPTIONS_KEY in data) {
result = data[REMOTE_MESSAGE_SUBSCRIPTIONS_KEY]?.let {
SubscriptionStatus.listFromJsonString(it)
}
}
if (result == null) {
Log.e(TAG, "Invalid subscription data")
} else {
val app = application as SubApp
app.repository.updateSubscriptionsFromNetwork(result)
}
}
}