/// <summary> /// 通知を送信する。 /// </summary> /// <param name="title">タイトル。</param> /// <param name="detail">詳細。</param> /// <param name="notificationTime">通知時間。</param> /// <param name="notificationId">通知ID。</param> /// <param name="isRepeat">繰り返し通知するか。</param> /// <param name="repeatInterval">繰り返し通知間隔。</param> static public void SendNotification(string title, string detail, DateTime notificationTime, int notificationId, bool isRepeat = false, TimeSpan?repeatInterval = null) { #if UNITY_ANDROID if (isRepeat && repeatInterval != null) { AndroidNotificationController.SendRepeatAndroidNotification(title, detail, notificationTime, notificationId, repeatInterval); } else { AndroidNotificationController.SendAndroidNotification(title, detail, notificationTime, notificationId); } #elif UNITY_IOS IOSNotificationController.SendIOSNotification(title, detail, notificationTime, notificationId.ToString(), isRepeat); #endif }
/// <summary> /// 通知を送信する。 /// </summary> /// <param name="title">タイトル。</param> /// <param name="detail">詳細。</param> /// <param name="notificationTimeInterval">通知までの時間。</param> /// <param name="notificationType">通知タイプ。</param> /// <param name="isRepeat">繰り返し通知するか。</param> /// <param name="repeatInterval">繰り返し通知間隔。</param> static public void SendNotification(string title, string detail, TimeSpan notificationTimeInterval, Notifications notificationType, bool isRepeat = false, TimeSpan?repeatInterval = null) { var notificationId = ToIdNotifications(notificationType); var notificationTime = DateTime.Now + notificationTimeInterval; #if UNITY_ANDROID if (isRepeat && repeatInterval != null) { AndroidNotificationController.SendRepeatAndroidNotification(title, detail, notificationTime, notificationId, repeatInterval); } else { AndroidNotificationController.SendAndroidNotification(title, detail, notificationTime, notificationId); } #elif UNITY_IOS IOSNotificationController.SendIOSNotification(title, detail, notificationTimeInterval, notificationId.ToString(), isRepeat); #endif }