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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

How do you set the timeZone property on the iOS.LocalNotification?

Discussion in 'iOS and tvOS' started by KarlShifflett, Jun 17, 2015.

  1. KarlShifflett

    KarlShifflett

    Joined:
    Feb 27, 2015
    Posts:
    38
    I'm using C#.

    I'm using the Unity iOS.LocalNotification object.

    I fully understand I have to set the timeZone property on this object.

    How, what format is this property?

    Can I use .NET TimeZone.CurrentTimeZone Property value?

    The documentation is worthless without any examples or explanation.

    I'm asking because .NET and IOS probably have different ways to express a time zone.

    Thank you!

    Karl
     
  2. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    Try looking at Apple's docs for local notifications, there might be information there that will help.
     
  3. KarlShifflett

    KarlShifflett

    Joined:
    Feb 27, 2015
    Posts:
    38
    Yes this is what the Apples docs use for an example:

    localNotif.timeZone = [NSTimeZone defaultTimeZone];

    Unity docs don't explain exactly what we need to set the Unity iOS.LocalNotification.timeZone property to so that it will be scheduled for the local time zone.
     
  4. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    Well I've done a lot of work with the local notifications and I have never set that property so I guess you can just ignore it.
     
  5. KarlShifflett

    KarlShifflett

    Joined:
    Feb 27, 2015
    Posts:
    38
    OK, that solves my problem for now. Thank you! Other posts have indicated that it you don't set it, you notification is scheduled for GMT time. Guessing now, that may not be the current behavior.