I was using unity’s “LocalNotification” class to create a local notification and “NotificationServices” class to schedule notification.
My code works fine on ios 7 or ios 6 and both local and remote notifications works.
BUT on ios8 both the local and remote notifications are not coming.
And while scheduling a local notification on ios 8, I get the following warning in the console log.
Below is the console log from xcode 6.0.1
2014-09-30 16:49:04.144 abcapp[588:79364] Attempting to schedule a local notification <UIConcreteLocalNotification: 0x1b0cf6a0>{fire date = Tuesday, 30 September 2014 4:49:34 pm India Standard Time, time zone = (null), repeat interval = 0, repeat count = UILocalNotificationInfiniteRepeatCount, next fire date = Tuesday, 30 September 2014 5:49:34 pm India Standard Time, user info = {
“id” : “currency_offer”
}} with an alert but haven’t received permission from the user to display alerts
→ applicationWillResignActive()
→ applicationDidEnterBackground()
Do anybody know, how to fix this, any way to give permission for notification on ios 8?
This is a bit confusing for someone who has never done any native plugin development. I followed your link and am referring to the Bonjour example found there. I’m pretty sure you’re not saying I just need to put that code into a .m or .mm file in Assets/Plugins/iOS because there’s still more I need to do to connect all the dots right? It’s not entirely clear to me just from your post and from the documentation in that link how it all fits together. Can you give some more info on this?
I don’t get it! What is the difference between ios 8 and ios 6,7? Why can’t we use LocalNotification built-in Unity rather than writing it via native code?
Ahh I see! Good to know! Hm, think I have checked most of the 4.5-versions since iOS 8 release with the same results though… Has anyone got local notifications to work with any Unity version on iOS 8?
You can name the Objective C file “whateveryouwant.mm” and you must put it in Assets/Plugins/iOS.
You can name the CSharp file “whateveryouwant.cs” and place it where ever you want.
You just have to make RegisterNotificationService public and static and call it when you cant to register for notification.
@Mantas-Puida I have this issue with 4.5.5p5 but it only happens on one of two apps. The other app (a simple notifications test app) works fine. Both apps built this morning with 4.5.5p5. The problem app does not show up in Settings|Notifications.
Reported (Case 654628)
EDIT:
Was emailed to say that the bug was reproduced and would be passed on to developers.
Damn! I have this issue in unity 4.6.1p1 (latest patch build)
I’m getting a decent list of Xcode alterations now
Thankfully liven’s code looks like it’s working for me.
Thanks! We identified that there is missing extra API in our NotificationServices API when application is using only local notifications. We are working on a fix.
I’ve implemented it and it is working fine but sound is not coming. I’ve added permission for sound as well but still no luck. Its only happening in ios8+!