Appirater.RatingConditionsHaveBeenMet C# (CSharp) Method

RatingConditionsHaveBeenMet() private method

private RatingConditionsHaveBeenMet ( ) : bool
return bool
    bool RatingConditionsHaveBeenMet()
    {
        if (settings.Debug)
            return true;

        NSUserDefaults userDefaults = NSUserDefaults.StandardUserDefaults;
        DateTime dateOfFirstLaunch = DateTime.FromOADate (userDefaults.DoubleForKey (FIRST_USE_DATE));
        TimeSpan timeSinceFirstLaunch = DateTime.Now.Subtract (dateOfFirstLaunch);
        TimeSpan timeUntilRate = new TimeSpan (settings.DaysUntilPrompt, 0, 0, 0);
        if (timeSinceFirstLaunch < timeUntilRate)
            return false;

        // check if the app has been used enough
        int useCount = userDefaults.IntForKey (USE_COUNT);
        if (useCount < settings.UsesUntiPrompt)
            return false;

        // check if the user has done enough significant events
        int sigEventCount = userDefaults.IntForKey (SIGNIFICANT_EVENT_COUNT);
        if (sigEventCount < settings.SigEventsUntilPrompt)
            return false;

        // has the user previously declined to rate this version of the app?
        if (userDefaults.BoolForKey (DECLINED_TO_RATE))
            return false;

        // has the user already rated the app?
        if (userDefaults.BoolForKey (RATED_CURRENT_VERSION))
            return false;

        // if the user wanted to be reminded later, has enough time passed?
        DateTime reminderRequestDate = DateTime.FromOADate (userDefaults.DoubleForKey (REMINDER_REQUEST_DATE));
        TimeSpan timeSinceReminderRequest = DateTime.Now.Subtract (reminderRequestDate);
        TimeSpan timeUntilReminder = new TimeSpan (settings.TimeBeforeReminding, 0, 0, 0);
        if (timeSinceReminderRequest < timeUntilReminder)
            return false;

        return true;
    }