From c26960380adcbe695eb1a54a3b01cb9f21d8c3b6 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Sat, 27 Aug 2016 02:59:34 -0400 Subject: [PATCH] Still need to unregister push each time on android for some reason --- src/Android/MainApplication.cs | 6 ++---- src/App/Pages/LoginPage.cs | 1 + 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Android/MainApplication.cs b/src/Android/MainApplication.cs index e58ed25a9..38d8eb879 100644 --- a/src/Android/MainApplication.cs +++ b/src/Android/MainApplication.cs @@ -46,13 +46,11 @@ namespace Bit.Android StartPushService(); var pushNotification = Resolver.Resolve(); -#if DEBUG - // When running in debug mode you must unregister the previous instance first or else things wont work + // Must unregister the previous instance first or else things wont work // ref https://github.com/rdelrosario/xamarin-plugins/issues/65 - pushNotification.Unregister(); -#endif if(Resolver.Resolve().IsAuthenticated) { + pushNotification.Unregister(); pushNotification.Register(); } } diff --git a/src/App/Pages/LoginPage.cs b/src/App/Pages/LoginPage.cs index c1fdce5a2..4005e941b 100644 --- a/src/App/Pages/LoginPage.cs +++ b/src/App/Pages/LoginPage.cs @@ -205,6 +205,7 @@ namespace Bit.App.Pages if(Device.OS == TargetPlatform.Android) { + _pushNotification.Unregister(); _pushNotification.Register(); }