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;
|
||||||
global using AutoMapper.QueryableExtensions;
|
global using AutoMapper.QueryableExtensions;
|
||||||
|
|
||||||
|
global using Google.Apis.Auth.OAuth2;
|
||||||
|
|
||||||
global using MailKit.Security;
|
global using MailKit.Security;
|
||||||
|
|
||||||
global using Microsoft.AspNetCore.Http;
|
global using Microsoft.AspNetCore.Http;
|
||||||
@ -162,3 +164,6 @@ global using Telegram.Bot;
|
|||||||
global using static ASC.Security.Cryptography.EmailValidationKeyProvider;
|
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;
|
||||||
|
@ -26,7 +26,6 @@
|
|||||||
|
|
||||||
namespace ASC.Core.Common.Notify.Push;
|
namespace ASC.Core.Common.Notify.Push;
|
||||||
|
|
||||||
|
|
||||||
[Scope]
|
[Scope]
|
||||||
public class FirebaseDao
|
public class FirebaseDao
|
||||||
{
|
{
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||||
|
|
||||||
namespace ASC.Core.Common.Notify.Push.Dao;
|
namespace ASC.Core.Common.Notify.Push.Dao;
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class NotifyData
|
public class NotifyData
|
||||||
{
|
{
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||||
|
|
||||||
namespace ASC.Core.Common.Notify.Push.Dao;
|
namespace ASC.Core.Common.Notify.Push.Dao;
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class NotifyFileData
|
public class NotifyFileData
|
||||||
{
|
{
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||||
|
|
||||||
namespace ASC.Core.Common.Notify.Push.Dao;
|
namespace ASC.Core.Common.Notify.Push.Dao;
|
||||||
|
|
||||||
public class NotifyFolderData
|
public class NotifyFolderData
|
||||||
{
|
{
|
||||||
[JsonProperty("id")]
|
[JsonProperty("id")]
|
||||||
|
@ -24,13 +24,6 @@
|
|||||||
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
|
// 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
|
// 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;
|
namespace ASC.Core.Common.Notify.Push;
|
||||||
|
|
||||||
[Scope]
|
[Scope]
|
||||||
@ -107,18 +100,18 @@ public class FirebaseHelper
|
|||||||
{
|
{
|
||||||
if ((bool)fb.IsSubscribed)
|
if ((bool)fb.IsSubscribed)
|
||||||
{
|
{
|
||||||
var m = new FirebaseAdmin.Messaging.Message()
|
var m = new FirebaseAdminMessaging.Message()
|
||||||
{
|
{
|
||||||
Data = new Dictionary<string, string>{
|
Data = new Dictionary<string, string>{
|
||||||
{ "data", msg.Data }
|
{ "data", msg.Data }
|
||||||
},
|
},
|
||||||
Token = fb.FirebaseDeviceToken,
|
Token = fb.FirebaseDeviceToken,
|
||||||
Notification = new Notification()
|
Notification = new FirebaseAdminMessaging.Notification()
|
||||||
{
|
{
|
||||||
Body = msg.Content
|
Body = msg.Content
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
FirebaseMessaging.DefaultInstance.SendAsync(m);
|
FirebaseAdminMessaging.FirebaseMessaging.DefaultInstance.SendAsync(m);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user