Allow configuring push notifications with UnifiedPush
This commit is contained in:
parent
281e989749
commit
4e1f7839b3
2 changed files with 3 additions and 3 deletions
|
@ -39,10 +39,10 @@ public class UnifiedPushNotificationReceiver extends MessagingReceiver{
|
|||
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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -127,7 +127,7 @@ public class SettingsNotificationsFragment extends BaseSettingsFragment<Void>{
|
|||
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;
|
||||
|
|
Loading…
Add table
Reference in a new issue