C# Unity如何安排2个通知
嗨,伙计们,我有一个问题,如果有办法安排每天发送2个通知。一次是早上7点,一次是下午5点,我尝试了一些方法,但我唯一的收获是,这些通知中只有一个被发送了C# Unity如何安排2个通知,c#,unity3d,C#,Unity3d,嗨,伙计们,我有一个问题,如果有办法安排每天发送2个通知。一次是早上7点,一次是下午5点,我尝试了一些方法,但我唯一的收获是,这些通知中只有一个被发送了 var timeTrigger = new iOSNotificationCalendarTrigger() { Hour = 07, Repeats = true }; var notification =
var timeTrigger = new iOSNotificationCalendarTrigger()
{
Hour = 07,
Repeats = true
};
var notification = new iOSNotification()
{
Identifier = "_notification_01",
Title = "Nova misija je na voljo!",
Body = "Eno dobro delo na dan pomeni veliko.",
Subtitle = "Dobro jutro! Odklenila se je nova misija. Pridi in poglej.",
ShowInForeground = true,
ForegroundPresentationOption = (PresentationOption.Alert | PresentationOption.Sound),
CategoryIdentifier = "category_a",
ThreadIdentifier = "thread1",
Trigger = timeTrigger,
};
iOSNotificationCenter.ScheduleNotification(notification);
这是我用来安排通知的代码,每当应用程序关闭时,我都会调用它,所以在OnApplicationPause方法中。我有另一个类似的方法,使用不同时间的代码,但它不起作用。有什么建议吗?什么是“IONotificationCalendarTrigger()”方法?