onepf / OpenIAB

Open In-App Billing for Google Play, SlideMe, Amazon Store, Nokia Store, Samsung Apps, Yandex.Store, Appland, Aptoide, AppMall and Fortumo.
http://onepf.org/openiab/
Apache License 2.0
476 stars 171 forks source link

LogWarning(Object) UnknownSKU: SKU:; #470

Open minhit1805 opened 9 years ago

minhit1805 commented 9 years ago

// create item; const string noads_item = "noads_item_tt";

//call init OPENIAB for IOS ; void Start () { Debug.Log ("init shop");
OpenIAB.mapSku (noads_item, OpenIAB_iOS.STORE, noads_item);

          var options = new Options ();
    options.checkInventoryTimeoutMs = Options.INVENTORY_CHECK_TIMEOUT_MS * 2;
    options.discoveryTimeoutMs = Options.DISCOVER_TIMEOUT_MS * 2;
    options.checkInventory = false;
    options.verifyMode = OptionsVerifyMode.VERIFY_SKIP;
    options.prefferedStoreNames = new string[] {
        OpenIAB_Android.STORE_GOOGLE,
        OpenIAB_Android.STORE_AMAZON,
        OpenIAB_Android.STORE_YANDEX
    };

// Transmit options and start the service OpenIAB.init (options); }

private void purchaseSucceededEvent(Purchase purchase) { Debug.Log("purchaseSucceededEvent: " + purchase); // _label = "PURCHASED:" + purchase.ToString(); switch (purchase.Sku) { // control product and price here; case noads_item: { //GameObject endIAP; //endIAP=GameObject.Find("StoreController"); //Destroy(endIAP); PlayerPrefs.SetInt("isnoadsdata",1); } break; default: Debug.LogWarning ("UnknownSKU: " + purchase); break; } }

On another class i call OpenIAB.purchaseProduct ("noads_item_tt"); what i was wrong here? can i pass this warning and build nomal on IOS?

rundev commented 9 years ago

Having same issue after upgrading to unity 5.0.0f4 on iOS. Everything worked perfectly in Unity 4.6x. After upgrade, I get "purchase succeeded" log without the actual sku string attached. The sku string gets lost after calling

public void PurchaseCoins(){ _processingPayment = true; OpenIAB.purchaseProduct(SKU_BUYCOINS); }

I've been using open IAB for a over a year now and want to continue using it, but I can't find where the problem is here.

I've updated to the latest OpenIAB package as well with no luck. I hope someone has a resolution for this.

rundev commented 9 years ago

rolling back to openIAB 0.9.7.2 resolves my issue and gets everything working again. Do I have to rewrite my code in order to update my openIAB package or could this be a bug?