[SOLVED] Crash ios app when setListener SDKBOX IAP

[SOLVED] Crash ios app when setListener SDKBOX IAP
0.0 0

#1

Hi guys,
I have a bug on ios. When I call setListener for the IAP plugin and next I call cc.game.restart() => the game has crashed.

this my code:
sdkbox.IAP.setListener({
onSuccess : function (product) {
//seft.onSuccess(product);
},
onFailure : function (product, msg) {
//seft.onFailure(product, msg);
},
onCanceled : function (product) {
//seft.onCanceled(product);
},
onRestored : function (product) {
//seft.onRestored(product);
},
onProductRequestSuccess : function (product) {
//seft.onProductRequestSuccess(product);
},
onProductRequestFailure : function (msg) {
//seft.onProductRequestFailure(msg);
}
});

this sreenshot for bug:
http://prntscr.com/inf9f5

tks lot,


#2

@nite help me?


#3

@yinjimmy help me, please?


#4

i have a solution, helpful for u!

i register listener IAP in onEnter() function and remove listener IAP in onExit() function


#5

@mailaminh12 tks your solution,

i will try it :+1:


#6

as mailaminh12 said, clean the listener before call cc.game.restart().

for example:

sdkbox.IAP.setListener({});
cc.game.restart();

#7

tks, i solved it