Push: global usings
This commit is contained in:
parent
c8e4ea7cec
commit
7f38657ce6
@ -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;
|
||||
@ -162,3 +164,6 @@ global using Telegram.Bot;
|
||||
global using static ASC.Security.Cryptography.EmailValidationKeyProvider;
|
||||
|
||||
global using JsonIgnoreAttribute = System.Text.Json.Serialization.JsonIgnoreAttribute;
|
||||
global using FirebaseAdminMessaging = FirebaseAdmin.Messaging;
|
||||
global using FirebaseApp = FirebaseAdmin.FirebaseApp;
|
||||
global using AppOptions = FirebaseAdmin.AppOptions;
|
||||
|
@ -26,7 +26,6 @@
|
||||
|
||||
namespace ASC.Core.Common.Notify.Push;
|
||||
|
||||
|
||||
[Scope]
|
||||
public class FirebaseDao
|
||||
{
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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")]
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user