UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

Subscriptions and unlocking the UI

Forums > iOS

How would one set up their app so they can unlock UI items once a subscription is purchased? I am looking at Revenuecat to handle subs, but I would like to know what the best practices are around setting up your UI (I'm using SwiftUI btw), so that once the sub is processed, a) the app remembers this and b) makes previously locked UI elements available to the user.

3      

So in Revenuecat docs, there's this bit about checking if a user is subscribed. Is it safe to assume that I could simply set a var to true here, and then reference it anywhere in the app to make items visible/available?

if purchaserInfo.entitlements["your_entitlement_id"]?.isActive == true { // user has access to "your_entitlement_id"
}

https://docs.revenuecat.com/docs/purchaserinfo

3      

HWS+ is doing this woth part 1 out now.

3      

Signed up!

3      

Hacking with Swift is sponsored by RevenueCat

SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.

Learn more here

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.