Skip to main content
Version: Next

OCAppReviewHandler

#OCAppReviewHandler

It's a util which can be used to display app-store app review prompts inside the application.

##Features

Using a simple view builder function ocRequestInAppReview, we can simply present a in app review prompt. On submitting the review it will directly reflects in the app store.

##Installation

Shipped along with Open Contract Library.

##Usage

  1. Define a @State property to control the trigger point for the InApp review prompt
    @State private var canRequestReview = false
  1. Use the function ocRequestInAppReview() with state property in step 1 as argument to use the review handler
    struct ContentView: View {

@State private var canRequestReview = false

var body: some View {
VStack {
Image(systemName: "globe")
.imageScale(.large)
.foregroundStyle(.tint)
}
.padding()
.onAppear(perform: {
canRequestReview = true
})
.ocRequestInAppReview($canRequestReview)
}
}