Search Unity

IOS grace period question

Discussion in 'Unity IAP' started by EmilieCollard191, Mar 13, 2020.

  1. EmilieCollard191

    EmilieCollard191

    Joined:
    May 8, 2019
    Posts:
    77
    Hi I was wondering if the unity iap SubscriptionInfo isSubscribed() take account of the IOS grace period?
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    We would need to test. What are you seeing in your testing?
     
  3. EmilieCollard191

    EmilieCollard191

    Joined:
    May 8, 2019
    Posts:
    77
    I was asking because it pretty hard to test that on ios.
    We currently have a way of checking if the user is in the grace period but not with unity IAP.
    It would be nice if it's supported though.

    Edit:
    The only info I have for grace period with IAP is from here https://forum.unity.com/threads/check-if-subscription-has-ended.571627/#post-5162906
    This post seem to say grace period are supported(On android though)
    I just wanted to be sure of the fact.
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
  5. EmilieCollard191

    EmilieCollard191

    Joined:
    May 8, 2019
    Posts:
    77
  6. EmilieCollard191

    EmilieCollard191

    Joined:
    May 8, 2019
    Posts:
    77
    Hello do you have any update on this?
     
  7. SamOYUnity3D

    SamOYUnity3D

    Unity Technologies

    Joined:
    May 12, 2019
    Posts:
    626
    You need to check the is_in_billing_retry_period by access the verifyReceipt endpoint. https://developer.apple.com/documentation/appstorereceipts

    Implement a grace period to improve recovery, if the value is “1” and the expires_date is in the past. A grace period is free or limited subscription access while a subscriber is in a billing retry state. https://developer.apple.com/documentation/appstorereceipts/is_in_billing_retry_period
     
  8. EmilieCollard191

    EmilieCollard191

    Joined:
    May 8, 2019
    Posts:
    77
    Yes This is our current way of doing that. I wanted to know if iap support grace period or will support it.
    Thanks
     
  9. SamOYUnity3D

    SamOYUnity3D

    Unity Technologies

    Joined:
    May 12, 2019
    Posts:
    626
    According to the AppleInAppPurchaseReceipt class, I didn't see any field related to the Subscription Retry Flag or is_in_billing_retry_period, so we currently do not provide this information. I think we need to wait until the new IAP version is released to know if there is any change here.

    Code (CSharp):
    1. using System;
    2.  
    3. using UnityEngine.Purchasing.Security;
    4.  
    5. public class AppleInAppPurchaseReceipt : IPurchaseReceipt
    6. {
    7.     public int quantity {
    8.         get;
    9.         internal set;
    10.     }
    11.  
    12.     public string productID {
    13.         get;
    14.         internal set;
    15.     }
    16.  
    17.     public string transactionID {
    18.         get;
    19.         internal set;
    20.     }
    21.  
    22.     public string originalTransactionIdentifier {
    23.         get;
    24.         internal set;
    25.     }
    26.  
    27.     public DateTime purchaseDate {
    28.         get;
    29.         internal set;
    30.     }
    31.  
    32.     public DateTime originalPurchaseDate {
    33.         get;
    34.         internal set;
    35.     }
    36.  
    37.     public DateTime subscriptionExpirationDate {
    38.         get;
    39.         internal set;
    40.     }
    41.  
    42.     public DateTime cancellationDate {
    43.         get;
    44.         internal set;
    45.     }
    46.  
    47.     public int isFreeTrial {
    48.         get;
    49.         internal set;
    50.     }
    51.  
    52.     public int productType {
    53.         get;
    54.         internal set;
    55.     }
    56.  
    57.     public int isIntroductoryPricePeriod {
    58.         get;
    59.         internal set;
    60.     }
    61. }
    62.  
     
  10. EmilieCollard191

    EmilieCollard191

    Joined:
    May 8, 2019
    Posts:
    77