Search Unity

UnityIAP: ProcessPurchase not called on startup

Discussion in 'Android' started by ErwinTerpstra, Aug 11, 2016.

  1. ErwinTerpstra

    ErwinTerpstra

    Joined:
    Sep 29, 2015
    Posts:
    4
    Hi, I'm trying to get the Unity IAP system working on Android. Almost everything seems to work. But when I restart my app, the ProcessPurchase method is not called. Therefore the purchased items are not unlocked in-game. From what I can read in the documentation (https://docs.unity3d.com/Manual/UnityIAPRestoringTransactions.html), this method should be called automatically. This seems only the case when starting the application the first time after installing it. Does Unity assume that you save the unlocked purchases locally?

    The logcat output indicates the items are marked as 'owned'. But because the transaction is already recorded, it isn't processed again? How do I get Unity to call ProcessPurchase for these purchases?

    I/UnityIAP(25500): Starting in-app billing setup.
    I/UnityIAP(25500): Billing service connected.
    I/UnityIAP(25500): invoking callback
    I/UnityIAP(25500): Checking for in-app billing 3 support.
    I/UnityIAP(25500): In-app billing version 3 supported for com.grendelgames.garfield.dev
    I/UnityIAP(25500): Subscriptions AVAILABLE.
    I/UnityIAP(25500): onIabSetupFinished: 0
    I/UnityIAP(25500): Requesting 5 products
    I/UnityIAP(25500): QueryInventory: 5
    I/UnityIAP(25500): invoking callback
    I/UnityIAP(25500): Querying owned items, item type: inapp
    I/UnityIAP(25500): Package name: com.grendelgames.garfield.dev
    I/UnityIAP(25500): Calling getPurchases with continuation token: null
    I/UnityIAP(25500): Owned items response: 0
    I/UnityIAP(25500): Sku is owned: com.grendelgames.garfield.venice
    I/UnityIAP(25500): Sku is owned: com.grendelgames.garfield.amsterdam
    I/UnityIAP(25500): Sku is owned: com.grendelgames.garfield.world_pass
    I/UnityIAP(25500): Continuation token: null
    I/UnityIAP(25500): Querying SKU details.
    I/UnityIAP(25500): Querying owned items, item type: subs
    I/UnityIAP(25500): Package name: com.grendelgames.garfield.dev
    I/UnityIAP(25500): Calling getPurchases with continuation token: null
    I/UnityIAP(25500): Owned items response: 0
    I/UnityIAP(25500): Continuation token: null
    I/UnityIAP(25500): Querying SKU details.
    I/UnityIAP(25500): onQueryInventoryFinished: true
    I/UnityIAP(25500): Inventory refresh successful. (response: 0:OK)
    I/Unity (25500): Already recorded transaction kjeobmbgeedimmihldkgmhln.AO-J1OxXpvh1fbvFr52xxml7FfhNOurKv9J1D50dEtEZ5KNac-c450AH3LnGT1VJENIy0bHz9TlXFeDHTuMhyWD_Nq-7LCBrgnzUmuOExNak4qZC6-rb1YuUiKUDibEgXXAKe9c1FE7fhM5bgrgSTlU3WWEYh9erKucaFFKNKiwiPx2CqO81oKQ
    I/UnityIAP(25500): Finish transaction:kjeobmbgeedimmihldkgmhln.AO-J1OxXpvh1fbvFr52xxml7FfhNOurKv9J1D50dEtEZ5KNac-c450AH3LnGT1VJENIy0bHz9TlXFeDHTuMhyWD_Nq-7LCBrgnzUmuOExNak4qZC6-rb1YuUiKUDibEgXXAKe9c1FE7fhM5bgrgSTlU3WWEYh9erKucaFFKNKiwiPx2CqO81oKQ
    I/Unity (25500): Already recorded transaction hopfojbbnobcbjnhaddiioim.AO-J1Oxz0BcfyzBvzuLF9ewS07S_GGA1-7RxxuOYfpxApdSD4hCK0_0Z0TSGspJRQPCsJomyZQ3x30O246MMnL0Lhrv68ZV-KlnvQW9aeJX3aL5bKiqmIOA5u-NFIdRjrtqavWzl6sf5NxXn83j5bqFl-mG_ovQw_g
    I/UnityIAP(25500): Finish transaction:hopfojbbnobcbjnhaddiioim.AO-J1Oxz0BcfyzBvzuLF9ewS07S_GGA1-7RxxuOYfpxApdSD4hCK0_0Z0TSGspJRQPCsJomyZQ3x30O246MMnL0Lhrv68ZV-KlnvQW9aeJX3aL5bKiqmIOA5u-NFIdRjrtqavWzl6sf5NxXn83j5bqFl-mG_ovQw_g
    I/Unity (25500): Already recorded transaction docaedeeiifnldmgnhenblgd.AO-J1OyOtVQdvUibLO10J1UGJkuAGEnDHKZ1BHuIXUNUWZpyJ2D-i2wiI3du6jw7UNHNPOWonz-g2UQQXpR2J5_4Pe4bR-JIuQ99Pvqh0_pdDvYBWu0aJkH7bsp8Co7FaTY8OmUjCHXdC8Nfo1vJoIUM-AaO2_ArFwf1yUHp-ATcGc4NwWloj60
     
  2. Fireflow-Prime

    Fireflow-Prime

    Joined:
    Oct 15, 2015
    Posts:
    3
    Hello, im having the same problem.
    Is there any way to get ProcessPurchase called on startup? (for example to verify a renewable subscription?)
     
  3. Kurius

    Kurius

    Joined:
    Sep 29, 2013
    Posts:
    412