SKOverlay in SwiftUI
Recommend other apps to users and let them download the app instantly
At WWDC 2020, Apple introduced SKOverlay
with which you can recommend other apps to users and allow them to download the app immediately.
Do note that you will not be able to use this on an app extension.
SKOverlay
is super useful to advertise your other apps to users.
“A class that displays an overlay you can use to recommend another app.” — Apple Developer
Prerequisites
To follow along with this tutorial, you’ll need some basic knowledge in:
- Swift
- At least Xcode 12+
Note: This only supports iOS 14+.
Getting Started With SKOverlay
To begin, you will need to import the required framework:
import StoreKit
Then create a State
to hold a bool
value:
@State private var showRecommended = false
Next, insert a Button
that will show SKOverlay
when clicked: