- Home /
Is there still an issue with LocalNotifications in Unity 5?
Hi, I saw a couple threads like this: http://issuetracker.unity3d.com/issues/local-notifications-are-not-working-on-ios-8 and http://forum.unity3d.com/threads/local-notification-not-working-in-ios-8-unity4-5-4-xcode6-0-1.271487/ and am wondering if it's still an issue in 5. A responder said it was fixed, but I'm having issues.
In my Start(), I call:
#if UNITY_IPHONE
iOS.NotificationServices.RegisterForNotifications(iOS.NotificationType.Alert);
#endif
and in another function, I call:
Debug.Log("ALERT!!!");
var tornadoAlert: iOS.LocalNotification = new iOS.LocalNotification();
tornadoAlert.alertAction = "Alert!";
tornadoAlert.alertBody = "tornado test!";
tornadoAlert.soundName = "tornado_alert";
tornadoAlert.fireDate = Date.Now.AddSeconds(2);
iOS.NotificationServices.ScheduleLocalNotification(tornadoAlert);
But it doesn't work. The editor will log the debug message, but the Xcode console will not. Any ideas?
Thanks!
: jesse
Answer by pallusaimonish · Jan 14, 2016 at 10:39 AM
Hey try using UnityEngine.iOS.NotificationServices.ScheduleLocalNotification(notif);
It worked for me
Your answer
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Problem in Register for remote notifications 0 Answers
Remote Notifications - Triggered by user or not 2 Answers
Not able to receive notifications in all devices 0 Answers
Create Notification Service Extension using PostProcessBuild Script for Xcode 10 0 Answers