- Home /
iOS LocalNotifications Not Changable
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.
Your answer
Follow this Question
Related Questions
Create Notification Service Extension using PostProcessBuild Script for Xcode 10 0 Answers
iOS local notifications never appear 1 Answer
Not able to receive notifications in all devices 0 Answers
[iOS] NotificationServices.localNotifications is empty when game is minimized 1 Answer
Clearing Notifications from the Notification Center from C# 0 Answers