In-App purchase(Subscription) handling

Hello! I am a newbie here and I appreciate your works! I love Parse so much!

I am about to launch our app but we need to have a purchase logic. We need to provide users with purchasing subscriptions so that users can watch the premium videos or sth.

I am thinking to add the subscription role so that we can put people who purchased into there, and we can give permissions that being the premium user. I am struggling with this because I am not sure if it is the right way or there is a better way in this situation.

Please comment me :slight_smile:

It looks a good solution imho. You will probably want to separate the public data (the info about the premium movies that free users can see) in a separate class maintaining a pointer between them. Why are you struggling with this?

1 Like

Thanks for commenting, first. Have a good day davimacedo!

The point is that we need to revoke and enroll the role depending on how many months they will subscribe.
For example, if the user [Bob] purchases 3months of premium subscription, I want him to be the [Premeium Role] only for 3months.
I am curious about If it is possible to make this logic by using [Parse.Cloud.Job] or if there is a more efficient way to make it.

Parse.Cloud.job can be a solution. Or you can have an expiration date in the User class, and a beforeFind trigger to the PremiumVideo class to check the expiration date and return in the case it is expired.

1 Like

Oh… there was a beforeFind trigger. Should have read the docs deeply. Thanks a lot!
Me will try it