mirror of
https://github.com/bitwarden/android.git
synced 2024-11-01 07:35:52 +03:00
24 lines
678 B
C#
24 lines
678 B
C#
|
using System;
|
||
|
using Android.App;
|
||
|
using Android.Content;
|
||
|
using Bit.App;
|
||
|
using Bit.App.Abstractions;
|
||
|
using Firebase.Iid;
|
||
|
using Plugin.Settings.Abstractions;
|
||
|
using XLabs.Ioc;
|
||
|
|
||
|
namespace Bit.Android
|
||
|
{
|
||
|
[Service]
|
||
|
[IntentFilter(new[] { "com.google.firebase.INSTANCE_ID_EVENT" })]
|
||
|
public class FirebaseInstanceIdService : Firebase.Iid.FirebaseInstanceIdService
|
||
|
{
|
||
|
public override void OnTokenRefresh()
|
||
|
{
|
||
|
var settings = Resolver.Resolve<ISettings>();
|
||
|
settings.AddOrUpdateValue(Constants.PushRegisteredToken, FirebaseInstanceId.Instance.Token);
|
||
|
Resolver.Resolve<IPushNotificationService>()?.Register();
|
||
|
}
|
||
|
}
|
||
|
}
|