mirror of
https://github.com/bitwarden/android.git
synced 2024-12-25 02:18:27 +03:00
async await
This commit is contained in:
parent
5942bcc16d
commit
ffe7771801
2 changed files with 5 additions and 5 deletions
|
@ -13,12 +13,12 @@ namespace Bit.Droid.Push
|
||||||
[IntentFilter(new[] { "com.google.firebase.INSTANCE_ID_EVENT" })]
|
[IntentFilter(new[] { "com.google.firebase.INSTANCE_ID_EVENT" })]
|
||||||
public class FirebaseInstanceIdService : Firebase.Iid.FirebaseInstanceIdService
|
public class FirebaseInstanceIdService : Firebase.Iid.FirebaseInstanceIdService
|
||||||
{
|
{
|
||||||
public override void OnTokenRefresh()
|
public async override void OnTokenRefresh()
|
||||||
{
|
{
|
||||||
var storageService = ServiceContainer.Resolve<IStorageService>("storageService");
|
var storageService = ServiceContainer.Resolve<IStorageService>("storageService");
|
||||||
var pushNotificationService = ServiceContainer.Resolve<IPushNotificationService>("pushNotificationService");
|
var pushNotificationService = ServiceContainer.Resolve<IPushNotificationService>("pushNotificationService");
|
||||||
storageService.SaveAsync(Constants.PushRegisteredTokenKey, FirebaseInstanceId.Instance.Token);
|
await storageService.SaveAsync(Constants.PushRegisteredTokenKey, FirebaseInstanceId.Instance.Token);
|
||||||
pushNotificationService.RegisterAsync();
|
await pushNotificationService.RegisterAsync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ namespace Bit.Droid.Push
|
||||||
[IntentFilter(new[] { "com.google.firebase.MESSAGING_EVENT" })]
|
[IntentFilter(new[] { "com.google.firebase.MESSAGING_EVENT" })]
|
||||||
public class FirebaseMessagingService : Firebase.Messaging.FirebaseMessagingService
|
public class FirebaseMessagingService : Firebase.Messaging.FirebaseMessagingService
|
||||||
{
|
{
|
||||||
public override void OnMessageReceived(RemoteMessage message)
|
public async override void OnMessageReceived(RemoteMessage message)
|
||||||
{
|
{
|
||||||
if(message?.Data == null)
|
if(message?.Data == null)
|
||||||
{
|
{
|
||||||
|
@ -30,7 +30,7 @@ namespace Bit.Droid.Push
|
||||||
var obj = JObject.Parse(data);
|
var obj = JObject.Parse(data);
|
||||||
var listener = ServiceContainer.Resolve<IPushNotificationListenerService>(
|
var listener = ServiceContainer.Resolve<IPushNotificationListenerService>(
|
||||||
"pushNotificationListenerService");
|
"pushNotificationListenerService");
|
||||||
listener.OnMessageAsync(obj, Device.Android);
|
await listener.OnMessageAsync(obj, Device.Android);
|
||||||
}
|
}
|
||||||
catch(JsonReaderException ex)
|
catch(JsonReaderException ex)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue