When creating a new Local Notification in JavaScript, my code is the following:
import UnityEngine.iOS;
function CreateNotification(date : System.DateTime){
var notif = new iOS.LocalNotification();
notif.fireDate = date;
notif.applicationIconBadgeNumber = 1;
notif.hasAction = false;
notif.alertBody = "Text here";
iOS.NotificationServices.ScheduleLocalNotification(notif);
Debug.Log(iOS.NotificationServices.scheduledLocalNotifications);
}
When the code runs, the log shows an empty LocalNotifications array, and if I output any info from the notification itself (fireDate, hasAction, alertBody, etc.) they are all set to default values.
It seems like my LocalNotification variable can't be changed. Is there anything I am doing wrong or is this a problem with the Unity LocalNotifications system? Thanks.
↧