Search Unity

Long delay after UnityIAP inventory is refreshed

Discussion in 'Unity IAP' started by icebear007, May 26, 2019.

  1. icebear007

    icebear007

    Joined:
    Jun 8, 2016
    Posts:
    67
    Hi,

    During startup on Android I encounter a long delay of about 12 seconds since adding IAP. Nothing seems to happen in that time:

    05-26 15:09:20.181 5365 5469 I UnityIAP: Inventory refresh successful. (response: 0:OK)
    //...
    05-26 15:09:32.129 5365 5421 I Unity : UnityIAP: Promo interface is available for 56 items

    Has anyone had a similar problem? I wonder if there's something wrong with my IAP setup. I'm using
    - Unity 2019.1.3f1
    - In App Purchasing 2.0.6 (via package manager)
    - Unity IAP 1.22.0 (via services tab)

    Thanks,
    Alex

    Code (CSharp):
    1.  
    2. 05-26 15:09:20.063  5365  5469 I UnityIAP: Purchase history response: 0
    3. 05-26 15:09:20.063  5365  5469 I UnityIAP: Continuation token: null
    4. 05-26 15:09:20.063  5365  5469 I UnityIAP: Querying owned items' purchase history, item type: inapp
    5. 05-26 15:09:20.063  5365  5469 I UnityIAP: Package name: com.XXX.XXX
    6. 05-26 15:09:20.063  5365  5469 I UnityIAP: Calling getPurchaseHistory with continuation token: null
    7. 05-26 15:09:20.065  4075  4092 I Finsky  : [4073] emg.b(9): com.XXX.XXX: Account determined from installer data - [XXX]
    8. 05-26 15:09:20.066  4075  4092 I Finsky  : [4073] emg.b(16): com.XXX.XXX: Account from preferred account - [XXX]
    9. 05-26 15:09:20.181  5365  5469 I UnityIAP: Purchase history response: 0
    10. 05-26 15:09:20.181  5365  5469 I UnityIAP: Continuation token: null
    11. 05-26 15:09:20.181  5365  5469 I UnityIAP: onQueryInventoryFinished: true
    12. 05-26 15:09:20.181  5365  5469 I UnityIAP: Inventory refresh successful. (response: 0:OK)
    13. 05-26 15:09:20.189  4091  4247 D NetworkStateUtils: netWorkState=1
    14. 05-26 15:09:21.687  5102  5127 D NtpTrustedTime: forceRefreshInternal() - No network connected
    15. 05-26 15:09:23.490   885  1027 E libc    : Access denied finding property "sys.thermal.para"
    16. 05-26 15:09:23.484   885   885 W thermal-engine: type=1400 audit(0.0:164520): avc: denied { read } for name="u:object_r:system_prop:s0" dev="tmpfs" ino=20136 scontext=u:r:thermal-engine:s0 tcontext=u:object_r:system_prop:s0 tclass=file permissive=0
    17. 05-26 15:09:24.691  5102  5127 D NtpTrustedTime: forceRefreshInternal() - No network connected
    18. 05-26 15:09:27.691  5102  5127 D NtpTrustedTime: forceRefreshInternal() - No network connected
    19. 05-26 15:09:28.490   885  1027 E libc    : Access denied finding property "sys.thermal.para"
    20. 05-26 15:09:28.484   885   885 W thermal-engine: type=1400 audit(0.0:164521): avc: denied { read } for name="u:object_r:system_prop:s0" dev="tmpfs" ino=20136 scontext=u:r:thermal-engine:s0 tcontext=u:object_r:system_prop:s0 tclass=file permissive=0
    21. 05-26 15:09:29.120  4075  4096 I Finsky  : [4076] ifm.run(3): Stats for Executor: BlockingExecutor igw@c521717[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 11]
    22. 05-26 15:09:29.121  4075  4096 I Finsky  : [4076] ifm.run(3): Stats for Executor: LightweightExecutor igw@4c70704[Running, pool size = 4, active threads = 0, queued tasks = 0, completed tasks = 61]
    23. 05-26 15:09:29.225  4075  4096 I Finsky  : [4076] ifm.run(3): Stats for Executor: bgExecutor igw@df964ed[Running, pool size = 4, active threads = 0, queued tasks = 0, completed tasks = 43]
    24. 05-26 15:09:30.691  5102  5127 D NtpTrustedTime: forceRefreshInternal() - No network connected
    25. 05-26 15:09:32.103   662  5472 I netd    : ;; res_nquery(cdp.cloud.unity3d.com, 1, 1)
    26. 05-26 15:09:32.129  5365  5421 I Unity   : UnityIAP: Promo interface is available for 56 items
    27. 05-26 15:09:32.129  5365  5421 I Unity   :
    28. 05-26 15:09:32.129  5365  5421 I Unity   : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 48)
    29. 05-26 15:09:32.129  5365  5421 I Unity   :
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    56 items is quite a few products, what are the results of your testing when you specify 4-5 products?
     
  3. icebear007

    icebear007

    Joined:
    Jun 8, 2016
    Posts:
    67
    It didn't make any difference. Assuming my problem doesn't have to do with the number of products, would it still be an issue to have that many products?
    All the products are quite similar - there are 3 classes of products and a about a dozen products in each class. If I can add some metadata to the purchase that I can retrieve in ProcessPurchase(), I wouldn't need 50+ products.
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    No known issues with the number of products. How many did you test with? Can you share the log that appears between the //...
     
  5. icebear007

    icebear007

    Joined:
    Jun 8, 2016
    Posts:
    67
    There was no Unity related log. However, I think might have solved the issue by completely removing IAP and reinstalling it. It's now down to ~1.5 seconds which might have to do with other Unity internals too.