[SOLVED] Crash ios app when setListener SDKBOX IAP

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,

1 Like

@nite help me?

@yinjimmy help me, please?

i have a solution, helpful for u!

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

1 Like

@mailaminh12 tks your solution,

i will try it :+1:

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

for example:

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

tks, i solved it