IAP::restore() bug on Android

Hello there!

I’m using SDKBOX IAP plugin and I noticed that if I call the plugin from the cocos Activity everything works fine, but if I call the plugin (e.g. iap::restore()) from another activity NONE of the callbacks is called and the only output I get is this line:

08-11 11:14:24.085 23152-23152/com.xxx.yyy D/IAP: GooglePlay result : 3 msg : com.xxx.yyy.iapid

I think this is a bug not being able to use the plugin from another activity apart from the cocos one? How can I resolve this?

Thanks

Davide

How are you calling iap::restore from another activity, do you invoke it from java?

Hi nite.

I have a custom SettingsActivity.java in Android Studio which I use to store the settings of the game in an android-fashioned view. Here I have a restore button which calls a JNI method that in turns calls

sdkbox::IAP::restore();

SDKBOX was designed to be used within cocos2dx thread, maybe you can wrap your JNI call with performFunctionInCocosThread see here