53 lines
1.9 KiB
C#
53 lines
1.9 KiB
C#
using System.ComponentModel;
|
|
using System;
|
|
#if UNITY_ANDROID
|
|
using Unity.Notifications.Android;
|
|
#endif
|
|
|
|
public partial class SROptions
|
|
{
|
|
//25/2/20 关闭DEBUGGER功能
|
|
//
|
|
// [Category("通知相关"), DisplayName("通知id")]
|
|
// public int NotificationID { get; set; }
|
|
//
|
|
// [Category("通知相关"), DisplayName("初始化通知")]
|
|
// public void InitNotification()
|
|
// {
|
|
// Notification.Init();
|
|
// }
|
|
//
|
|
// [Category("通知相关"), DisplayName("发送通知")]
|
|
// public void SendNotification()
|
|
// {
|
|
//#if UNITY_ANDROID
|
|
// NotificationID = Notification.Android.SetNotification("通知", "测试通知", DateTime.UtcNow.AddSeconds(5f), "small", "large", "测试", true);
|
|
// DebugUtil.Log($"发送安卓测试通知,通知id{NotificationID}");
|
|
//#endif
|
|
// }
|
|
//
|
|
// [Category("通知相关"), DisplayName("取消指定id通知")]
|
|
// public void CancelNotification()
|
|
// {
|
|
//#if UNITY_ANDROID
|
|
// Notification.Android.CancelNotification(NotificationID);
|
|
// DebugUtil.Log($"取消安卓测试通知,通知id{NotificationID}");
|
|
//#endif
|
|
// }
|
|
//
|
|
// [Category("通知相关"), DisplayName("获取指定id通知状态")]
|
|
// public void GetNotificationStatus()
|
|
// {
|
|
//#if UNITY_ANDROID
|
|
// NotificationStatus notificationStatus = Notification.Android.GetNotificationStatus(NotificationID);
|
|
// string content = notificationStatus switch
|
|
// {
|
|
// NotificationStatus.Unavailable => "无法确定指定通知的状态。仅支持 Android Marshmallow (6.0) 及以上版本。",
|
|
// NotificationStatus.Scheduled => $"id为{NotificationID}的通知已排定但尚未送达。",
|
|
// NotificationStatus.Delivered => $"id为{NotificationID}的通知已发送(显示在状态栏中)。",
|
|
// _ => $"找不到指定id为{NotificationID}的通知。",
|
|
// };
|
|
// DebugUtil.Log(content);
|
|
//#endif
|
|
// }
|
|
} |