Fix notification settings getting reset on app update
This commit is contained in:
parent
f73849dbb7
commit
620bc2285c
|
@ -121,10 +121,6 @@ public class PushSubscriptionManager{
|
|||
return !TextUtils.isEmpty(deviceToken);
|
||||
}
|
||||
|
||||
public void registerAccountForPush(){
|
||||
registerAccountForPush(null);
|
||||
}
|
||||
|
||||
public void registerAccountForPush(PushSubscription subscription){
|
||||
if(TextUtils.isEmpty(deviceToken))
|
||||
throw new IllegalStateException("No device push token available");
|
||||
|
@ -367,7 +363,7 @@ public class PushSubscriptionManager{
|
|||
private static void registerAllAccountsForPush(boolean forceReRegister){
|
||||
for(AccountSession session:AccountSessionManager.getInstance().getLoggedInAccounts()){
|
||||
if(session.pushSubscription==null || forceReRegister)
|
||||
session.getPushSubscriptionManager().registerAccountForPush();
|
||||
session.getPushSubscriptionManager().registerAccountForPush(session.pushSubscription);
|
||||
else if(session.needUpdatePushSettings)
|
||||
session.getPushSubscriptionManager().updatePushSettings(session.pushSubscription);
|
||||
}
|
||||
|
|
|
@ -100,7 +100,7 @@ public class AccountSessionManager{
|
|||
writeAccountsFile();
|
||||
updateInstanceEmojis(instance, instance.uri);
|
||||
if(PushSubscriptionManager.arePushNotificationsAvailable()){
|
||||
session.getPushSubscriptionManager().registerAccountForPush();
|
||||
session.getPushSubscriptionManager().registerAccountForPush(null);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue