diff --git a/mastodon/src/main/java/org/joinmastodon/android/UnifiedPushNotificationReceiver.java b/mastodon/src/main/java/org/joinmastodon/android/UnifiedPushNotificationReceiver.java index dcad18895b..4cf04f6de7 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/UnifiedPushNotificationReceiver.java +++ b/mastodon/src/main/java/org/joinmastodon/android/UnifiedPushNotificationReceiver.java @@ -39,10 +39,10 @@ public void onNewEndpoint(@NotNull Context context, @NotNull PushEndpoint endpoi if (account != null) { PublicKeySet ks = endpoint.getPubKeySet(); if (ks != null){ - account.getPushSubscriptionManager().registerAccountForPush(null, true, endpoint.getUrl(), ks.getPubKey(), ks.getAuth()); + account.getPushSubscriptionManager().registerAccountForPush(account.pushSubscription, true, endpoint.getUrl(), ks.getPubKey(), ks.getAuth()); } else { // ks should never be null on new endpoint - account.getPushSubscriptionManager().registerAccountForPush(null, endpoint.getUrl()); + account.getPushSubscriptionManager().registerAccountForPush(account.pushSubscription, endpoint.getUrl()); } } } diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/settings/SettingsNotificationsFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/settings/SettingsNotificationsFragment.java index ac22670c62..668ab76d41 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/settings/SettingsNotificationsFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/settings/SettingsNotificationsFragment.java @@ -127,7 +127,7 @@ protected void onHidden(){ GlobalUserPreferences.save(); lp.keepOnlyLatestNotification=onlyLatestItem.checked; lp.save(); - if(needUpdateNotificationSettings && PushSubscriptionManager.arePushNotificationsAvailable()){ + if(needUpdateNotificationSettings && (PushSubscriptionManager.arePushNotificationsAvailable() || useUnifiedPush)){ ps.alerts.mention=mentionsItem.checked; ps.alerts.reblog=boostsItem.checked; ps.alerts.favourite=favoritesItem.checked;