Push: global usings

This commit is contained in:
Nikolay Rechkin 2022-08-23 13:10:37 +03:00
parent c8e4ea7cec
commit 7f38657ce6
6 changed files with 12 additions and 12 deletions

View File

@ -126,6 +126,8 @@ global using Autofac;
global using AutoMapper;
global using AutoMapper.QueryableExtensions;
global using Google.Apis.Auth.OAuth2;
global using MailKit.Security;
global using Microsoft.AspNetCore.Http;
@ -161,4 +163,7 @@ global using Telegram.Bot;
global using static ASC.Security.Cryptography.EmailValidationKeyProvider;
global using JsonIgnoreAttribute = System.Text.Json.Serialization.JsonIgnoreAttribute;
global using JsonIgnoreAttribute = System.Text.Json.Serialization.JsonIgnoreAttribute;
global using FirebaseAdminMessaging = FirebaseAdmin.Messaging;
global using FirebaseApp = FirebaseAdmin.FirebaseApp;
global using AppOptions = FirebaseAdmin.AppOptions;

View File

@ -26,7 +26,6 @@
namespace ASC.Core.Common.Notify.Push;
[Scope]
public class FirebaseDao
{

View File

@ -25,6 +25,7 @@
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
namespace ASC.Core.Common.Notify.Push.Dao;
[Serializable]
public class NotifyData
{

View File

@ -25,6 +25,7 @@
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
namespace ASC.Core.Common.Notify.Push.Dao;
[Serializable]
public class NotifyFileData
{

View File

@ -25,6 +25,7 @@
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
namespace ASC.Core.Common.Notify.Push.Dao;
public class NotifyFolderData
{
[JsonProperty("id")]

View File

@ -24,13 +24,6 @@
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
using ASC.Core.Common.Notify.Push.Dao;
using FirebaseAdmin;
using FirebaseAdmin.Messaging;
using Google.Apis.Auth.OAuth2;
namespace ASC.Core.Common.Notify.Push;
[Scope]
@ -107,18 +100,18 @@ public class FirebaseHelper
{
if ((bool)fb.IsSubscribed)
{
var m = new FirebaseAdmin.Messaging.Message()
var m = new FirebaseAdminMessaging.Message()
{
Data = new Dictionary<string, string>{
{ "data", msg.Data }
},
Token = fb.FirebaseDeviceToken,
Notification = new Notification()
Notification = new FirebaseAdminMessaging.Notification()
{
Body = msg.Content
}
};
FirebaseMessaging.DefaultInstance.SendAsync(m);
FirebaseAdminMessaging.FirebaseMessaging.DefaultInstance.SendAsync(m);
}
}
}