通知测试

iOS_release
YouR97 2024-07-19 14:23:24 +08:00
parent b60a4953ed
commit eb5e32e1dd
2 changed files with 12 additions and 3 deletions

@ -1 +1 @@
Subproject commit 438cf8673e7e3ea212683cb534ba8aae243479f8 Subproject commit 95e7db99dcaf0f75185920f6cb15f42ee9a01c18

View File

@ -9,12 +9,21 @@ public partial class SROptions
[Category("通知相关"), DisplayName("通知id")] [Category("通知相关"), DisplayName("通知id")]
public int NotificationID { get; set; } public int NotificationID { get; set; }
/// <summary>
/// 初始化通知
/// </summary>
public void InitNotification()
{
Notification.Init();
}
[Category("通知相关"), DisplayName("发送通知")] [Category("通知相关"), DisplayName("发送通知")]
public void SendNotification() public void SendNotification()
{ {
#if UNITY_ANDROID #if UNITY_ANDROID
int id = Notification.Android.SetNotification("通知", "测试通知", DateTime.UtcNow.AddSeconds(5f), "small", "large", "测试", true); DateTime dateTime = DateTime.UtcNow.AddSeconds(10f);
DebugUtil.Log($"发送安卓测试通知,通知id{id}"); NotificationID = Notification.Android.SetNotification("通知", "测试通知", DateTime.UtcNow.AddSeconds(5f), "small", "large", "测试", true);
DebugUtil.Log($"发送安卓测试通知,通知id:{NotificationID},时间:{dateTime}");
#endif #endif
} }