I want to create a new LocalNotification, so, when i try to create a new object:
LocalNotification ln = new LocalNotification();
My ln object has no attributes nor methods, and Mono shows me a tip saying that LocalNotification is deprecated and I should use iOS.LocalNotification instead.
When i try to use
iOS.LocalNotification ln = new iOS.LocalNotification()
Mono highlights LocalNotification with red, showing that iOS, does’t contain a definition for it, in fact, it has no definitions at all.
Anyone has any idea on how to get LocalNotifications working on Unity3D 5?
I found this error too. It seems as though Unity hasn’t exactly deprecated UnityEngine.LocalNotification, it’s more like it’s been moved into a new namespace: UnityEngine.iOS.LocalNotification. You can get around it by adding this line to the top of your code:
using LocalNotification = UnityEngine.iOS.LocalNotification;
Basically, this is telling the compiler that whenever a variable of type LocalNotification is declared, don’t look at UnityEngine.LocalNotification, instead look at UnityEngine.iOS.LocalNotification.
I’m not an iOS dev, but LocalNotification can be seen perfectly fine in my Unity v5.1.0f3 using full unambiguous path:
UnityEngine.iOS.LocalNotification ln = new UnityEngine.iOS.LocalNotification();