Still need to unregister push each time on android for some reason

This commit is contained in:
Kyle Spearrin 2016-08-27 02:59:34 -04:00
parent 42434229ce
commit c26960380a
2 changed files with 3 additions and 4 deletions

View file

@ -46,13 +46,11 @@ namespace Bit.Android
StartPushService(); StartPushService();
var pushNotification = Resolver.Resolve<IPushNotification>(); var pushNotification = Resolver.Resolve<IPushNotification>();
#if DEBUG // Must unregister the previous instance first or else things wont work
// When running in debug mode you must unregister the previous instance first or else things wont work
// ref https://github.com/rdelrosario/xamarin-plugins/issues/65 // ref https://github.com/rdelrosario/xamarin-plugins/issues/65
pushNotification.Unregister();
#endif
if(Resolver.Resolve<IAuthService>().IsAuthenticated) if(Resolver.Resolve<IAuthService>().IsAuthenticated)
{ {
pushNotification.Unregister();
pushNotification.Register(); pushNotification.Register();
} }
} }

View file

@ -205,6 +205,7 @@ namespace Bit.App.Pages
if(Device.OS == TargetPlatform.Android) if(Device.OS == TargetPlatform.Android)
{ {
_pushNotification.Unregister();
_pushNotification.Register(); _pushNotification.Register();
} }