Question by
Jinfaa1 · Apr 16, 2016 at 02:20 AM ·
notificationnotificationservices
LocalNotification working not correct
Hello i wrote this code:
void NotificationInit(string message,float seconds)
{
UnityEngine.iOS.LocalNotification notification = new UnityEngine.iOS.LocalNotification();
notification.fireDate = System.DateTime.Now.AddSeconds(seconds);
notification.alertBody = message;
notification.hasAction = false;
UnityEngine.iOS.NotificationServices.ScheduleLocalNotification(notification);
Debug.Log(string.Format("NOTIFICATIONS NOW {0}",UnityEngine.iOS.NotificationServices.localNotificationCount));
}
Next, I call this function in a loop:
for(int i = 0 ; i < 3 ; i++)
{
NotificationInit ("test "+i, (int)(DateTime.Now.AddMinutes (1)).TotalSeconds);
}
OUTPUT:
NOTIFICATIONS NOW 0
NOTIFICATIONS NOW 0
NOTIFICATIONS NOW 0
What am I doing wrong?? Please help!
Comment
Your answer
Follow this Question
Related Questions
How do I mute or custom sound Mobile Notification ?? 1 Answer
Sceduled local notifications in iOS 1 Answer
Admob with Firebase Bottom Banner Problem 0 Answers
How to access foreground service of Android in uniy. (For music player) 0 Answers
Cross Platform Native Plugins - Android Notification 1 Answer