1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-15 07:43:37 +00:00

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,38 +0,0 @@
using Bit.App.Abstractions;
using Foundation;
using UIKit;
using Xamarin.Forms;
namespace Bit.iOS.Services
{
public class iOSPushNotificationService : IPushNotificationService
{
private const string TokenSetting = "token";
private readonly IPushNotificationListener _pushNotificationListener;
public iOSPushNotificationService(
IPushNotificationListener pushNotificationListener)
{
_pushNotificationListener = pushNotificationListener;
}
public string Token => NSUserDefaults.StandardUserDefaults.StringForKey(TokenSetting);
public void Register()
{
var userNotificationTypes = UIUserNotificationType.Alert | UIUserNotificationType.Badge |
UIUserNotificationType.Sound;
var settings = UIUserNotificationSettings.GetSettingsForTypes(userNotificationTypes, null);
UIApplication.SharedApplication.RegisterUserNotificationSettings(settings);
}
public void Unregister()
{
UIApplication.SharedApplication.UnregisterForRemoteNotifications();
_pushNotificationListener.OnUnregistered(Device.iOS);
NSUserDefaults.StandardUserDefaults.SetString(string.Empty, TokenSetting);
NSUserDefaults.StandardUserDefaults.Synchronize();
}
}
}