Search Unity

[Solved] How to determine if _all_ IAP products have been initialized ?

Discussion in 'Unity IAP' started by elenzil, Sep 26, 2017.

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

    elenzil

    Joined:
    Jan 23, 2014
    Posts:
    73
    We have four IAP products, and looking at the logs i see Unity requesting four of them but only receiving three back from apple:

    Code (csharp):
    1. UnityIAP:Requesting 4 products
    2. ...
    3. UnityIAP:Received 3 products
    how can i detect this situation in
    Code (csharp):
    1. OnInitialized(IStoreController controller, IExtensionProvider extensions)
    ?

    The value of
    Code (csharp):
    1. controller.products.all.Length
    in there is 4.
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Are you still able to purchase all 4 items?
     
  3. elenzil

    elenzil

    Joined:
    Jan 23, 2014
    Posts:
    73
    hi - thanks for replying so fast!

    no.
    One of the four items has an empty string for product.metadata.localizedPriceString, and that one also cannot be purchased.

    When i write a native Objective-C OSX (yes osx) app which has the same bundle ID, and issue a StoreKit
    SKProductsRequest with the four product IDs, they all come back just fine.

    Update:
    It now works.
    This must have been some flub within apple's IAP system.
    Everything i've described here was with the live app and live IAPs.

    That said,
    it would still be nice to have a more formal way to get the number of successful items besides testing if LocalizedPrice is empty.
     
  4. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
  5. elenzil

    elenzil

    Joined:
    Jan 23, 2014
    Posts:
    73
Thread Status:
Not open for further replies.