Is there an easy way to check the status of the user's Subscription on the App Store, or the only way is to do a receipt and Subscription validation?
Asked Answered
R

2

7

Does anyone know the easy way to check if the user already purchased a subscription or not when the app loads?

I just need to check if the user already purchased the subscription, nothing else. Seems easy, but it is not in reality, because I need to validate a receipt and check a subscription date.... The subscription validation technique seems to be not an easy task and I didn't find a good tutorial or a good guide that describes how to implement it step by step. I've read Apple documentation here Is there any easy Local Receipt Validation and Subscription Validation technique to check if the user subscribed or not?

Maybe anyone knows a framework or a method to do it fast? Any help appreciated.

Using: Swift 4, Xcode 9.4

Remindful answered 24/8, 2018 at 14:43 Comment(2)
You can follow this. youtube.com/watch?v=o3hJ0rY1NNw&t=2280s and raywenderlich.com/5456-in-app-purchase-tutorial-getting-startedSpringfield
Thanks Rob, but these tutorials only show how to implement In-App Purchase. I know how to do that. I'm interested in how to check the status of a subscription without using User Defaults. Local receipt validation and subscription validation to check if the user purchased it or notRemindful
S
2

The RevenueCat SDK provides a good out-of-the box solution for this.

More than a couple reasons why I like this approach:

  • Validates receipt server side (without requiring me to set up a server)
  • Checks for an "active" subscription with a server timestamp so can't be spoofed by changing the device clock
  • Caches the result so it's super fast and works offline

There's some more details in this question: https://mcmap.net/q/392089/-check-if-an-auto-renewable-subscription-is-still-valid

Which boils down to:

subscriptionStatus { (subscribed) in
    if subscribed {
        // Show that great pro content
    }
}
Sycophancy answered 28/3, 2019 at 19:32 Comment(0)
S
1

Ok here is your answer. I have also followed this same tutorial and it helped me. I validated the receipt and confirmed that the payment is made. See the link below. Hope it helps.

In App Purchase in Swift, with Receipt Validation

Springfield answered 24/8, 2018 at 14:57 Comment(3)
Links to external resources are encouraged, but please add context around the link so your fellow users will have some idea what it is and why it’s there. Always quote the most relevant part of an important link, in case the target site is unreachable or goes permanently offline.Wonky
link doesn't workLiddle
404 - this is really good (not).Hunkers

© 2022 - 2024 — McMap. All rights reserved.