mirzahat
mirzahat

Reputation: 1025

Swift In App Subscription How to check active status?

This question might have been asked but I did not find a good solution for me.

So: If I want to check if a user is subscribed in my app for a week or month, is there a specific value that says "active" true / false OR do I have to calculate it in code by checking the current timestamp with the start of subscription?

Like: `currentDate - dateSubscribed = daysRemaining

I saw codesampes but I could not determine it from the samples.

Upvotes: 2

Views: 4496

Answers (1)

enc_life
enc_life

Reputation: 5169

Almost. You should check against the expiration_date field and compare that against the current date.

Ideally, you compare the date against a server time instead of the device time which the user can easily change.

If you want a deeper read of checking subscription status for users check out: iOS Subscriptions are Hard

Upvotes: 6

Related Questions