diff --git a/src/Android/Android.csproj b/src/Android/Android.csproj
index a231e42ee..d4e820d1b 100644
--- a/src/Android/Android.csproj
+++ b/src/Android/Android.csproj
@@ -317,7 +317,7 @@
-
+
diff --git a/src/Android/MainApplication.cs b/src/Android/MainApplication.cs
index cff22d964..287092c99 100644
--- a/src/Android/MainApplication.cs
+++ b/src/Android/MainApplication.cs
@@ -67,7 +67,7 @@ namespace Bit.Android
private void HandlePushReregistration()
{
- var pushNotification = Resolver.Resolve();
+ var pushNotification = Resolver.Resolve();
var settings = Resolver.Resolve();
// Reregister for push token based on certain conditions
@@ -151,11 +151,11 @@ namespace Bit.Android
public static void StartPushService()
{
- AppContext.StartService(new Intent(AppContext, typeof(PushNotificationService)));
+ AppContext.StartService(new Intent(AppContext, typeof(AndroidPushNotificationService)));
if(Build.VERSION.SdkInt >= BuildVersionCodes.Kitkat)
{
PendingIntent pintent = PendingIntent.GetService(AppContext, 0, new Intent(AppContext,
- typeof(PushNotificationService)), 0);
+ typeof(AndroidPushNotificationService)), 0);
AlarmManager alarm = (AlarmManager)AppContext.GetSystemService(AlarmService);
alarm.Cancel(pintent);
}
@@ -163,11 +163,11 @@ namespace Bit.Android
public static void StopPushService()
{
- AppContext.StopService(new Intent(AppContext, typeof(PushNotificationService)));
+ AppContext.StopService(new Intent(AppContext, typeof(AndroidPushNotificationService)));
if(Build.VERSION.SdkInt >= BuildVersionCodes.Kitkat)
{
PendingIntent pintent = PendingIntent.GetService(AppContext, 0, new Intent(AppContext,
- typeof(PushNotificationService)), 0);
+ typeof(AndroidPushNotificationService)), 0);
AlarmManager alarm = (AlarmManager)AppContext.GetSystemService(AlarmService);
alarm.Cancel(pintent);
}
diff --git a/src/Android/Services/PushNotificationImplementation.cs b/src/Android/Services/AndroidPushNotificationService.cs
similarity index 83%
rename from src/Android/Services/PushNotificationImplementation.cs
rename to src/Android/Services/AndroidPushNotificationService.cs
index 72a2e3aa3..eebf4624f 100644
--- a/src/Android/Services/PushNotificationImplementation.cs
+++ b/src/Android/Services/AndroidPushNotificationService.cs
@@ -17,7 +17,7 @@ using Newtonsoft.Json;
namespace Bit.Android.Services
{
- public class PushNotificationImplementation : IPushNotification
+ public class AndroidPushNotificationService : IPushNotificationService
{
private const string GcmPreferencesKey = "GCMPreferences";
private const string Tag = "PushNotification";
@@ -29,20 +29,20 @@ namespace Bit.Android.Services
{
System.Diagnostics.Debug.WriteLine(
- $"{PushNotificationKey.DomainName} - Register - Registering push notifications");
+ $"{PushNotificationContants.DomainName} - Register - Registering push notifications");
if(string.IsNullOrEmpty(CrossPushNotification.SenderId))
{
System.Diagnostics.Debug.WriteLine(
- $"{PushNotificationKey.DomainName} - Register - SenderId is missing.");
+ $"{PushNotificationContants.DomainName} - Register - SenderId is missing.");
CrossPushNotification.PushNotificationListener.OnError(
- $"{PushNotificationKey.DomainName} - Register - Sender Id is missing.", Device.Android);
+ $"{PushNotificationContants.DomainName} - Register - Sender Id is missing.", Device.Android);
}
else
{
System.Diagnostics.Debug.WriteLine(
- $"{PushNotificationKey.DomainName} - Register - Registering for Push Notifications");
+ $"{PushNotificationContants.DomainName} - Register - Registering for Push Notifications");
ThreadPool.QueueUserWorkItem(state =>
{
@@ -68,10 +68,10 @@ namespace Bit.Android.Services
ThreadPool.QueueUserWorkItem(state =>
{
System.Diagnostics.Debug.WriteLine(
- $"{PushNotificationKey.DomainName} - Unregister - Unregistering push notifications");
+ $"{PushNotificationContants.DomainName} - Unregister - Unregistering push notifications");
try
{
- InstanceID instanceID = InstanceID.GetInstance(global::Android.App.Application.Context);
+ var instanceID = InstanceID.GetInstance(global::Android.App.Application.Context);
instanceID.DeleteToken(CrossPushNotification.SenderId, GoogleCloudMessaging.InstanceIdScope);
CrossPushNotification.PushNotificationListener.OnUnregistered(Device.Android);
@@ -89,35 +89,31 @@ namespace Bit.Android.Services
private string GetRegistrationId()
{
- var retVal = string.Empty;
var context = global::Android.App.Application.Context;
var prefs = GetGCMPreferences(context);
- var registrationId = prefs.GetString(PushNotificationKey.Token, string.Empty);
+ var registrationId = prefs.GetString(PushNotificationContants.Token, string.Empty);
if(string.IsNullOrEmpty(registrationId))
{
- System.Diagnostics.Debug.WriteLine($"{PushNotificationKey.DomainName} - Registration not found.");
- return retVal;
+ System.Diagnostics.Debug.WriteLine($"{PushNotificationContants.DomainName} - Registration not found.");
+ return string.Empty;
}
// Check if app was updated; if so, it must clear the registration ID
// since the existing registration ID is not guaranteed to work with
// the new app version.
- var registeredVersion = prefs.GetInt(PushNotificationKey.AppVersion, Java.Lang.Integer.MinValue);
+ var registeredVersion = prefs.GetInt(PushNotificationContants.AppVersion, Java.Lang.Integer.MinValue);
var currentVersion = GetAppVersion(context);
if(registeredVersion != currentVersion)
{
- System.Diagnostics.Debug.WriteLine($"{PushNotificationKey.DomainName} - App version changed.");
- return retVal;
+ System.Diagnostics.Debug.WriteLine($"{PushNotificationContants.DomainName} - App version changed.");
+ return string.Empty;
}
- retVal = registrationId;
- return retVal;
+ return registrationId;
}
internal static ISharedPreferences GetGCMPreferences(Context context)
{
- // This sample app persists the registration ID in shared preferences, but
- // how you store the registration ID in your app is up to you.
return context.GetSharedPreferences(GcmPreferencesKey, FileCreationMode.Private);
}
@@ -141,11 +137,11 @@ namespace Bit.Android.Services
var appVersion = GetAppVersion(context);
System.Diagnostics.Debug.WriteLine(
- $"{PushNotificationKey.DomainName} - Saving token on app version {appVersion}");
+ $"{PushNotificationContants.DomainName} - Saving token on app version {appVersion}");
var editor = prefs.Edit();
- editor.PutString(PushNotificationKey.Token, regId);
- editor.PutInt(PushNotificationKey.AppVersion, appVersion);
+ editor.PutString(PushNotificationContants.Token, regId);
+ editor.PutInt(PushNotificationContants.AppVersion, appVersion);
editor.Commit();
}
}
@@ -168,7 +164,7 @@ namespace Bit.Android.Services
var token = instanceID.GetToken(CrossPushNotification.SenderId,
GoogleCloudMessaging.InstanceIdScope, null);
CrossPushNotification.PushNotificationListener.OnRegistered(token, Device.Android);
- PushNotificationImplementation.StoreRegistrationId(global::Android.App.Application.Context, token);
+ AndroidPushNotificationService.StoreRegistrationId(global::Android.App.Application.Context, token);
SubscribeTopics(token);
System.Diagnostics.Debug.WriteLine($"{token} - Device registered, registration ID={Tag}");
}
@@ -230,7 +226,7 @@ namespace Bit.Android.Services
if(extras != null && !extras.IsEmpty)
{
System.Diagnostics.Debug.WriteLine(
- $"{PushNotificationKey.DomainName} - GCM Listener - Push Received");
+ $"{PushNotificationContants.DomainName} - GCM Listener - Push Received");
var parameters = new Dictionary();
var values = new JObject();
@@ -249,7 +245,7 @@ namespace Bit.Android.Services
parameters.Add(key, extras.Get(key));
System.Diagnostics.Debug.WriteLine(
- $"{PushNotificationKey.DomainName} - GCM Listener - Push Params {key} : {extras.Get(key)}");
+ $"{PushNotificationContants.DomainName} - GCM Listener - Push Params {key} : {extras.Get(key)}");
}
var context = global::Android.App.Application.Context;
@@ -267,21 +263,21 @@ namespace Bit.Android.Services
{
message = parameters[CrossPushNotification.NotificationContentTextKey].ToString();
}
- else if(parameters.ContainsKey(PushNotificationKey.Alert))
+ else if(parameters.ContainsKey(PushNotificationContants.Alert))
{
- message = parameters[PushNotificationKey.Alert].ToString();
+ message = parameters[PushNotificationContants.Alert].ToString();
}
- else if(parameters.ContainsKey(PushNotificationKey.Message))
+ else if(parameters.ContainsKey(PushNotificationContants.Message))
{
- message = parameters[PushNotificationKey.Message].ToString();
+ message = parameters[PushNotificationContants.Message].ToString();
}
- else if(parameters.ContainsKey(PushNotificationKey.Subtitle))
+ else if(parameters.ContainsKey(PushNotificationContants.Subtitle))
{
- message = parameters[PushNotificationKey.Subtitle].ToString();
+ message = parameters[PushNotificationContants.Subtitle].ToString();
}
- else if(parameters.ContainsKey(PushNotificationKey.Text))
+ else if(parameters.ContainsKey(PushNotificationContants.Text))
{
- message = parameters[PushNotificationKey.Text].ToString();
+ message = parameters[PushNotificationContants.Text].ToString();
}
if(!string.IsNullOrEmpty(CrossPushNotification.NotificationContentTitleKey) &&
@@ -289,15 +285,15 @@ namespace Bit.Android.Services
{
title = parameters[CrossPushNotification.NotificationContentTitleKey].ToString();
}
- else if(parameters.ContainsKey(PushNotificationKey.Title))
+ else if(parameters.ContainsKey(PushNotificationContants.Title))
{
if(!string.IsNullOrEmpty(message))
{
- title = parameters[PushNotificationKey.Title].ToString();
+ title = parameters[PushNotificationContants.Title].ToString();
}
else
{
- message = parameters[PushNotificationKey.Title].ToString();
+ message = parameters[PushNotificationContants.Title].ToString();
}
}
@@ -307,7 +303,7 @@ namespace Bit.Android.Services
!string.IsNullOrEmpty(CrossPushNotification.NotificationContentDataKey) &&
values[CrossPushNotification.NotificationContentDataKey] != null) ?
values[CrossPushNotification.NotificationContentDataKey] :
- values[PushNotificationKey.Data];
+ values[PushNotificationContants.Data];
if(data != null)
{
@@ -316,21 +312,21 @@ namespace Bit.Android.Services
{
message = data[CrossPushNotification.NotificationContentTextKey].ToString();
}
- else if(data[PushNotificationKey.Alert] != null)
+ else if(data[PushNotificationContants.Alert] != null)
{
- message = data[PushNotificationKey.Alert].ToString();
+ message = data[PushNotificationContants.Alert].ToString();
}
- else if(data[PushNotificationKey.Message] != null)
+ else if(data[PushNotificationContants.Message] != null)
{
- message = data[PushNotificationKey.Message].ToString();
+ message = data[PushNotificationContants.Message].ToString();
}
- else if(data[PushNotificationKey.Subtitle] != null)
+ else if(data[PushNotificationContants.Subtitle] != null)
{
- message = data[PushNotificationKey.Subtitle].ToString();
+ message = data[PushNotificationContants.Subtitle].ToString();
}
- else if(data[PushNotificationKey.Text] != null)
+ else if(data[PushNotificationContants.Text] != null)
{
- message = data[PushNotificationKey.Text].ToString();
+ message = data[PushNotificationContants.Text].ToString();
}
if(!string.IsNullOrEmpty(CrossPushNotification.NotificationContentTitleKey) &&
@@ -338,23 +334,23 @@ namespace Bit.Android.Services
{
title = data[CrossPushNotification.NotificationContentTitleKey].ToString();
}
- else if(data[PushNotificationKey.Title] != null)
+ else if(data[PushNotificationContants.Title] != null)
{
if(!string.IsNullOrEmpty(message))
{
- title = data[PushNotificationKey.Title].ToString();
+ title = data[PushNotificationContants.Title].ToString();
}
else
{
- message = data[PushNotificationKey.Title].ToString();
+ message = data[PushNotificationContants.Title].ToString();
}
}
}
}
- if(parameters.ContainsKey(PushNotificationKey.Id))
+ if(parameters.ContainsKey(PushNotificationContants.Id))
{
- var str = parameters[PushNotificationKey.Id].ToString();
+ var str = parameters[PushNotificationContants.Id].ToString();
try
{
notifyId = Convert.ToInt32(str);
@@ -366,13 +362,13 @@ namespace Bit.Android.Services
}
}
- if(parameters.ContainsKey(PushNotificationKey.Tag))
+ if(parameters.ContainsKey(PushNotificationContants.Tag))
{
- tag = parameters[PushNotificationKey.Tag].ToString();
+ tag = parameters[PushNotificationContants.Tag].ToString();
}
- if(!parameters.ContainsKey(PushNotificationKey.Silent) ||
- !System.Boolean.Parse(parameters[PushNotificationKey.Silent].ToString()))
+ if(!parameters.ContainsKey(PushNotificationContants.Silent) ||
+ !System.Boolean.Parse(parameters[PushNotificationContants.Silent].ToString()))
{
if(CrossPushNotification.PushNotificationListener.ShouldShowNotification())
{
@@ -395,7 +391,7 @@ namespace Bit.Android.Services
private void CreateNotification(string title, string message, int notifyId, string tag, Bundle extras)
{
System.Diagnostics.Debug.WriteLine(
- $"{PushNotificationKey.DomainName} - PushNotification - Message {title} : {message}");
+ $"{PushNotificationContants.DomainName} - PushNotification - Message {title} : {message}");
NotificationCompat.Builder builder = null;
var context = global::Android.App.Application.Context;
@@ -480,7 +476,7 @@ namespace Bit.Android.Services
{ }
[Service]
- public class PushNotificationService : Service
+ public class AndroidPushService : Service
{
public override void OnCreate()
{
@@ -509,8 +505,8 @@ namespace Bit.Android.Services
internal class CrossPushNotification
{
- private static Lazy Implementation = new Lazy(
- () => new PushNotificationImplementation(),
+ private static Lazy Implementation = new Lazy(
+ () => new AndroidPushNotificationService(),
LazyThreadSafetyMode.PublicationOnly);
public static bool IsInitialized => PushNotificationListener != null;
public static IPushNotificationListener PushNotificationListener { get; private set; }
@@ -542,7 +538,7 @@ namespace Bit.Android.Services
Initialize(new T(), senderId);
}
- public static IPushNotification Current
+ public static IPushNotificationService Current
{
get
{
diff --git a/src/App/Abstractions/Services/IPushNotification.cs b/src/App/Abstractions/Services/IPushNotification.cs
index e98aad42b..4b0186d52 100644
--- a/src/App/Abstractions/Services/IPushNotification.cs
+++ b/src/App/Abstractions/Services/IPushNotification.cs
@@ -1,6 +1,6 @@
namespace Bit.App.Abstractions
{
- public interface IPushNotification
+ public interface IPushNotificationService
{
string Token { get; }
void Register();
diff --git a/src/App/App.csproj b/src/App/App.csproj
index 776bdec3c..b43109751 100644
--- a/src/App/App.csproj
+++ b/src/App/App.csproj
@@ -358,7 +358,7 @@
-
+
diff --git a/src/App/Pages/LoginPage.cs b/src/App/Pages/LoginPage.cs
index 69cbb8c3a..b01ba1dc5 100644
--- a/src/App/Pages/LoginPage.cs
+++ b/src/App/Pages/LoginPage.cs
@@ -18,7 +18,7 @@ namespace Bit.App.Pages
private ISyncService _syncService;
private ISettings _settings;
private IGoogleAnalyticsService _googleAnalyticsService;
- private IPushNotification _pushNotification;
+ private IPushNotificationService _pushNotification;
private readonly string _email;
public LoginPage(string email = null)
@@ -30,7 +30,7 @@ namespace Bit.App.Pages
_syncService = Resolver.Resolve();
_settings = Resolver.Resolve();
_googleAnalyticsService = Resolver.Resolve();
- _pushNotification = Resolver.Resolve();
+ _pushNotification = Resolver.Resolve();
Init();
}
diff --git a/src/App/Pages/LoginTwoFactorPage.cs b/src/App/Pages/LoginTwoFactorPage.cs
index dca25d1f0..d15afcd47 100644
--- a/src/App/Pages/LoginTwoFactorPage.cs
+++ b/src/App/Pages/LoginTwoFactorPage.cs
@@ -24,7 +24,7 @@ namespace Bit.App.Pages
private IDeviceInfoService _deviceInfoService;
private IGoogleAnalyticsService _googleAnalyticsService;
private ITwoFactorApiRepository _twoFactorApiRepository;
- private IPushNotification _pushNotification;
+ private IPushNotificationService _pushNotification;
private IAppSettingsService _appSettingsService;
private readonly string _email;
private readonly string _masterPasswordHash;
@@ -51,7 +51,7 @@ namespace Bit.App.Pages
_appSettingsService = Resolver.Resolve();
_googleAnalyticsService = Resolver.Resolve();
_twoFactorApiRepository = Resolver.Resolve();
- _pushNotification = Resolver.Resolve();
+ _pushNotification = Resolver.Resolve();
Init();
}
diff --git a/src/App/Pages/Settings/SettingsPage.cs b/src/App/Pages/Settings/SettingsPage.cs
index b5ccc627b..9515b1d84 100644
--- a/src/App/Pages/Settings/SettingsPage.cs
+++ b/src/App/Pages/Settings/SettingsPage.cs
@@ -17,7 +17,7 @@ namespace Bit.App.Pages
private readonly IUserDialogs _userDialogs;
private readonly ISettings _settings;
private readonly IFingerprint _fingerprint;
- private readonly IPushNotification _pushNotification;
+ private readonly IPushNotificationService _pushNotification;
private readonly IGoogleAnalyticsService _googleAnalyticsService;
private readonly IDeviceInfoService _deviceInfoService;
@@ -29,7 +29,7 @@ namespace Bit.App.Pages
_userDialogs = Resolver.Resolve();
_settings = Resolver.Resolve();
_fingerprint = Resolver.Resolve();
- _pushNotification = Resolver.Resolve();
+ _pushNotification = Resolver.Resolve();
_googleAnalyticsService = Resolver.Resolve();
_deviceInfoService = Resolver.Resolve();
diff --git a/src/App/Pages/Vault/VaultListLoginsPage.cs b/src/App/Pages/Vault/VaultListLoginsPage.cs
index 0cbac5a96..16e8a2b7e 100644
--- a/src/App/Pages/Vault/VaultListLoginsPage.cs
+++ b/src/App/Pages/Vault/VaultListLoginsPage.cs
@@ -25,7 +25,7 @@ namespace Bit.App.Pages
private readonly IConnectivity _connectivity;
private readonly IDeviceActionService _clipboardService;
private readonly ISyncService _syncService;
- private readonly IPushNotification _pushNotification;
+ private readonly IPushNotificationService _pushNotification;
private readonly IDeviceInfoService _deviceInfoService;
private readonly ISettings _settings;
private readonly IGoogleAnalyticsService _googleAnalyticsService;
@@ -42,7 +42,7 @@ namespace Bit.App.Pages
_userDialogs = Resolver.Resolve();
_clipboardService = Resolver.Resolve();
_syncService = Resolver.Resolve();
- _pushNotification = Resolver.Resolve();
+ _pushNotification = Resolver.Resolve();
_deviceInfoService = Resolver.Resolve();
_settings = Resolver.Resolve();
_googleAnalyticsService = Resolver.Resolve();
diff --git a/src/App/Utilities/PushNotificationKey.cs b/src/App/Utilities/PushNotificationContants.cs
similarity index 97%
rename from src/App/Utilities/PushNotificationKey.cs
rename to src/App/Utilities/PushNotificationContants.cs
index 3665ace10..e1466d59d 100644
--- a/src/App/Utilities/PushNotificationKey.cs
+++ b/src/App/Utilities/PushNotificationContants.cs
@@ -1,6 +1,6 @@
namespace Bit.App.Utilities
{
- public static class PushNotificationKey
+ public static class PushNotificationContants
{
///
/// Type
diff --git a/src/UWP/Services/PushNotificationImplementation.cs b/src/UWP/Services/UwpPushNotificationService.cs
similarity index 93%
rename from src/UWP/Services/PushNotificationImplementation.cs
rename to src/UWP/Services/UwpPushNotificationService.cs
index beb442089..358e0d50f 100644
--- a/src/UWP/Services/PushNotificationImplementation.cs
+++ b/src/UWP/Services/UwpPushNotificationService.cs
@@ -9,7 +9,7 @@ using Xamarin.Forms;
namespace Bit.UWP.Services
{
- public class PushNotificationImplementation : IPushNotification
+ public class UwpPushNotificationService : IPushNotificationService
{
private PushNotificationChannel _channel;
private JsonSerializer serializer = new JsonSerializer()
@@ -44,11 +44,9 @@ namespace Bit.UWP.Services
case PushNotificationType.Badge:
jobject = JObject.FromObject(args.BadgeNotification, serializer);
break;
-
case PushNotificationType.Raw:
jobject = JObject.FromObject(args.RawNotification, serializer);
break;
-
case PushNotificationType.Tile:
jobject = JObject.FromObject(args.TileNotification, serializer);
break;
@@ -78,8 +76,8 @@ namespace Bit.UWP.Services
internal class CrossPushNotification
{
- private static Lazy Implementation = new Lazy(
- () => new PushNotificationImplementation(),
+ private static Lazy Implementation = new Lazy(
+ () => new UwpPushNotificationService(),
LazyThreadSafetyMode.PublicationOnly);
public static bool IsInitialized => PushNotificationListener != null;
public static IPushNotificationListener PushNotificationListener { get; private set; }
@@ -102,7 +100,7 @@ namespace Bit.UWP.Services
Initialize(new T());
}
- public static IPushNotification Current
+ public static IPushNotificationService Current
{
get
{
diff --git a/src/UWP/UWP.csproj b/src/UWP/UWP.csproj
index 6a12499ce..863c0f8eb 100644
--- a/src/UWP/UWP.csproj
+++ b/src/UWP/UWP.csproj
@@ -105,7 +105,7 @@
-
+
diff --git a/src/iOS/Services/PushNotificationImplementation.cs b/src/iOS/Services/iOSPushNotificationService.cs
similarity index 90%
rename from src/iOS/Services/PushNotificationImplementation.cs
rename to src/iOS/Services/iOSPushNotificationService.cs
index 8f83164d7..81040ecaf 100644
--- a/src/iOS/Services/PushNotificationImplementation.cs
+++ b/src/iOS/Services/iOSPushNotificationService.cs
@@ -11,9 +11,9 @@ using Xamarin.Forms;
namespace Bit.iOS.Services
{
- public class PushNotificationImplementation : IPushNotification, IPushNotificationHandler
+ public class iOSPushNotificationService : IPushNotificationService, IPushNotificationHandler
{
- public string Token => NSUserDefaults.StandardUserDefaults.StringForKey(PushNotificationKey.Token);
+ public string Token => NSUserDefaults.StandardUserDefaults.StringForKey(PushNotificationContants.Token);
public void Register()
{
@@ -65,13 +65,13 @@ namespace Bit.iOS.Services
public void OnErrorReceived(NSError error)
{
- Debug.WriteLine("{0} - Registration Failed.", PushNotificationKey.DomainName);
+ Debug.WriteLine("{0} - Registration Failed.", PushNotificationContants.DomainName);
CrossPushNotification.PushNotificationListener.OnError(error.LocalizedDescription, Device.iOS);
}
public void OnRegisteredSuccess(NSData token)
{
- Debug.WriteLine("{0} - Succesfully Registered.", PushNotificationKey.DomainName);
+ Debug.WriteLine("{0} - Succesfully Registered.", PushNotificationContants.DomainName);
var trimmedDeviceToken = token.Description;
if(!string.IsNullOrWhiteSpace(trimmedDeviceToken))
@@ -82,16 +82,16 @@ namespace Bit.iOS.Services
trimmedDeviceToken = trimmedDeviceToken.Replace(" ", "");
}
- Console.WriteLine("{0} - Token: {1}", PushNotificationKey.DomainName, trimmedDeviceToken);
+ Console.WriteLine("{0} - Token: {1}", PushNotificationContants.DomainName, trimmedDeviceToken);
CrossPushNotification.PushNotificationListener.OnRegistered(trimmedDeviceToken, Device.iOS);
- NSUserDefaults.StandardUserDefaults.SetString(trimmedDeviceToken, PushNotificationKey.Token);
+ NSUserDefaults.StandardUserDefaults.SetString(trimmedDeviceToken, PushNotificationContants.Token);
NSUserDefaults.StandardUserDefaults.Synchronize();
}
public void OnUnregisteredSuccess()
{
CrossPushNotification.PushNotificationListener.OnUnregistered(Device.iOS);
- NSUserDefaults.StandardUserDefaults.SetString(string.Empty, PushNotificationKey.Token);
+ NSUserDefaults.StandardUserDefaults.SetString(string.Empty, PushNotificationContants.Token);
NSUserDefaults.StandardUserDefaults.Synchronize();
}
}
@@ -106,8 +106,8 @@ namespace Bit.iOS.Services
internal class CrossPushNotification
{
- private static Lazy Implementation = new Lazy(
- () => new PushNotificationImplementation(),
+ private static Lazy Implementation = new Lazy(
+ () => new iOSPushNotificationService(),
LazyThreadSafetyMode.PublicationOnly);
public static bool IsInitialized => PushNotificationListener != null;
public static IPushNotificationListener PushNotificationListener { get; private set; }
@@ -130,7 +130,7 @@ namespace Bit.iOS.Services
Initialize(new T());
}
- public static IPushNotification Current
+ public static IPushNotificationService Current
{
get
{
diff --git a/src/iOS/iOS.csproj b/src/iOS/iOS.csproj
index 6a69806eb..07c3a3bbd 100644
--- a/src/iOS/iOS.csproj
+++ b/src/iOS/iOS.csproj
@@ -238,7 +238,7 @@
-
+
Designer