[Plugin-x Bug]onPayResult() didn't execute (plugin-x;plugin\samples\HelloIAP)

Problem description:
I have compiled the Plugin-X Project into Android Devices , and executed HelloIAP projects successed.
After i pay for the goods successful ,the function onPayResult() is still not execute.

environment:samsung i9300 , v4.1.1

However,it can works in samsung i9000,v2.3.3.

Is there anyone knows how to let the developer know the bug?

Here is the related code , you can also see more details in cocos2dx_root\plugin\samples\HelloIAP

MyPurchase.h

class MyPurchaseResult : public cocos2d::plugin::PayResultListener
{
public:
virtual void onPayResult(cocos2d::plugin::PayResultCode ret, const char* msg, cocos2d::plugin::TProductInfo info);
};

MyPurchase.cpp

if (s_pRetListener == NULL)
{
s_pRetListener = new MyPurchaseResult();
}

s_pAlipay->setResultListener(s_pRetListener);

its a bug~~
Plugin-x try to get a plugin by its java pointer as its key, but store plugins by their reference pointer generated by NewGlobalRef. So all the java code callback will not take effect because it cannot find the plugin instance.

wujiayi wu wrote:

its a bug~~
Plugin-x try to get a plugin by its java pointer as its key, but store plugins by their reference pointer generated by NewGlobalRef. So all the java code callback will not take effect because it cannot find the plugin instance.

Do you know how to fix it?

I did not notice it works in some devices. I store the plugin using their java pointer as a key. But you still need to generate a reference pointer so that gc will not delete the java plugin instance.

wujiayi wu wrote:

I did not notice it works in some devices. I store the plugin using their java pointer as a key. But you still need to generate a reference pointer so that gc will not delete the java plugin instance.

Thank you for your help.
After several day for this ,i still cannot fix it.
I will be very grateful if you describe the process of how to fix it with more details when you are free.

Is there anyone could help me?
I’m really really needs your help:(

Hi guys. The bug has been resolved two months ago. Take a look at this issue please:
http://www.cocos2d-x.org/issues/2155

You can get the correct code in the latest release version 2.1.4.

Sorry for my mistake! :frowning:

Bin Zhang wrote:

Hi guys. The bug has been resolved two months ago. Take a look at this issue please:
http://www.cocos2d-x.org/issues/2155
>
You can get the correct code in the latest release version 2.1.4.
>
Sorry for my mistake! :frowning:

Thank you very much!
You really saved me!:smiley: