fix(unifiedPushHelper): surround by try and catch due to a javax.crypto.AEADBadTagException
cc: @p1gp1g
This commit is contained in:
parent
0089a10a81
commit
065db923cc
1 changed files with 16 additions and 8 deletions
|
@ -29,21 +29,29 @@ public class UnifiedPushHelper {
|
|||
|
||||
public static void registerAllAccounts(@NonNull Context context) {
|
||||
for (AccountSession accountSession : AccountSessionManager.getInstance().getLoggedInAccounts()){
|
||||
try {
|
||||
UnifiedPush.register(
|
||||
context,
|
||||
accountSession.getID(),
|
||||
null,
|
||||
accountSession.app.vapidKey.replaceAll("=","")
|
||||
);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void unregisterAllAccounts(@NonNull Context context) {
|
||||
for (AccountSession accountSession : AccountSessionManager.getInstance().getLoggedInAccounts()){
|
||||
try {
|
||||
UnifiedPush.unregister(
|
||||
context,
|
||||
accountSession.getID()
|
||||
);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
// use FCM again
|
||||
accountSession.getPushSubscriptionManager().registerAccountForPush(null);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue