Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Bug Check if free trial has been used on Android with Unity IAP

Discussion in 'Unity IAP' started by td-ys, Feb 13, 2023.

  1. td-ys

    td-ys

    Joined:
    Jan 25, 2022
    Posts:
    7
    Our application is using Unity IAP and allows users to make multiple accounts. Let's say a user purchases a subscription plan with a free trial in our application through Google Play, thus consuming the free trial.

    Once the free trial expires, the user creates a new account. The app shows subscription plans with free trial since the backend sees it as a new account and doesn't know that they're no longer eligible for a free trial in Google Play.

    Is there a way to check through Unity IAP if the user is eligible for a free trial? I found some information here regarding checking subscription offers: https://stackoverflow.com/a/75012303

    However, this is available through Google Play Billing v5, which Unity IAP still doesn't support. Is there a way to do it through v4, and if so, how? I have searched the documentation up and down and came up empty-handed. I would appreciate any insight - thanks in advance!
     
    jason-vreps likes this.
  2. Arnaud_Gorain

    Arnaud_Gorain

    Unity Technologies

    Joined:
    Jun 28, 2022
    Posts:
    184
    Hi @td-ys,
    You might want to look at the subscription and see the available attributes (Google documentation), I did not find a reference for the tags attribute. But maybe there is still a workaround with the current attribute.

    Google Play Billing v5 will be soon supported by Unity IAP, so it could still be the alternative you want.
     
  3. td-ys

    td-ys

    Joined:
    Jan 25, 2022
    Posts:
    7
    Hi @agorain, thanks for the reply. The issue with checking the subscription is that queryPurchasesAsync returns only active subscriptions. I would also like to check the free trial state if the subscription expired.
     
  4. Arnaud_Gorain

    Arnaud_Gorain

    Unity Technologies

    Joined:
    Jun 28, 2022
    Posts:
    184
    From here: