reset for v2

This commit is contained in:
Kyle Spearrin
2019-03-27 16:23:00 -04:00
parent 5a7f106e3e
commit 297beac169
1180 changed files with 0 additions and 126197 deletions

View File

@@ -1,44 +0,0 @@
#if !FDROID
using System;
using Bit.App;
using Bit.App.Abstractions;
using Plugin.Settings.Abstractions;
using Xamarin.Forms;
namespace Bit.Android.Services
{
public class AndroidPushNotificationService : IPushNotificationService
{
private readonly IPushNotificationListener _pushNotificationListener;
private readonly ISettings _settings;
public AndroidPushNotificationService(
IPushNotificationListener pushNotificationListener,
ISettings settings)
{
_pushNotificationListener = pushNotificationListener;
_settings = settings;
}
public string Token => _settings.GetValueOrDefault(Constants.PushCurrentToken, null);
public void Register()
{
var registeredToken = _settings.GetValueOrDefault(Constants.PushRegisteredToken, null);
if(!string.IsNullOrWhiteSpace(registeredToken) && registeredToken != Token)
{
_pushNotificationListener.OnRegistered(registeredToken, Device.Android);
}
else
{
_settings.AddOrUpdateValue(Constants.PushLastRegistrationDate, DateTime.UtcNow);
}
}
public void Unregister()
{
// Do we ever need to unregister?
}
}
}
#endif