IronPigeon.Relay.Controllers.InboxController.PushNotifyInboxMessageGoogleAsync C# (CSharp) Method

PushNotifyInboxMessageGoogleAsync() private method

private PushNotifyInboxMessageGoogleAsync ( InboxEntity inbox ) : Task
inbox IronPigeon.Relay.Models.InboxEntity
return Task
        private async Task PushNotifyInboxMessageGoogleAsync(InboxEntity inbox)
        {
            if (!string.IsNullOrEmpty(inbox.GoogleCloudMessagingRegistrationId))
            {
                var notifications = new GooglePushNotifications(this.HttpClient, ConfigurationManager.AppSettings["GoogleApiKey"], inbox.GoogleCloudMessagingRegistrationId);

                bool invalidChannel = false;
                try
                {
                    bool successfulPush = await notifications.PushGoogleRawNotificationAsync(CancellationToken.None);
                    invalidChannel |= !successfulPush;
                }
                catch (HttpRequestException)
                {
                    invalidChannel = true;
                }

                if (invalidChannel)
                {
                    inbox.GoogleCloudMessagingRegistrationId = null;
                    this.InboxTable.UpdateObject(inbox);
                }
            }
        }