Quantcast
Channel: Cocos Forums - Latest topics
Viewing all articles
Browse latest Browse all 17083

Sdkbox.IAP.refresh is successfull, but return wrong data

$
0
0

@skalexey2 wrote:

Hi all.
I am using IAP plugin v2.0.3.4 with cocos2d-js-v3.6.1.
I have created and configured products and test accounts in iTunes Connect. I configured my sdkbox_config.json such as follow:

{
"android": {
    "GoogleAnalytics": {
        "trackingCode": "my tracking code"
    }, 
    "Facebook": {
        "debug": true
    }, 
    "iap": {
        "items": {
            "test_product_2": {
                "id": "sly_coon_test_2d"
            }, 
            "test_product_1": {
                "id": "sly_coon_test_1d"
            }
        }, 
        "key": "here is my key"
    }
}, 
"ios": {
    "GoogleAnalytics": {
        "trackingCode": "my tracking code"
    }, 
    "Facebook": {
        "debug": true
    }, 
    "iap": {
        "items": {
            "test_product_2": {
                "id": "sly_coon_test_2d"
            }, 
            "test_product_1": {
                "id": "sly_coon_test_1d"
            }
        }
    }
}

}

Then on my real test iOS device (without account information as described here: https://developer.apple.com/library/ios/documentation/LanguagesUtilities/Conceptual/iTunesConnectInAppPurchase_Guide/Chapters/TestingInAppPurchases.html ) I do next:

    g_iap_listener = new IapListener();
    sdkbox.IAP.setListener(g_iap_listener);
    sdkbox.IAP.init();
    sdkbox.IAP.refresh();

, where IapListener is my custom iap listener object:

var IapListener = function()
{

}

IapListener.prototype.onSuccess = function(product_info)
{
    LOG("IapListener.onSuccess: product_info: " + JSON.stringify(product_info));
}

IapListener.prototype.onFailure = function(product_info, msg)
{
    LOG("IapListener.onFailure: msg: " + msg);
}

IapListener.prototype.onCancelled = function(product_info)
{
    LOG("IapListener.onCancelled: product_info: " + JSON.stringify(product_info));
}

IapListener.prototype.onRestored = function(product_info)
{
    LOG("IapListener.onRestored: product_info: " + JSON.stringify(product_info));
}

IapListener.prototype.onProductRequestSuccess = function(products)
{
    LOG("IapListener.onProductRequestSuccess: products: " + JSON.stringify(products));
}

IapListener.prototype.onProductRequestFailure = function(msg)
{
    LOG("IapListener.onProductRequestFailure: msg: " + msg);
}

IapListener.prototype.onInitialized = function(ok)
{
    LOG("IapListener.onInitialized: ok: " + ok);
}

IapListener.prototype.onRestoreComplete = function(ok, msg)
{
    LOG("IapListener.onRestoreComplete: msg: " + msg + ", ok: " + ok);
}

Then I get follow result:

JS: 19.02 15:14:29:744  IapListener.onProductRequestSuccess: products: [{"name":"test_product_1","id":"sly_coon_test_1d","title":"","description":"","price":"","currencyCode":"","receipt":"","receiptCipheredPayload":""},{"name":"test_product_2","id":"sly_coon_test_2d","title":"","description":"","price":"","currencyCode":"","receipt":"","receiptCipheredPayload":""}]

But I have description, title and price for that products in iTunes-Connect.
Moreover, when I change product id in the config to some random string I get the same result, so I guess this data is wrong.

And when I try to purchase something from my list I get the error "Invalid product please double check the product id on itunes connect"

So it seems like IAP plugin don't perform any real requests to fetch the products real data maybe due to some errors, but I get successfull result with wrong data.

How is it possible ?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 17083

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>