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
- Define a @State property to control the trigger point for the InApp review prompt
@State private var canRequestReview = false
- 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)
}
}