In-app purchase step-by-step

Hello everyone,

I’ve just discovered the in-app purchase component in the marketplace. This is huge! Congrats and thank you to all of the Adalo team for putting that out!

It arrives at a perfect timing for me as I’m still planning on releasing one of my project, a quiz app. I’ll try several models but I’m curious to try the subscription one: free, 1 month and 1 year.

This post will be my public try of the component, I’ll write as I implement and try. I might need help. Feel free to get inspired and maybe help, the thread might go to the Resources section :slight_smile:

Feature definition

First, I need to think of the feature I want to make paid. In my case I’ll limit the number of questions answered at 30 per months. So there would be three types of subscriptions :

  • the automatic and free one “Free plan”
  • the one month subscription “Subscribed one month”
  • the one year subscription “Subscribed one year”

So in practice :

  • I’ll add an action so that each time the user answers a question, the “TotalAnsweredQuestions” variable, set in the “Users” collection adds +1. But this will count only sometimes, when the logged in user variable “Subscription” is equal to “Not-subscribed”
  • When the logged in user reaches 30 questions, I’ll drive him to the subscription screen when he attempts to play again

Subscription screen

I first wonder if I need to have two component as I have 2 subscriptions (1 month and 1 year). Here is the subscription screen with two IAP components for 2 subscriptions model.

I need to add actions to update the status of the user when purchase is successful :

  • Update logged in user variable “Subscription” to “Subscribed one month”
  • Update logged in user variable “Subscription” to “Subscribed one year”

Restrict access to non-subscribers and Grant access to subscribers

On my Home screen, when users select a topic to play, I’ll add three actions :

  • link to QuizScreen only sometimes, when “TotalAnsweredQuestions” is below 30 ; and
  • link to QuizScreen only sometimes, when the variables “Subscription” contains “Subscribed”
  • link to Subscription screen, always

Reset the free counter

I want the non-subscribed user’s quota of free quizzes to be reset to 0 every months.

Renew the subscription

When the one month or one year subscription ends, I want to user to be back to “Free plan”.

I am wondering if this can be set up in the IAP component actions as “Actions when purchase was cancelled by the user” ?

1 Like

Hello,

For having created an app with monthly and annual access (but which is not yet live), I believe that your collection is missing an expiry date column.

When a user subscribes for a month, one of the button actions should add 30 days to the deadline. When he subscribes for one year, the date will be pushed back 365 days.

Thus, the content will be visible according to the current date and the subscription deadline of each user.

1 Like

Hi @adilsasse

Thank you for you input. Indeed, it is in the “Renew the subscription” part.

I’ve seen that auto renewing subscription is not yet supported.

So should I add a “Subscription date” and add an action to the Home Screen so that when 30days/365 days have elapse since the subscription date, the “Subscription status” is set to “Free plan” ?

It would be the same idea for the “Reset the free counter” : when 30 days elapse, TotalAnsweredQuestions” is set to 0 and Free Plan users can play again.

I’m still working on that as I’ve never use a feature that is based on time lapse.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.