From ffe7771801ec49a3828380a0043b936a292af21f Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 28 May 2019 15:40:56 -0400 Subject: [PATCH] async await --- src/Android/Push/FirebaseInstanceIdService.cs | 6 +++--- src/Android/Push/FirebaseMessagingService.cs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Android/Push/FirebaseInstanceIdService.cs b/src/Android/Push/FirebaseInstanceIdService.cs index 9a4f3d327..2ddcac048 100644 --- a/src/Android/Push/FirebaseInstanceIdService.cs +++ b/src/Android/Push/FirebaseInstanceIdService.cs @@ -13,12 +13,12 @@ namespace Bit.Droid.Push [IntentFilter(new[] { "com.google.firebase.INSTANCE_ID_EVENT" })] public class FirebaseInstanceIdService : Firebase.Iid.FirebaseInstanceIdService { - public override void OnTokenRefresh() + public async override void OnTokenRefresh() { var storageService = ServiceContainer.Resolve("storageService"); var pushNotificationService = ServiceContainer.Resolve("pushNotificationService"); - storageService.SaveAsync(Constants.PushRegisteredTokenKey, FirebaseInstanceId.Instance.Token); - pushNotificationService.RegisterAsync(); + await storageService.SaveAsync(Constants.PushRegisteredTokenKey, FirebaseInstanceId.Instance.Token); + await pushNotificationService.RegisterAsync(); } } } diff --git a/src/Android/Push/FirebaseMessagingService.cs b/src/Android/Push/FirebaseMessagingService.cs index a9331f2f5..101a04370 100644 --- a/src/Android/Push/FirebaseMessagingService.cs +++ b/src/Android/Push/FirebaseMessagingService.cs @@ -14,7 +14,7 @@ namespace Bit.Droid.Push [IntentFilter(new[] { "com.google.firebase.MESSAGING_EVENT" })] public class FirebaseMessagingService : Firebase.Messaging.FirebaseMessagingService { - public override void OnMessageReceived(RemoteMessage message) + public async override void OnMessageReceived(RemoteMessage message) { if(message?.Data == null) { @@ -30,7 +30,7 @@ namespace Bit.Droid.Push var obj = JObject.Parse(data); var listener = ServiceContainer.Resolve( "pushNotificationListenerService"); - listener.OnMessageAsync(obj, Device.Android); + await listener.OnMessageAsync(obj, Device.Android); } catch(JsonReaderException ex) {