Search Unity

Subscription Purchase in iOS

Discussion in 'iOS and tvOS' started by siddharth3322, Jan 16, 2017.

  1. siddharth3322

    siddharth3322

    Joined:
    Nov 29, 2013
    Posts:
    1,049
    My app contains subscription based functionality for purchase. So which way I require to move ahead into this. When I search for this in Google, I always found Consumable and Non-Consumable related product purchase related source code.

    I want to move ahead with Renewable Subscription purchase. At present i have Prime31 plugin with following source code written:

    Code (CSharp):
    1. #if UNITY_ANDROID
    2.          var productId = GameConstants.SKU_PURCHASE_9999_COINS;
    3. ////        var productId = GameConstants.SKU_ANDROID_TEST_PURCHASE;
    4.          #elif UNITY_IOS
    5.          var productId = GameConstants.SKU_PURCHASE_9999_COINS;
    6.          #endif
    7.          IAP.purchaseConsumableProduct (productId,  (didSucceed, error) => {
    8.              Debug.Log ("purchasing product " + productId + " result: " + didSucceed);
    9.              if (didSucceed) {                  
    10.              }              
    11.          });
    Whether same code, Can I use for Subscription purchase? What is alternative way for me to implement Subscription purchase?
     
  2. siddharth3322

    siddharth3322

    Joined:
    Nov 29, 2013
    Posts:
    1,049
    Now at least I found a way to purchase and restoring a Subscription in Unity.

    https://unity3d.com/learn/tutorials/topics/ads-analytics/integrating-unity-iap-your-game

    After this implementation, I got another doubts in mind:

    • How to get expire time at every launch of game?
    • How to validate receipt with Apple server?
    I have watched this video and they are explaining all process but this video was in core iOS platform.



    Now something similar I want to do with Unity so what is a way for this?