Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by varupambu · Jun 13, 2015 at 10:00 PM · iosiphonenotification

LocalNotifications deprecated in Unity 5

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?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by jmorhart · Aug 05, 2015 at 12:19 AM

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.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by DoTA_KAMIKADzE · Jun 13, 2015 at 10:03 PM

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();
Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image varupambu · Jun 13, 2015 at 10:06 PM 0
Share

$$anonymous$$y version is 5.0, and i tried this path too, still no methods.

avatar image DoTA_KAMIKADzE · Jun 13, 2015 at 10:23 PM 0
Share

I'm definitely not going to degrade just to try if the version is a core of a problem. Have you checked if Unity itself gives any errors in console log? $$anonymous$$g. add for example this somewhere in your code:

     UnityEngine.iOS.LocalNotification ln = new UnityEngine.iOS.LocalNotification();
     ln.alertAction = "Something";

then save and switch to Unity Editor and check console, if everything is fine then surely something is wrong with your $$anonymous$$onoDev installation.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

How to know when my game is in background? 1 Answer

iOS Turn Off Push Notifications Pop Up 0 Answers

Simultaneous Android and iOS development 1 Answer

Ran out of trampolines of type 2 - iOS 2 Answers

Device Auto-Rotation 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges