Пример #1
0
        private void OnApplicationPause(bool isPaused)
        {
            if (isPaused)
            {
                // App going to background

                DebugLog($"[NOTIFICATION] app going into background now");
                Crashlytics.Log($"App going into background (Game Controller)");

                // clear previously scheduled alerts
                notificationController.ClearAllNotifications();

                double timeUntilFull = GetSecondsUntilFilmIsFull();
                if (timeUntilFull > 0)
                {
                    notificationController.ScheduleFilmReplenishmentNotification(timeUntilFull);
                }

                // updates miss you alert
                if (!ftueController.ShouldShowOneDayNotification)
                {
                    notificationController.ScheduleOneDayNotification();
                }
            }
            else
            {
                // App is restoring
                Crashlytics.Log($"App restoring from background (Game Controller)");
            }
        }