Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Scheduling notification with Mobile Notifications Package

Discussion in 'iOS and tvOS' started by HosseinArabbeigi, May 6, 2020.

  1. HosseinArabbeigi

    HosseinArabbeigi

    Joined:
    May 7, 2014
    Posts:
    16
    Hi

    How can i schedule a notification to fire in time X and repeat with Y interval?

    i cant see this option for ios notification in documents.

    Here is unity ios notification sample code:

    var timeTrigger = new iOSNotificationTimeIntervalTrigger()
    {
    TimeInterval = new TimeSpan(0, minutes, seconds),
    Repeats = false
    };

    var notification = new iOSNotification()
    {
    // You can optionally specify a custom identifier which can later be
    // used to cancel the notification, if you don't set one, a unique
    // string will be generated automatically.
    Identifier = "_notification_01",
    Title = "Title",
    Body = "Scheduled at: " + DateTime.Now.ToShortDateString() + " triggered in 5 seconds",
    Subtitle = "This is a subtitle, something, something important...",
    ShowInForeground = true,
    ForegroundPresentationOption = (PresentationOption.Alert | PresentationOption.Sound),
    CategoryIdentifier = "category_a",
    ThreadIdentifier = "thread1",
    Trigger = timeTrigger,
    };

    iOSNotificationCenter.ScheduleNotification(notification);
     
    criverot90 and mohamed62 like this.