I tried the new mobile notification for my game app but as i follow the unity document, only when the firetime is DateTime.Now i received a noti. FireTime with extra seconds, minutes or with repeat interval doesn’t work.
private void Start()
{
#if UNITY_ANDROID
var channelNow = new AndroidNotificationChannel()
{
Id = "channel_id_0",
Name = "Default Channel",
Importance = Importance.High,
Description = "Generic notifications"
};
AndroidNotificationCenter.RegisterNotificationChannel(channelNow);
var notificationNow = new AndroidNotification();
notificationNow.Title = "SomeTitle now";
notificationNow.Text = "SomeText";
notificationNow.FireTime = System.DateTime.Now;
notificationNow.Color = Color.red;
AndroidNotificationCenter.SendNotification(notificationNow, "channel_id_0");
var channelDelay = new AndroidNotificationChannel()
{
Id = "channel_id_1",
Name = "Default Channel",
Importance = Importance.High,
Description = "Generic notifications",
};
AndroidNotificationCenter.RegisterNotificationChannel(channelDelay);
var notificationDelay = new AndroidNotification();
notificationDelay.Title = "SomeTitle delay";
notificationDelay.Text = "SomeText";
notificationDelay.FireTime = System.DateTime.Now.AddSeconds(10);
AndroidNotificationCenter.SendNotification(notificationDelay, "channel_id_1");
#endif
}
My unity version is 2019.4.39f1 LTS, Mobile Notifications version 2.0.2
My phone device is Pixel 2XL, android version 11.