Search Unity

[Closed] UnityIAP : Allowing Purchase Deferral

Discussion in 'Unity IAP' started by mleesago, Oct 18, 2017.

Thread Status:
Not open for further replies.
  1. mleesago

    mleesago

    Joined:
    Jan 18, 2017
    Posts:
    10
    Hi there,

    Our team makes games for children on both iOS and Android platform.

    Recently, as you might know, Apple has added a new feature on App Store for promoting in-app purchases on iOS 11. We have decided to support this feature using UnityIAP plugin but our most recent submission to App Store got rejected due to the app not having a parental gate to keep children away from being able to make purchases through IAP promotion. When we have looked deeper into the native classes included in UnityIAP plugin, we have noticed that EarlyTransactionObserver does not support users to queue up any payments as a deferral and process these purchases in a controlled manner. After making some changes to EarlyTransactionObserver and adding an additional native class that exposes some functionality to the scripting side, we were able to get the payment deferral working. But if we are to keep them around, it will get harder for us to upgrade UnityIAP plugin when it has really important updates that we want to include in our next release. So it would really help if you guys would consider adding this functionality for the UnityIAP plugin. And I think it will be very useful for reasons other than a parental gate.

    Below is some useful information:
    • Unity Version: 5.4.5f1
    • Unity IAP Version: 1.13.3
    • Platform: iOS
    • Store: App Store

    Just to give an overview, we have added a forceDeferPayment boolean property that users will have to set to true early in the lifecycle of the app. On paymentQueue:shouldAddStorePayment forProduct selector, we check for readyToReceiveTransactionUpdates && !forceDeferPayment, and in the other case, we queue up payment by caching it into a local variable and invoking a callback telling users that there is a queued payment ready to be processed. There is an instance method, forceInitiateQueuedPayment, that we have added for users to call to initiate these payment(s) that have been queued. There are also three other instance methods, getQueuedPaymentProductId for returning product ID for the users, clearQueuedPayment for clearing out queued payment, and hasQueuedPayment for checking if there is a queued payment.

    The catch is that we are queuing only one payment at a time, which can be overwritten because we only have a subscription model as our IAP product and didn't make sense for us to queue up more than one payment. But for the purpose of the plugin, it might be good to give users the ability to queue up more than one payment at a time, but it might just have to be in an order for a better control.

    I have already made a feature request posting but thought I bring it up here as well. It might not make sense describing everything in words so I have included a zip file with modified EarlyTrasactionObserver and native class header and implementation files that expose some functionality to scripting end.

    Thank you.
     

    Attached Files:

  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Thank you for the information, we have passed this along to our IAP team for review.
     
Thread Status:
Not open for further replies.