Search Unity

[Solved] Weird Add Product Error

Discussion in 'Unity IAP' started by Helath, Jun 29, 2017.

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

    Helath

    Joined:
    Jan 3, 2013
    Posts:
    9
    After updating to the newest IAP we are starting to see an issue with initializing IAP.

    When we build for Gameroom it fails at StandardPurchasingModule.Instance() with the following print out:

    UnityIAP FB: Facebook already Initialized, checking...
    UnityIAP FB: Init OK
    UnityIAP FB: AppId [ID]
    UnityIAP FB: already logged in
    UnityIAP FB: token UserId [ID]
    UnityIAP FB: token ExpirationTime 8/28/2017 4:31:05 PM
    Unable to Initalize IAP Object reference not set to an instance of an object
    at UnityEngine.Purchasing.FacebookStoreBindings.RetrieveProducts (System.String json) [0x00000] in <filename unknown>:0
    at UnityEngine.Purchasing.FacebookStoreBindings.InitComplete () [0x00000] in <filename unknown>:0
    at UnityEngine.Purchasing.FacebookStoreBindings.Init () [0x00000] in <filename unknown>:0
    at UnityEngine.Purchasing.FacebookStoreImpl.SetNativeStore (INativeFacebookStore facebook) [0x00000] in <filename unknown>:0
    at UnityEngine.Purchasing.StandardPurchasingModule.InstantiateFacebook () [0x00000] in <filename unknown>:0
    at UnityEngine.Purchasing.StandardPurchasingModule.InstantiateStore () [0x00000] in <filename unknown>:0
    at UnityEngine.Purchasing.StandardPurchasingModule.Configure () [0x00000] in <filename unknown>:0
    at UnityEngine.Purchasing.Extension.AbstractPurchasingModule.Configure (IPurchasingBinder binder) [0x00009] in C:\buildslave\unity\build\Extensions\UnityPurchasing\Runtime\Purchasing\Extension\AbstractPurchasingModule.cs:17
    at UnityEngine.Purchasing.PurchasingFactory..ctor (IPurchasingModule first, UnityEngine.Purchasing.Extension.IPurchasingModule[] remainingModules) [0x0001f] in C:\buildslave\unity\build\Extensions\UnityPurchasing\Runtime\Purchasing\PurchasingFactory.cs:18
    at UnityEngine.Purchasing.ConfigurationBuilder.Instance (IPurchasingModule first, UnityEngine.Purchasing.Extension.IPurchasingModule[] rest) [0x00003] in C:\buildslave\unity\build\Extensions\UnityPurchasing\Runtime\Purchasing\ConfigurationBuilder.cs:89

    We thought we would give just a regular standalone build a try and it got past StandardPurchasingModule.Instance() and was able to print out one of the Products ID set:

    Adding Product : default1
    |MacAppStore -> default1
    |MoolahAppStore -> default1
    |SamsungApps -> default1
    |WinRT -> default1
    |TizenStore -> default1
    |AppleAppStore -> default1
    |GooglePlay -> default1
    |AmazonApps -> default1
    |FacebookStore -> default1

    But then it fails when trying to add the Ids to the builder:

    Argument cannot be null.
    Parameter name: key
    at System.Collections.Generic.Dictionary`2[System.String,System.String].ContainsKey (System.String key) [0x00099] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:474
    at UnityEngine.Purchasing.IDs.SpecificIDForStore (System.String store, System.String defaultValue) [0x00008] in C:\buildslave\unity\build\Extensions\UnityPurchasing\Runtime\Purchasing\ConfigurationBuilder.cs:41
    at UnityEngine.Purchasing.ConfigurationBuilder.AddProduct (System.String id, ProductType type, UnityEngine.Purchasing.IDs storeIDs) [0x00016] in C:\buildslave\unity\build\Extensions\UnityPurchasing\Runtime\Purchasing\ConfigurationBuilder.cs:103

    Any Ideas what could be the issue?
     
  2. Helath

    Helath

    Joined:
    Jan 3, 2013
    Posts:
    9
    Update with testing on an empty project:

    Facebook 7.10.0
    Unity IAP 1.11.4

    If Facebook Initializes first the above error will show, yet if UnityIAP initalizes facebook i recieve the following output:

    UnityIAP FB: AuthCallback()
    UnityIAP FB: token UserId [ID]
    UnityIAP FB: token ExpirationTime [Still Valid]
    UnityIAP FB: productRequest = /[AppId]/products
    UnityIAP FB: ProductListCallback() RawResult had an empty "data[]"
    Billing failed to initialize!

    So when I started to Initialize facebook first I tried calling the following:

    FB.API("/[AppId]/products", HttpMethod.GET, (t) => Debug.Log(t.RawResult));

    This returned all the purchases I set up in the facebook console, not an empty data[].

    Is Unity IAP not calling FB.API?
     
  3. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    @Helath,

    We have identified an initialization issue with the Facebook part of our plugin. We have a fix and it should be ready by the next version of the IAP plugin. (You should get an update notification in the Editor when this version is available.)

    I apologize for any inconvenience this has caused.
     
  4. adex0909

    adex0909

    Joined:
    Jul 8, 2012
    Posts:
    2
    I am also having this problem. Can you tell me when this problem will be resolved?
    There is not much time left for the game being developed.
     
    Last edited by a moderator: Sep 27, 2017
  5. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    @adex0909

    The plugin is being tested by QA. It should be released shortly, barring any significant issues.
     
  6. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
Thread Status:
Not open for further replies.