Search Unity

Changing from codelessIAP to coded IAP

Discussion in 'Unity IAP' started by richardzzzarnold, Feb 14, 2020.

  1. richardzzzarnold

    richardzzzarnold

    Joined:
    Aug 2, 2012
    Posts:
    142
    I had a IAP system that was working fine for consumable products.
    However, now I would like to add a subscription product which appears to add some complexity.
    So I am attempting to change the system from codeless to using the IAPDemo.cs.
    I added the products from the codelessIAP catalogue to the IAPDemo.cs using the builder.AddProduct section.

    However, when I try to initiate a purchase now, i get an error saying that "Purchase is not initialized".
    But in the console, when i start the game,it states : Initializing UnityPurchasing via Codeless IAP

    Any idea what I am doing wrong here?
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Subscriptions are handled just like any other product purchase, there is no difference in the code. You can certainly add a Codeless IAP Button for a subscription. Please share a screenshot of your subscription as defined on your Google Play developer dashboard, and in your project. Also, be sure to be monitoring the device logs which is quite critical to successful IAP development. You might want to check out the Sample IAP Project here https://forum.unity.com/threads/sample-iap-project.529555/ . There is more information on capturing device logs here https://forum.unity.com/threads/how-to-capturing-device-logs-on-android.528680/