mirror of
https://github.com/bitwarden/android.git
synced 2024-12-25 02:18:27 +03:00
proper push service
This commit is contained in:
parent
bcbdbb4932
commit
b768c8b28a
1 changed files with 4 additions and 4 deletions
|
@ -151,11 +151,11 @@ namespace Bit.Android
|
||||||
|
|
||||||
public static void StartPushService()
|
public static void StartPushService()
|
||||||
{
|
{
|
||||||
AppContext.StartService(new Intent(AppContext, typeof(AndroidPushNotificationService)));
|
AppContext.StartService(new Intent(AppContext, typeof(AndroidPushService)));
|
||||||
if(Build.VERSION.SdkInt >= BuildVersionCodes.Kitkat)
|
if(Build.VERSION.SdkInt >= BuildVersionCodes.Kitkat)
|
||||||
{
|
{
|
||||||
PendingIntent pintent = PendingIntent.GetService(AppContext, 0, new Intent(AppContext,
|
PendingIntent pintent = PendingIntent.GetService(AppContext, 0, new Intent(AppContext,
|
||||||
typeof(AndroidPushNotificationService)), 0);
|
typeof(AndroidPushService)), 0);
|
||||||
AlarmManager alarm = (AlarmManager)AppContext.GetSystemService(AlarmService);
|
AlarmManager alarm = (AlarmManager)AppContext.GetSystemService(AlarmService);
|
||||||
alarm.Cancel(pintent);
|
alarm.Cancel(pintent);
|
||||||
}
|
}
|
||||||
|
@ -163,11 +163,11 @@ namespace Bit.Android
|
||||||
|
|
||||||
public static void StopPushService()
|
public static void StopPushService()
|
||||||
{
|
{
|
||||||
AppContext.StopService(new Intent(AppContext, typeof(AndroidPushNotificationService)));
|
AppContext.StopService(new Intent(AppContext, typeof(AndroidPushService)));
|
||||||
if(Build.VERSION.SdkInt >= BuildVersionCodes.Kitkat)
|
if(Build.VERSION.SdkInt >= BuildVersionCodes.Kitkat)
|
||||||
{
|
{
|
||||||
PendingIntent pintent = PendingIntent.GetService(AppContext, 0, new Intent(AppContext,
|
PendingIntent pintent = PendingIntent.GetService(AppContext, 0, new Intent(AppContext,
|
||||||
typeof(AndroidPushNotificationService)), 0);
|
typeof(AndroidPushService)), 0);
|
||||||
AlarmManager alarm = (AlarmManager)AppContext.GetSystemService(AlarmService);
|
AlarmManager alarm = (AlarmManager)AppContext.GetSystemService(AlarmService);
|
||||||
alarm.Cancel(pintent);
|
alarm.Cancel(pintent);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue