SKOverlay: iOS

You can use SKOverlay to recommend user a certain app, which may or may not be built by you.

Usage of it is pretty simple. First, we need to fetch the iTunes ID. For fetching iTunes ID just open that app’s page in the browser. e.g. for angry birds, we will have https://apps.apple.com/us/app/angry-birds-2/id880047117.

The iTunes ID will be: 880047117

This does not work well in the simulator, hence use the device if possible.

At the time of writing, we can present overlay in two positions:

  1. bottom
  2. bottomRaised

This is very easy-to-present overlay. It can be done as:


import StoreKit

func displayOverlay() {
if #available(iOS 14.0, *) {
guard let scene = view.window?.windowScene else { return }
let config = SKOverlay.AppConfiguration(appIdentifier: "880047117", position: .bottom)
let overlay = SKOverlay(configuration: config)
overlay.present(in: scene)
}
}

That’s it, Folks. Will see you 👋🏻

--

--

No responses yet