Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

SubscriptionInfo NotSupportedException

Discussion in 'Unity IAP' started by kirill66552, Feb 8, 2020.

  1. kirill66552

    kirill66552

    Joined:
    Feb 2, 2020
    Posts:
    2
    Hello everyone!

    I try to insert IAP Subscription in my project, and I have some problems with it, then I try to get info from SubscriptionInfo.

    I used IAPDemo in my project, and when I click 'buy subscription' I get this text:

    buy.PNG
    Do you want to Purchase subscription_trial?
    [Environment: FakeStore]

    Buy
    Cancel



    After, I have code to check status of my subscription

    Code (CSharp):
    1. public void CheckSubscription()
    2.         {
    3. foreach (Product product in m_StoreController.products.all)
    4.             {
    5. Debug.Log(product.receipt);
    6. if(product.receipt != null)
    7.                 {
    8. if(product.definition.type == ProductType.Subscription)
    9.                     {
    10. SubscriptionManager subscriptionManager = new SubscriptionManager(product, null);
    11. SubscriptionInfo info = subscriptionManager.getSubscriptionInfo(); /* <-- Problem is here */
    12. Debug.Log(info.getProductId());
    13. Debug.Log(info.getPurchaseDate());
    14. Debug.Log(info.isSubscribed());
    15.                     }
    16.                 }
    17.             }
    18. }

    Product receipt -> {"Store":"fake","TransactionID":"b5454f4a-b502-4d94-a519-240483c25987","Payload":"{ \"this\" : \"is a fake receipt\" }"}

    When I try to getSubscriptionInfo() Unity return me this error

    Error: StoreSubscriptionInfoNotSupportedException: Store not supported: fake
    error.PNG

    For two days I can't figure out how to fix it, I ask for your help!
     
    Last edited: Feb 9, 2020
  2. SamOYUnity3D

    SamOYUnity3D

    Unity Technologies

    Joined:
    May 12, 2019
    Posts:
    603
    This is the expected behavior because this information is not available in the fake store, you can get it on Google or Apple platforms. More information about getSubscriptionInfo can be seen in the IAP manual: https://docs.unity3d.com/2018.1/Documentation/Manual/UnityIAPSubscriptionProducts.html
     
    kirill66552 likes this.
  3. kirill66552

    kirill66552

    Joined:
    Feb 2, 2020
    Posts:
    2
  4. Goodsquirrel

    Goodsquirrel

    Joined:
    May 25, 2022
    Posts:
    2
    @SamOYUnity3D : I had the same issue/question in 8/2023 (using IAP 4.9.4). Good to know that this is 'expected behavior'. Are there any plans at Unity Technologies to implement some sort of 'fakeSubscriptionInfo' in your fake store? I think every subscription based app has some business logic that relies on checking the subscription state. And it would be great to be able to a) test that behavior in play mode with a fake store, b) not get spammed with console errors when running the app in the editor. Thanks from Berlin, Germany for your help and effort (and for Unity in general!)
     
    vejab and anisimovdev like this.
  5. Skrimel

    Skrimel

    Joined:
    Jul 30, 2017
    Posts:
    4