Close Menu
  • Home
  • AI
  • Big Data
  • Cloud Computing
  • iOS Development
  • IoT
  • IT/ Cybersecurity
  • Tech
    • Nanotechnology
    • Green Technology
    • Apple
    • Software Development
    • Software Engineering

Subscribe to Updates

Get the latest technology news from Bigteetechhub about IT, Cybersecurity and Big Data.

    What's Hot

    FabCon and SQLCon 2026: Unifying databases and Fabric on a single data platform

    March 29, 2026

    TechCrunch Mobility: When a robotaxi has to call 911

    March 29, 2026

    Microsoft Patch Tuesday, March 2026 Edition – Krebs on Security

    March 29, 2026
    Facebook X (Twitter) Instagram
    Facebook X (Twitter) Instagram
    Big Tee Tech Hub
    • Home
    • AI
    • Big Data
    • Cloud Computing
    • iOS Development
    • IoT
    • IT/ Cybersecurity
    • Tech
      • Nanotechnology
      • Green Technology
      • Apple
      • Software Development
      • Software Engineering
    Big Tee Tech Hub
    Home»iOS Development»ios – Can’t see ratings prompt
    iOS Development

    ios – Can’t see ratings prompt

    big tee tech hubBy big tee tech hubSeptember 4, 2025012 Mins Read
    Share Facebook Twitter Pinterest Copy Link LinkedIn Tumblr Email Telegram WhatsApp
    Follow Us
    Google News Flipboard
    ios – Can’t see ratings prompt
    Share
    Facebook Twitter LinkedIn Pinterest Email Copy Link


    I have the following code to show a ratings prompt when the user comes back to the app a second time and hasn’t seen the prompt. It asks the user to rate my app in the app store. I’m on the latest version of iOS.

    When I call RatingPrompt.trackVisitAndShowPromptIfNeeded(), even though the conditions are met (the user hasn’t seen the prompt and it’s been more than 1 day since they first visited the app), the prompt doesn’t show.

    What am I doing wrong?

    import StoreKit
    import UIKit
    
    struct RatingPrompt {
        private static let firstVisitKey = "firstVisitDate"
        private static let hasShownPromptKey = "hasShownRatingPrompt"
        private static let hasShownAfterFirstSummaryKey = "hasShownAfterFirstSummary"
        
        /// Call when user opens the app / visits a main screen
        static func trackVisitAndShowPromptIfNeeded() {
            let defaults = UserDefaults.standard
            let now = Date()
            
            // Save first visit date
            if defaults.object(forKey: firstVisitKey) == nil {
                defaults.set(now, forKey: firstVisitKey)
                return
            }
            
            // If already shown via visit or summary, do nothing
            if defaults.bool(forKey: hasShownPromptKey) {
                return
            }
            
            // Check if at least 1 day passed
            if let firstVisit = defaults.object(forKey: firstVisitKey) as? Date {
                let oneDay: TimeInterval = 60 * 60 * 24
                if now.timeIntervalSince(firstVisit) >= oneDay {
                    requestReview()
                    defaults.set(true, forKey: hasShownPromptKey)
                }
            }
        }
        
        /// Call when user reads their first book summary
        static func trackFirstSummaryRead() {
            let defaults = UserDefaults.standard
            
            // If already shown, do nothing
            if defaults.bool(forKey: hasShownPromptKey) || defaults.bool(forKey: hasShownAfterFirstSummaryKey) {
                return
            }
            
            // Show immediately on first summary read
            requestReview()
            defaults.set(true, forKey: hasShownAfterFirstSummaryKey)
            defaults.set(true, forKey: hasShownPromptKey) // ensure it won't show again
        }
        
        /// Internal helper to request review
        private static func requestReview() {
            if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene,
                let window = windowScene.windows.first {
                SKStoreReviewController.requestReview(in: window.windowScene!)
            }
        }
    }
    



    Source link

    iOS prompt ratings
    Follow on Google News Follow on Flipboard
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email Copy Link
    tonirufai
    big tee tech hub
    • Website

    Related Posts

    ios – How to change toolbar title color in SwiftUI when running on macOS Catalyst?

    March 29, 2026

    ios – Is using DispatchSemaphore in applicationWillTerminate to complete a network request safe for App Store review?

    March 28, 2026

    5+ Things to Know About the Siri Chatbot Coming in iOS 27

    March 28, 2026
    Add A Comment
    Leave A Reply Cancel Reply

    Editors Picks

    FabCon and SQLCon 2026: Unifying databases and Fabric on a single data platform

    March 29, 2026

    TechCrunch Mobility: When a robotaxi has to call 911

    March 29, 2026

    Microsoft Patch Tuesday, March 2026 Edition – Krebs on Security

    March 29, 2026

    The biggest barrier to more sustainable diets: Affordability

    March 29, 2026
    About Us
    About Us

    Welcome To big tee tech hub. Big tee tech hub is a Professional seo tools Platform. Here we will provide you only interesting content, which you will like very much. We’re dedicated to providing you the best of seo tools, with a focus on dependability and tools. We’re working to turn our passion for seo tools into a booming online website. We hope you enjoy our seo tools as much as we enjoy offering them to you.

    Don't Miss!

    FabCon and SQLCon 2026: Unifying databases and Fabric on a single data platform

    March 29, 2026

    TechCrunch Mobility: When a robotaxi has to call 911

    March 29, 2026

    Subscribe to Updates

    Get the latest technology news from Bigteetechhub about IT, Cybersecurity and Big Data.

      • About Us
      • Contact Us
      • Disclaimer
      • Privacy Policy
      • Terms and Conditions
      © 2026 bigteetechhub.All Right Reserved

      Type above and press Enter to search. Press Esc to cancel.