Search Unity

Can I have multiple subscriptions using Codeless IAP?

Discussion in 'Unity IAP' started by CodeInMotion, Jun 21, 2021.

  1. CodeInMotion

    CodeInMotion

    Joined:
    Jun 1, 2018
    Posts:
    10
    Hi,

    I want to have 3 subscription types in my game:

    1. Weekly
    2. Monthly
    3. Yearly

    Is this possible using Codeless IAP? From what I've heard so far, Codeless IAP only has the option for monthly subscription.

    Thanks
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Yes, you can certainly have multiple subscriptions. They would be separate IAP products on the store, and you would need separate IAP buttons for each one.
     
  3. CodeInMotion

    CodeInMotion

    Joined:
    Jun 1, 2018
    Posts:
    10
    and how would the time be managed?
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    I don't understand the question, please provide a scenario. Clearly you can't have multiple subscription purchases for the same product, but you can certainly offer them to your users. If a user already owns a yearly subscription, you would disable the weekly button for example (if this is for the same product)
     
  5. Endi24

    Endi24

    Joined:
    May 6, 2015
    Posts:
    50
    How would one define the time (monthly, weekly, yearly) using the codeless method?
     
  6. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    You don't, the product subscription length is determined by how you create your product on the Google/Apple dashboards. You create one product for weekly, another for monthly, etc. Then have one button for each. Keep in mind that Codeless doesn't currently fully support subscriptions as you are describing. You'll want to use Scripted IAP instead, see the Sample IAP Project v2 for a working example https://forum.unity.com/threads/sample-iap-project.529555/#post-6950270
     
  7. Endi24

    Endi24

    Joined:
    May 6, 2015
    Posts:
    50
    I understand. So, if I got this correctly, I simply choose (I can even do codeless IAP) subscription button in unity, map the ID correctly, and then configure it monthly (or weekly/yearly) on Play/App Store and I'm done? What if I want to verify if the sub has expired, do I have to check the receipt through code?
     
  8. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    You create the product in the Google store before you define in your app. You do not want to be using Codeless with subscriptions, there is no way to check the receipt. You'll want to use Scripted IAP, perhaps start with the Sample IAP Project. This may help too https://docs.unity3d.com/Packages/com.unity.purchasing@4.0/manual/UnityIAPGoogleConfiguration.html