Fix null reference error in notifications (#8042)

This commit is contained in:
Daniel Espino García 2024-06-27 09:47:57 +02:00 committed by GitHub
parent 41f8b078bb
commit de5e85d71f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -103,7 +103,7 @@ class CustomPushNotification(
when (type) {
CustomPushNotificationHelper.PUSH_TYPE_MESSAGE, CustomPushNotificationHelper.PUSH_TYPE_SESSION -> {
val currentActivityName = mAppLifecycleFacade.runningReactContext.currentActivity?.componentName?.className ?: ""
val currentActivityName = mAppLifecycleFacade.runningReactContext?.currentActivity?.componentName?.className ?: ""
Log.i("ReactNative", currentActivityName)
if (!mAppLifecycleFacade.isAppVisible() || currentActivityName != "MainActivity") {
var createSummary = type == CustomPushNotificationHelper.PUSH_TYPE_MESSAGE