Skip to content

berkiyo/restart-prompt-view

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

restart-prompt-view

Basic app restart prompt for iOS Swift apps -- best used after a user has purchased an upgrade

Usage

In your main view (e.g. HomeView.swift) create a variable like so:

@State private var showRestartPrompt = false

Then, you can call it like so (e.g. after a ZStack, ScrollView, etc):

.sheet(isPresented: $showRestartPrompt) {
                RestartPromptView()
            }
.onChange(of: showPaywall) { _, isPresented in
    if !isPresented {  // When paywall is dismissed
        Purchases.shared.getCustomerInfo { customerInfo, error in
            if let info = customerInfo, !info.entitlements.active.isEmpty {
                showRestartPrompt = true
            }
        }
    }
}
// There are some subtle references to RevenueCat

About

Basic app restart prompt for iOS Swift apps -- best used after a user has purchased an upgrade

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages