IAP Android onSuccess never triggered

Hello , I’ve noticed that the IAP listener onSuccess is never been triggered , how can we navigate scenes inside the game after purchasing ?

keeping the info of the user in sharedpreferences or what alike to save user data … I’ve looked around found the userDefault but not in the javascript version … what is the alternative in cocosCreator ?

Thanks

Do you mean IAP plugin of SDKBox?
How do you test the IAP ?

Not sure if I have well understood your second question, but if you want to save data you can use
cc.sys.localStorage.setItem("DataName","yourData");

@yinjimmy
Yes InApp Purchases

I’ve uploaded apk to the google play console then I’ve added in app product item …

then tested it after purchasing
the onSuccess is not event triggered though

@abyssal_studio

Does this data stay in the application even if the user cleared the cache … What i mean I’m looking for a way to save the status of the user after purchasing or paying subscription fee ?

Is that clear ?

If they clear the cache yes, if they clear the data no. But you just have to listen onRestored event, and it will restore it :wink: You put the same thing on your onRestored function than on your onSuccess function.

For your onSuccess function I have no idea. You’ve made like this on the init? :

 sdkbox.IAP.setListener({
                onSuccess: function (product) {                
                        //onSucessfunction
                },
                onRestored: function (product) {
                    //Restore function
                }
            });

@abyssal_studio

Yes , you mean to implement the same methods on

onSuccess and onRestored ?

yes, to restore the datas

I’m not asking about the data … I’m looking for a way to configure the response once the purchase has been done ?
onSuccess isn’t being executed … I don’t know why ?

while the onProductRequestSuccess is running fully right … ?

If anybody can help ?