diff --git a/changelog.d/6891.bugfix b/changelog.d/6891.bugfix new file mode 100644 index 0000000000..b6b46e1d93 --- /dev/null +++ b/changelog.d/6891.bugfix @@ -0,0 +1 @@ +Fixes missing firebase notifications after logging in when UnifiedPush distributor is installed diff --git a/vector/src/main/java/im/vector/app/core/pushers/UnifiedPushHelper.kt b/vector/src/main/java/im/vector/app/core/pushers/UnifiedPushHelper.kt index 1f44ab3686..0993485471 100644 --- a/vector/src/main/java/im/vector/app/core/pushers/UnifiedPushHelper.kt +++ b/vector/src/main/java/im/vector/app/core/pushers/UnifiedPushHelper.kt @@ -92,8 +92,6 @@ class UnifiedPushHelper @Inject constructor( return@launch } - // By default, use internal solution (fcm/background sync) - UnifiedPush.saveDistributor(context, context.packageName) val distributors = UnifiedPush.getDistributors(context) if (distributors.size == 1 && !force) { @@ -101,7 +99,14 @@ class UnifiedPushHelper @Inject constructor( UnifiedPush.registerApp(context) onDoneRunnable?.run() } else { - openDistributorDialogInternal(activity, pushersManager, onDoneRunnable, distributors, !force, !force) + openDistributorDialogInternal( + activity = activity, + pushersManager = pushersManager, + onDoneRunnable = onDoneRunnable, + distributors = distributors, + unregisterFirst = force, + cancellable = !force + ) } } } @@ -165,6 +170,12 @@ class UnifiedPushHelper @Inject constructor( onDoneRunnable?.run() } } + .setOnCancelListener { + // By default, use internal solution (fcm/background sync) + UnifiedPush.saveDistributor(context, context.packageName) + UnifiedPush.registerApp(context) + onDoneRunnable?.run() + } .setCancelable(cancellable) .show() }