public void Dismiss()
        {
            navigationService.ChangePresentation(
                ToggleRatingViewVisibilityHint.Hide()
                );

            if (impressionSubject.Value == null)
            {
                return;
            }

            if (impressionSubject.Value.Value)
            {
                onboardingStorage.SetRatingViewOutcome(RatingViewOutcome.AppWasNotRated, timeService.CurrentDateTime);
                analyticsService.RatingViewSecondStepDontRate.Track();
                analyticsService.UserFinishedRatingViewSecondStep.Track(RatingViewSecondStepOutcome.AppWasNotRated);
            }
            else
            {
                onboardingStorage.SetRatingViewOutcome(RatingViewOutcome.FeedbackWasNotLeft, timeService.CurrentDateTime);
                analyticsService.RatingViewSecondStepDontSendFeedback.Track();
                analyticsService.UserFinishedRatingViewSecondStep.Track(RatingViewSecondStepOutcome.FeedbackWasNotLeft);
            }

            impressionSubject.OnNext(null);
        }
Beispiel #2
0
 private void hideRatingViewIfStillVisibleAfterDelay()
 {
     if (shouldHideRatingViewIfStillVisible)
     {
         shouldHideRatingViewIfStillVisible = false;
         navigationService.ChangePresentation(ToggleRatingViewVisibilityHint.Hide());
     }
 }
Beispiel #3
0
        private void presentRatingViewIfNeeded(bool shouldBevisible)
        {
            if (!shouldBevisible)
            {
                return;
            }

            var wasShownMoreThanOnce = onboardingStorage.NumberOfTimesRatingViewWasShown() > 1;

            if (wasShownMoreThanOnce)
            {
                return;
            }

            var lastOutcome = onboardingStorage.RatingViewOutcome();

            if (lastOutcome != null)
            {
                var thereIsInteractionFormLastTime = lastOutcome != RatingViewOutcome.NoInteraction;
                if (thereIsInteractionFormLastTime)
                {
                    return;
                }
            }

            var lastOutcomeTime = onboardingStorage.RatingViewOutcomeTime();

            if (lastOutcomeTime != null)
            {
                var oneDayHasNotPassedSinceLastTime = lastOutcomeTime + TimeSpan.FromHours(24) > TimeService.CurrentDateTime;
                if (oneDayHasNotPassedSinceLastTime && !wasShownMoreThanOnce)
                {
                    return;
                }
            }

            navigationService.ChangePresentation(ToggleRatingViewVisibilityHint.Show());
            analyticsService.RatingViewWasShown.Track();
            onboardingStorage.SetDidShowRatingView();
            onboardingStorage.SetRatingViewOutcome(RatingViewOutcome.NoInteraction, TimeService.CurrentDateTime);
            TimeService.RunAfterDelay(TimeSpan.FromMinutes(ratingViewTimeout), () =>
            {
                shouldHideRatingViewIfStillVisible = true;
                navigationService.ChangePresentation(ToggleRatingViewVisibilityHint.Hide());
            });
        }
Beispiel #4
0
 private void hide()
 {
     navigationService.ChangePresentation(
         ToggleRatingViewVisibilityHint.Hide()
         );
 }