Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

LocalNotification IOS 8

Discussion in 'iOS and tvOS' started by GooDLo, Oct 6, 2014.

  1. GooDLo

    GooDLo

    Joined:
    Jun 6, 2014
    Posts:
    7
    Hi all,
    I have a problem with IOS 8 LocalNotification using Unity for IOS, IOS-7 work perfectly, there has been some change in the IOS 8 for not work?
    Do not ask me not to start if you want to allow notifications but IOS 7 Yes.
    I'm using Xcode 6.

    Regards!
     
  2. Mantas-Puida

    Mantas-Puida

    Unity Technologies

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    Fixes are scheduled for next week's patch release.
     
  3. iamanders

    iamanders

    Joined:
    Oct 19, 2014
    Posts:
    5
    I am having the exact same problem here. Unity 4.5.5.
     
  4. Luke-Kellett

    Luke-Kellett

    Joined:
    Oct 22, 2011
    Posts:
    9
    Mantas, is there an update on this one? The 4.5.5p2 patch released on the 16th makes no mention of a fix for this problem...
     
  5. Tripwire

    Tripwire

    Joined:
    Oct 12, 2010
    Posts:
    442
    Create an mm file and add this code:

    Code (CSharp):
    1. extern "C"
    2. {
    3.  
    4.     void _EnableLocalNotificationIOS8()
    5.     {
    6.            UIApplication *app = [UIApplication sharedApplication];
    7.            if ([app respondsToSelector:@selector(registerUserNotificationSettings:)])
    8.         {
    9.             UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound categories:nil];
    10.             [app registerUserNotificationSettings:settings];
    11.             [app registerForRemoteNotifications];
    12.         }
    13.     }
    14. }
    Add the created file to your Plugins/iOS folder. This is a workaround till it gets fixed.
     
  6. Luke-Kellett

    Luke-Kellett

    Joined:
    Oct 22, 2011
    Posts:
    9
    I'm actually running that exact same code :)

    I think Unity needs to give a bit more love to NotificationServices, especially to give us the ability to know which if any notification was used to open the game!
     
  7. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    You can do this via the userInfo property.
     
  8. iamanders

    iamanders

    Joined:
    Oct 19, 2014
    Posts:
    5
    Just tested the latest patch release (4.5.5p2) and I am still getting the same error. Is this still not fixed?