Skip to content
This repository has been archived by the owner on Apr 28, 2022. It is now read-only.

In ios, the crash occurred when consumeProduct method is called. #105

Open
ikpil opened this issue Jan 27, 2016 · 0 comments
Open

In ios, the crash occurred when consumeProduct method is called. #105

ikpil opened this issue Jan 27, 2016 · 0 comments

Comments

@ikpil
Copy link

ikpil commented Jan 27, 2016

Unhandled Exception: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.

at System.Collections.ObjectModel.Collection1[T].CheckWritable (IList1 list) [0x00000] in :0
at System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (.TKey key) [0x00000] in :0
at OnePF.OpenIAB_iOS.Sku2StoreSku (System.String sku) [0x00000] in :0
at OnePF.OpenIAB_iOS.consumeProduct (OnePF.Purchase purchase) [0x00000] in :0
at OnePF.OpenIAB.consumeProduct (OnePF.Purchase purchase) [0x00000] in :0

For IOS
When OnPurchaseSucceeded of OpenIABEventManager is called, have to change storeSKU to GameSKU.

So changed as follows :

OpenIABEventManager.cs

#if UNITY_IOS
    ...
    ...
    private void OnPurchaseSucceeded(string json)
    {
        if (purchaseSucceededEvent != null)
        {
            //purchaseSucceededEvent(new Purchase(json)); // <-- have to change storeSKU to gameSKU.
            purchaseSucceededEvent(new Purchase(new OnePF.JSON(json)));
        }
    }
    ...
    ...
#endif

Good luck!!!

@ikpil ikpil changed the title In ios, consumeProduct method is called when a crash bug !!!! In ios, the crash occurred when consumeProduct method is called. Jan 27, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant