SIS without Prefabs & Duplicated Purchase



  • So I don't want to use Prefabs and ScrollView.

    So 1st click is normal. But 2nd click on Same Product Button with call of IAPManager.PurchaseProduct() is left without answer.

    So in this case I have no call of handlers for next event:

    IAPManager.purchaseSucceededEvent
    IAPManager.purchaseFailedEvent

    Unity IAP itself calls OnPurchaseFailed with PurchaseFailureReason.DuplicateTransaction.

    Why I have not answer?

    Your docs say that I can use SIS without prefabs.



  • Why I have not answer?

    Your docs say that I can use SIS without prefabs.

    You can.

    I assume you tested in the Unity editor. When running in the editor, Unity IAP does not know whether your product is consumable or non-consumable. In fact, it doesn't know anything about your products at all. The editor is not connected to any App Store. Therefore Unity IAP notices that the transactions exists, but cannot process it further.

    If you test on an actual device, e.g. Android phone, you will receive a failed message for duplicated transaction. This is definitely not something the end user should see - you should avoid this scenario by checking DBManager.isPurchased(productId) before calling IAPManager.PurchaseProduct. As per user guidelines on Google Play and iTunes, it would be even better to disable the buy button completely in that case.



  • I test subscription purchase in Editor for Android in Unity 2019.4.1

    I just tested with pure implementation of Unity IAP (without SIS).
    So in Editor with second click I got successful purchase (yes, no duplicated transaction, but I still have the answer).



  • Unity Editor uses fake receipts. You can not test for Android in the editor. You need to do it on a real device.



  • @Baroni Ok, I understand the fake testing in Editor & will use DBManager.isPurchased(productId), but providing answer for fake testing in Editor for such case would be convenient, just for fake testing in Editor.

    How can I get localizedPriceString in this paradigm (SIS without Prefabs)?



  • Right, I'll look into improving the editor events. On the first look there is nothing useful returned by Unity IAP, so I might need to add an additional check.

    @andrewio said in SIS without Prefabs & Duplicated Purchase:

    How can I get localizedPriceString in this paradigm (SIS without Prefabs)?

    -> https://www.rebound-games.com/forum/topic/2394/fetch-and-localized-prices-from-app-stores-manually



  • @Baroni said in SIS without Prefabs & Duplicated Purchase:

    Right, I'll look into improving the editor events. On the first look there is nothing useful returned by Unity IAP, so I might need to add an additional check.

    Is there specific place on forum where users can post ideas to improving/features requesting for SIS?



  • In a separate, or related thread. I keep track of all forum posts and add feature requests to my to-do list if it makes sense.


Log in to reply