Skip to content

Conversation

@jayana-cpc
Copy link
Collaborator

@jayana-cpc jayana-cpc commented Sep 30, 2025

  • Created ReviewPrompter.swift to track information relating to review prompting such lastPromptDate, promptCountPastYear, and successfulEventCount
  • Increase successfulEventCount when the user completes certain actions in the app
  • Prompt for review after successfulEventCount is greater than 3 and other criteria fulfilled

@jayana-cpc jayana-cpc linked an issue Sep 30, 2025 that may be closed by this pull request
@@ -91,6 +91,7 @@ struct EventDetailView: View {
withoutAnimation {
eventsViewModel.alert = BMAlert(title: "Open in Safari?", message: message, type: .action) {
UIApplication.shared.open(url)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove newline

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is still a newline in the commit

return false
}
func presentReviewIfNeeded() {
guard shouldPromptForReview() else { return }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For guard statements have the return on a new line. Like something like this:

guard shouldPromptForReview() else {
    return
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the return isn't on a new line still

@Chhumbucket Chhumbucket self-requested a review October 14, 2025 04:37
Chhumbucket
Chhumbucket previously approved these changes Nov 5, 2025
Copy link
Collaborator

@justinwongeecs justinwongeecs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of the resolved changes were not reflected in the code?

private static func shouldPromptForReview() -> Bool {
let key = UserDefaultsKeys.numAppLaunchForAppStoreReview.rawValue
let launches = UserDefaults.standard.integer(forKey: key)
print("DEBUG: ",launches)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove print statement

return false
}
func presentReviewIfNeeded() {
guard shouldPromptForReview() else { return }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the return isn't on a new line still

@@ -91,6 +91,7 @@ struct EventDetailView: View {
withoutAnimation {
eventsViewModel.alert = BMAlert(title: "Open in Safari?", message: message, type: .action) {
UIApplication.shared.open(url)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is still a newline in the commit

Comment on lines -13 to 14

// MainDrawerViewDelegate properties
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this change?

if let scene = UIApplication.shared.connectedScenes
.first(where: { $0.activationState == .foregroundActive }) as? UIWindowScene {
AppStore.requestReview(in: scene)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove newline

import StoreKit
import UIKit

enum ReviewPrompter {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is ReviewPrompter an enum?

Shouldn't it be a class instead? Perhaps a singleton? https://developer.apple.com/documentation/swift/managing-a-shared-resource-using-a-singleton

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show App Store Rating & Review Prompt

4 participants