SDKBOX 2.3.11 Release - New push notification

SDKBOX 2.3.11 Release - New push notification
0.0 0

#20

Any progress on this? I saw that @yinjimmy has tested it on iOS with a consumable product, but I don’t know it if will work with a non-consumable product (since this is the case for which neither of the functions work on Android). Also some time frame for the fix would be welcome as more than 2 weeks have passed and this is a blocking issue for me.


#21

It’s been another 2 weeks (1 month from your initial response) wondering if something is done about this as I see that no new SDKBOX versions are coming out either.


#22

Sorry to let this issue slip, we fixed it now and it’s under testing should be coming with 2.3.15 release


#23

Thank you. Looking forward to it!


#24

I update https://github.com/sdkbox/sdkbox-sample-iap js version.
Could you please help to test this issue ?
Thanks,


#25

Sorry for the delay,

I replaced the IAP plugin with the updated files from the sample, but non-consumable products still have empty receipt and receiptCipheredPayload fields on Android for all 3 functions (onProductRequestSuccess, onRestored and onSuccess).


#26

Sorry about that, I forgot to copy the google play services jar and google play plugin jar file. After that the onSuccess function worked. But the other 2 functions - onProductRequestSuccess and onRestored still return empty fields.

Could you fix them as well?


#27

Any updates ?


#28

Is there anyway we can look at your code and see what’s going on?


SDKBox - 2.3.17
#29

I just have log statements in the functions and look at what the listener argument is:

var sdkboxListenersIAP = {};

sdkboxListenersIAP.onSuccess = function (product) {
    cc.log('sdkbox IAP onSuccess', JSON.stringify(product));
};

sdkboxListenersIAP.onRestored = function (product) {
    cc.log('sdkbox IAP onRestored', JSON.stringify(product));
};

sdkboxListenersIAP.onProductRequestSuccess = function (products) {
    cc.log('sdkbox IAP onProductRequestSuccess', JSON.stringify(products));
};

sdkbox.IAP.setListener( sdkboxListenersIAP );

sdkbox.IAP.init();

sdkbox.IAP.refresh();

Before when I purchased a consumable, I got the receipt and receiptCipheredPayload fields in the onSuccess callback, but they were empty when I purchased a non-consumable. After the update from yinjimmy non-consumable items have data in these fields, but since non-consumables are always present, I would like the onProductRequestSuccess and onRestored to have these fields as well (both on Android and ciphered on iOS) since the user can already have the product, but since I can’t get a receipt (because he already has it and can’t purchase it again to trigger the onSuccess callback) I can’t validate it.


#30

Oh I understand now, will update you about the progress.


#31

Thank you!


#32

Tested with SDKBOX 2.3.15 but it seems that the 2 callbacks still aren’t fixed there.


#33

Any updates ? It’s been 4 weeks


#34

Any updates?


#35

So we did some research seems like there is no API to get the receipt for already purchased item.


#36

On Android you already have this data in the onProductRequestSuccess listener:

03-18 19:39:34.851 16636-16660/? D/IAP: GooglePlay Request result : 0 msg : Product request successful. data :[
{"id":"com.whitenovastudio.gametemplate.hd_graphics",
"title":"HD Graphics (game template 2)",
"desc":"Graphics that scale for larger displays",
"price":"BGN4.19",
"currencyCode":"BGN",
"priceValue":4.190000057220459,
"orderId":"",
"receipt":{
    "packageName":"com.whitenovastudio.GameTemplate",
    "productId":"com.whitenovastudio.gametemplate.hd_graphics",
    "purchaseTime":1489849392299,
    "purchaseState":0,
    "purchaseToken":"jnicfhncnageimjb..."},
"cipheredReceiptInfo":"nAQ21BlDcndmcazhlGUFMP..."},

{"id":"com.whitenovastudio.gametemplate.coin_pack_50",
"title":"50 Coins (game template 2)",
"desc":"50 coins to use for in-game items",
"price":"BGN2.39",
"currencyCode":"BGN",
"priceValue":2.390000104904175}]

This is from the adb log when using SDKBOX and the item com.whitenovastudio.gametemplate.hd_graphics is already purchased and non-consumable which is why the Android API returns the receipt and cipheredReceiptInfo, so you already have them, but for some reason in the JS wrapper they are empty even though the debug log says that there is data in them. I guess you use the same data for restore purchases, since there is no restore purchase logic on Android because you have the receipts when querying for the products. You just have to use the data from the fields if they exist and not leave them empty.

On iOS there is also logic for that, the transaction gets renewed and you have a ciphered receipt again which you can expose.

I can make an android function to get the product infos and call it from javascript every time I get a restored purchase, to get the receipt info myself, but since SDKBOX already has the data it seems pointless for me to write platform specific code if the sole purpose of this library is to wrap such code and reduce the maintenance of back-end SDKs.


#37

Sorry about that we’ll add that next release.


#38

Any updates on when this might come?

It seems that you don’t have many developers because updates are slow. Since I started using SDKBOX last December I still can’t publish a finished game because of problems like this.


#39

can you try to restore with the latest version, you should get receipt info.