- Home /
Question by
patdev · Sep 22, 2017 at 10:46 AM ·
iosnotifications
iOS.LocalNotification not saving variables after being set
I tried to configure an iOS. LocalNotification, but it looks like is not saving the fields. What's wrong?
UnityEngine.iOS.LocalNotification notification = new UnityEngine.iOS.LocalNotification();
notification.alertAction = "Alert Action Title";
notification.fireDate = new DateTime(2017, 10, 1);
Debug.Log("Notification alert action: " + notification.alertAction);
Debug.Log("Notification fire date: " + notification.fireDate);
Output:
Notification alert action:
Notification fire date: 01/01/2001 00:00:00
Using Unity 5.5.1p1 Thanks.
Comment
Answer by patdev · Sep 25, 2017 at 08:34 AM
Solved. Turns out that iOS.LocalNotification only works when executing on an iOS device. If you execute it from the editor, ti will keep it's variables to default values, making it impossible to debug from within the editor.
Your answer
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
iOS push notifications via Parse.com 2 Answers
Local Notification on android and ios every 24 hours 1 Answer
iOS Setting Icon Badge Number With Local Notification 1 Answer
Firebase Cloud Messaging on Ios not working (but working on Android) 2 Answers